Skip to content
Snippets Groups Projects
Unverified Commit 0e45ed37 authored by Wouter Deconinck's avatar Wouter Deconinck Committed by GitHub
Browse files

fix(ci): mirror on push; trigger also on workflow_dispatch (#7)

* fix(ci): mirror on push; trigger also on workflow_dispatch

* fix(ci): always login/logout local registry
parent 60c933d0
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,7 @@ jobs: ...@@ -22,6 +22,7 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Push to EICweb - name: Push to EICweb
if: github.event_name == 'push'
uses: eic/gitlab-sync@master uses: eic/gitlab-sync@master
with: with:
url: https://eicweb.phy.anl.gov/containers/eic_container.git/ url: https://eicweb.phy.anl.gov/containers/eic_container.git/
...@@ -29,7 +30,7 @@ jobs: ...@@ -29,7 +30,7 @@ jobs:
username: ${{ secrets.GITLAB_USERNAME }} username: ${{ secrets.GITLAB_USERNAME }}
ciskip: true ciskip: true
- name: Trigger EICweb - name: Trigger EICweb
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
uses: eic/trigger-gitlab-ci@v2 uses: eic/trigger-gitlab-ci@v2
with: with:
url: https://eicweb.phy.anl.gov url: https://eicweb.phy.anl.gov
......
...@@ -159,7 +159,9 @@ status:pending: ...@@ -159,7 +159,9 @@ status:pending:
services: services:
- docker:dind - docker:dind
before_script: 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 "${EXPORT_TAG}" ]] ; then
if [[ -n "${DH_REGISTRY}" ]] ; then if [[ -n "${DH_REGISTRY}" ]] ; then
echo ${DH_EICWEB_TOKEN} | docker login -u ${DH_REGISTRY_USER} --password-stdin ${DH_REGISTRY} ; echo ${DH_EICWEB_TOKEN} | docker login -u ${DH_REGISTRY_USER} --password-stdin ${DH_REGISTRY} ;
...@@ -167,12 +169,11 @@ status:pending: ...@@ -167,12 +169,11 @@ status:pending:
if [[ -n "${GH_REGISTRY}" ]] ; then if [[ -n "${GH_REGISTRY}" ]] ; then
echo ${GITHUB_REGISTRY_TOKEN} | docker login -u ${GITHUB_REGISTRY_USER} --password-stdin ${GH_REGISTRY} ; echo ${GITHUB_REGISTRY_TOKEN} | docker login -u ${GITHUB_REGISTRY_USER} --password-stdin ${GH_REGISTRY} ;
fi ; fi ;
if [[ -n "${CI_REGISTRY}" ]] ; then
echo ${CI_REGISTRY_PASSWORD} | docker login -u ${CI_REGISTRY_USER} --password-stdin ${CI_REGISTRY} ;
fi ;
fi fi
after_script: after_script:
- # Logout from registries - # Logout from local registry
docker logout ${CI_REGISTRY}
- # Logout from remote registries
if [[ -n "${EXPORT_TAG}" ]] ; then if [[ -n "${EXPORT_TAG}" ]] ; then
if [[ -n "${DH_REGISTRY}" ]] ; then if [[ -n "${DH_REGISTRY}" ]] ; then
docker logout ${DH_REGISTRY} ; docker logout ${DH_REGISTRY} ;
...@@ -180,9 +181,6 @@ status:pending: ...@@ -180,9 +181,6 @@ status:pending:
if [[ -n "${GH_REGISTRY}" ]] ; then if [[ -n "${GH_REGISTRY}" ]] ; then
docker logout ${GH_REGISTRY} ; docker logout ${GH_REGISTRY} ;
fi ; fi ;
if [[ -n "${CI_REGISTRY}" ]] ; then
docker logout ${CI_REGISTRY} ;
fi ;
fi fi
## base job settings for all docker build jobs ## base job settings for all docker build jobs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment