mirror of
https://github.com/containers/ansible-podman-collections.git
synced 2026-02-03 23:01:48 +00:00
30 lines
781 B
Bash
Executable file
30 lines
781 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -eux
|
|
|
|
if [[ -z "$1" ]]; then
|
|
echo "Please provide a tag!"
|
|
exit 1
|
|
fi
|
|
ANSIBLE_GALAXY_BIN=${GALAXY_PATH:-'ansible-galaxy'}
|
|
|
|
echo "Start building collection"
|
|
echo "Generating galaxy.yml for version $1"
|
|
./contrib/build.py "$1"
|
|
|
|
rm -rf build_artifact
|
|
mkdir -p build_artifact
|
|
|
|
${ANSIBLE_GALAXY_BIN} collection build --force --output-path build_artifact/
|
|
COLLECTION_P=$(ls build_artifact/*tar.gz)
|
|
|
|
echo "Publishing collection $COLLECTION_P"
|
|
|
|
output=$(python -m galaxy_importer.main $COLLECTION_P)
|
|
if echo $output | grep ERROR: ; then
|
|
echo "Failed check of galaxy importer!"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Running: ${ANSIBLE_GALAXY_BIN} collection publish --api-key HIDDEN $COLLECTION_P"
|
|
${ANSIBLE_GALAXY_BIN} collection publish --api-key $API_GALAXY_TOKEN $COLLECTION_P
|