Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log into RH container registry before pushing #1149

Merged
merged 1 commit into from
Feb 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ pipeline {
}

steps {
sh './bin/publish'
sh 'summon ./bin/publish'
}
}

Expand Down
14 changes: 10 additions & 4 deletions bin/publish
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,15 @@ if [ "$git_description" = "v${VERSION}" ]; then
echo "Tagging and pushing ${REDHAT_IMAGE}"

docker tag "secretless-broker-redhat:${FULL_VERSION_TAG}" "${REDHAT_IMAGE}:${VERSION}"
# you can't push the same tag twice to redhat registry, so ignore errors
if ! docker push "${REDHAT_IMAGE}:${VERSION}"; then
echo 'RedHat push FAILED! (Maybe the image was pushed already?)'
exit 0

if docker login scan.connect.redhat.com -u unused -p "${REDHAT_API_KEY}"; then
# you can't push the same tag twice to redhat registry, so ignore errors
if ! docker push "${REDHAT_IMAGE}:${VERSION}"; then
echo 'RedHat push FAILED! (maybe the image was pushed already?)'
exit 0
fi
else
echo 'Failed to log in to scan.connect.redhat.com'
exit 1
fi
fi
3 changes: 3 additions & 0 deletions secrets.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
common:
REDHAT_API_KEY: !var redhat/projects/secretless-broker/api-key

staging:
S3_BUCKET: staging-secretless-io

Expand Down