diff --git a/ci/input_files/build.yaml.tpl b/ci/input_files/build.yaml.tpl index 0229576e..449f6978 100644 --- a/ci/input_files/build.yaml.tpl +++ b/ci/input_files/build.yaml.tpl @@ -9,6 +9,7 @@ stages: - virtualenv venv - source venv/bin/activate - pip install .[dev] + - pip install poetry # This is for serverless framework .install-node: &install-node @@ -167,6 +168,7 @@ publish-pypi-package: stage: publish tags: ["arch:amd64"] image: registry.ddbuild.io/images/docker:20.10-py3 + before_script: *python-before-script cache: [] rules: - if: '$CI_COMMIT_TAG =~ /^v.*/' diff --git a/ci/publish_pypi.sh b/ci/publish_pypi.sh index d7ec78fd..c01df7ef 100755 --- a/ci/publish_pypi.sh +++ b/ci/publish_pypi.sh @@ -13,6 +13,14 @@ PYPI_TOKEN=$(aws ssm get-parameter \ --out text) # Builds the lambda layer and upload to Pypi +if [ -z "$CI_COMMIT_TAG" ]; then + printf "[Error] No CI_COMMIT_TAG found.\n" + printf "Exiting script...\n" + exit 1 +else + printf "Tag found in environment: $CI_COMMIT_TAG\n" +fi + # Clear previously built distributions if [ -d "dist" ]; then echo "Removing folder 'dist' to clear previously built distributions"