Skip to content

Commit

Permalink
fix(ci): always login/logout local registry
Browse files Browse the repository at this point in the history
  • Loading branch information
wdconinc authored Jan 6, 2024
1 parent f6067cb commit 907a033
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,30 +159,28 @@ status:pending:
services:
- docker:dind
before_script:
- # Login to registries
- # Login to local registry
echo ${CI_REGISTRY_PASSWORD} | docker login -u ${CI_REGISTRY_USER} --password-stdin ${CI_REGISTRY}
- # Login to remote registries
if [[ -n "${EXPORT_TAG}" ]] ; then
if [[ -n "${DH_REGISTRY}" ]] ; then
echo ${DH_EICWEB_TOKEN} | docker login -u ${DH_REGISTRY_USER} --password-stdin ${DH_REGISTRY} ;
fi ;
if [[ -n "${GH_REGISTRY}" ]] ; then
echo ${GITHUB_REGISTRY_TOKEN} | docker login -u ${GITHUB_REGISTRY_USER} --password-stdin ${GH_REGISTRY} ;
fi ;
if [[ -n "${CI_REGISTRY}" ]] ; then
echo ${CI_REGISTRY_PASSWORD} | docker login -u ${CI_REGISTRY_USER} --password-stdin ${CI_REGISTRY} ;
fi ;
fi
after_script:
- # Logout from registries
- # Logout from local registry
docker logout ${CI_REGISTRY}
- # Logout from remote registries
if [[ -n "${EXPORT_TAG}" ]] ; then
if [[ -n "${DH_REGISTRY}" ]] ; then
docker logout ${DH_REGISTRY} ;
fi ;
if [[ -n "${GH_REGISTRY}" ]] ; then
docker logout ${GH_REGISTRY} ;
fi ;
if [[ -n "${CI_REGISTRY}" ]] ; then
docker logout ${CI_REGISTRY} ;
fi ;
fi

## base job settings for all docker build jobs
Expand Down

0 comments on commit 907a033

Please sign in to comment.