1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-02-04 07:11:49 +00:00

Fix publish job (#89)

Add dry run job for testing publishing
This commit is contained in:
Sergey 2020-07-22 13:06:07 +03:00 committed by GitHub
parent 869c644448
commit e1a81db9ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 74 additions and 11 deletions

View file

@ -1,3 +1,2 @@
PyYAML
galaxy-importer
virtualenv
#galaxy-importer

View file

@ -10,7 +10,7 @@ ANSIBLE_GALAXY_BIN=${GALAXY_PATH:-'ansible-galaxy'}
echo "Start building collection"
echo "Generating galaxy.yml for version $1"
./contrib/build.py "$1"
${PYTHON_PATH:-python} ./contrib/build.py "$1"
rm -rf build_artifact
mkdir -p build_artifact
@ -20,11 +20,15 @@ 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
# output=$(${PYTHON_PATH:-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
if [[ "${DRYRUN:-0}" == "1" ]]; then
${ANSIBLE_GALAXY_BIN} collection publish --api-key testkey $COLLECTION_P || true
else
${ANSIBLE_GALAXY_BIN} collection publish --api-key $API_GALAXY_TOKEN $COLLECTION_P
fi