Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 35 lines (30 sloc) 1.29 KB
#!/bin/sh
set -e
# Obtain the component repository and log in
docker pull quay.io/keboola/developer-portal-cli-v2:latest
export REPOSITORY=`docker run --rm \
-e KBC_DEVELOPERPORTAL_USERNAME \
-e KBC_DEVELOPERPORTAL_PASSWORD \
quay.io/keboola/developer-portal-cli-v2:latest \
ecr:get-repository ${KBC_DEVELOPERPORTAL_VENDOR} ${KBC_DEVELOPERPORTAL_APP}`
eval $(docker run --rm \
-e KBC_DEVELOPERPORTAL_USERNAME \
-e KBC_DEVELOPERPORTAL_PASSWORD \
quay.io/keboola/developer-portal-cli-v2:latest \
ecr:get-login ${KBC_DEVELOPERPORTAL_VENDOR} ${KBC_DEVELOPERPORTAL_APP})
# Push to the repository
docker tag ${APP_IMAGE}:latest ${REPOSITORY}:${BITBUCKET_TAG}
docker tag ${APP_IMAGE}:latest ${REPOSITORY}:latest
docker push ${REPOSITORY}:${BITBUCKET_TAG}
docker push ${REPOSITORY}:latest
# Update the tag in Keboola Developer Portal -> Deploy to KBC
if echo ${BITBUCKET_TAG} | grep -c '^v\?[0-9]\+\.[0-9]\+\.[0-9]\+$'
then
docker run --rm \
-e KBC_DEVELOPERPORTAL_USERNAME \
-e KBC_DEVELOPERPORTAL_PASSWORD \
quay.io/keboola/developer-portal-cli-v2:latest \
update-app-repository ${KBC_DEVELOPERPORTAL_VENDOR} ${KBC_DEVELOPERPORTAL_APP} ${BITBUCKET_TAG} ecr ${REPOSITORY}
else
echo "Skipping deployment to KBC, tag ${BITBUCKET_TAG} is not allowed."
fi