summaryrefslogtreecommitdiffstats
path: root/ansible_collections/cyberark/conjur/ci/publish_to_galaxy
blob: 44a2aa16db94353897446bcebd77b04358f6069d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

set -euo pipefail

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

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

pushd "$TOP_LEVEL_DIR" >/dev/null
  docker run --rm -t \
    -e GALAXY_API_KEY \
    -v "$TOP_LEVEL_DIR:/collection" \
    python:3 /bin/bash -c "
      pip install ansible
      ansible-galaxy collection publish --api-key \${GALAXY_API_KEY} /collection/cyberark-conjur-${TAG}.tar.gz
    "
popd  >/dev/null