Skip to content

Commit

Permalink
fix: use more consistent PACKAGE_VERSION instead of VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
bolinocroustibat committed Oct 16, 2024
1 parent 29efd6d commit 59dd579
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ jobs:
command: |
# Set the version
if [[ $CIRCLE_TAG ]]; then
export VERSION=$CIRCLE_TAG
export PACKAGE_VERSION=$CIRCLE_TAG
else
export VERSION=$(poetry version -s)$CIRCLE_BUILD_NUM+${CIRCLE_SHA1:0:7}
export PACKAGE_VERSION=$(poetry version -s)$CIRCLE_BUILD_NUM+${CIRCLE_SHA1:0:7}
fi
# Write it in a file
echo "export VERSION=\"$VERSION\"" >> .env_vars
echo "export PACKAGE_VERSION=\"$PACKAGE_VERSION\"" >> .env_vars
# Display some debug info
echo "Building a wheel release with version $VERSION, build number: $CIRCLE_BUILD_NUM, commit hash: ${CIRCLE_SHA1:0:7}, tag: $CIRCLE_TAG."
echo "Building a wheel release with version $PACKAGE_VERSION, build number: $CIRCLE_BUILD_NUM, commit hash: ${CIRCLE_SHA1:0:7}, tag: $CIRCLE_TAG."
- run:
name: Build a distributable package
command: |
Expand All @@ -108,7 +108,7 @@ jobs:
poetry build
else
# Relies on a dev version like "1.2.1.dev" by default
poetry version $VERSION
poetry version $PACKAGE_VERSION
poetry build
fi
- store_artifacts:
Expand All @@ -128,10 +128,10 @@ jobs:
name: Create a GitLab CI pipeline for deploying
command: | # https://docs.gitlab.com/ee/api/pipeline_triggers.html
source .env_vars
echo "Create a GitLab CI pipeline for deploying Hydra version $VERSION on dev with tag light..."
echo "Create a GitLab CI pipeline for deploying Hydra version $PACKAGE_VERSION on dev with tag light..."
curl --request POST \
--header "PRIVATE-TOKEN: ${GITLAB_PRIVATE_TOKEN}" \
--data '{ "ref": "main", "variables": [{"key": "SITE", "value": "dev.data.gouv.fr" }, {"key": "APP", "value": "hydra"}, {"key": "TAGS", "value": "light" }, {"key": "VERSION", "value": "$VERSION" }] }' \
--data '{ "ref": "main", "variables": [{"key": "SITE", "value": "dev.data.gouv.fr" }, {"key": "APP", "value": "hydra"}, {"key": "TAGS", "value": "light" }, {"key": "PACKAGE_VERSION", "value": "$PACKAGE_VERSION" }] }' \
https://gitlab.com/api/v4/projects/${GITLAB_PROJECT_ID}/pipeline
publish:
Expand Down

0 comments on commit 59dd579

Please sign in to comment.