Skip to content

Commit

Permalink
CNJR-0000 Merge pull request #6 from Conjur-Enterprise/update-collect…
Browse files Browse the repository at this point in the history
…ion-version

Automate Version Management for Ansible Collection
  • Loading branch information
Brugu Maharishi authored and GitHub Enterprise committed Oct 30, 2024
2 parents 7c02ff5 + 5971e79 commit 37801ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ci/build_release
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

set -euo pipefail

REPO="$(git rev-parse --show-toplevel)"
export COLLECTION_VERSION="$(cat "$REPO/VERSION" | cut -d'-' -f1)"
TOP_LEVEL_DIR="$(cd "$(dirname "$BASH_SOURCE")"; pwd)/.."

pushd "$TOP_LEVEL_DIR" >/dev/null
docker run --rm -t \
-v "$TOP_LEVEL_DIR:/collection" \
python:3 /bin/bash -c "
# Verify and replace the version in the galaxy.yml file
if [[ -n \"$COLLECTION_VERSION\" ]] && ! grep -q \"version: '$COLLECTION_VERSION'\" /collection/galaxy.yml; then
sed -i 's/version: \".*\"/version: \"$COLLECTION_VERSION\"/' /collection/galaxy.yml
fi
pip install ansible
ansible-galaxy collection build --force --output /collection/. /collection
"
Expand Down
2 changes: 1 addition & 1 deletion ci/publish_to_galaxy
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -euo pipefail

# Strip the 'v' from the Tag Name
TAG=${TAG_NAME//"v"}
TAG=${TAG//"v"}

TOP_LEVEL_DIR="$(cd "$(dirname "$BASH_SOURCE")"; pwd)/.."

Expand Down

0 comments on commit 37801ff

Please sign in to comment.