diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 846e857eeed791e2a27e27ed4ad36356f6d0c112..dee824aae30927d239cd0b77e08010dd3c7e4ab7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,12 +15,14 @@ variables: BRANCH_OR_TAG: :${CI_COMMIT_REF_SLUG} # format looks like ':feature-branch' BRANCH_OR_TAG: ${BRANCH_OR_TAG/:master/:latest} #replaces ':master' with ':latest' DOCKER_AUTH_CONFIG: '{"auths":{"$CI_REGISTRY":{"username":"$CI_REGISTRY_USER","password":"$CI_REGISTRY_PASSWORD"}}}' #Authentication for Docker Executor. - + GEOMAG_TAG: geomag # Do not run in upstream for merge requests workflow: rules: - - if: $CI_COMMIT_TAG - - if: $CI_COMMIT_BRANCH + - if: ($CI_COMMIT_TAG || $CI_COMMIT_BRANCH) && $CI_PROJECT_PATH != $UPSTREAM_PATH + variables: + GEOMAG_TAG: staging01 #used when geomag tag is unavailable to a developer + - if: $CI_COMMIT_TAG || $CI_COMMIT_BRANCH ## -------------------------------------------------- # Templates @@ -47,9 +49,6 @@ workflow: - export STACK_NAME=${APP_NAME} - ./scripts/deploy.sh stage: deploy - tags: - - deploy - - swarm # these variables are defined in Gitlab, or set in scripts/custom.config.sh # variables: # DATABASE_URL @@ -84,9 +83,6 @@ workflow: git pull --ff-only "${CI_REPOSITORY_URL}" "${CI_COMMIT_REF_NAME}"; fi stage: deploy - tags: - - deploy - - swarm variables: APP_DEPLOY_DIR: "/geomag/geomag-algorithms" REQUIRED_PREFIX: "/geomag" @@ -183,6 +179,7 @@ Test: tags: - deploy - swarm + - $GEOMAG_TAG #ensures we use geomag-specific- deploy, swarm tagged runners ## -------------------------------------------------- # Integration Stage @@ -223,6 +220,7 @@ Build Docker Image: tags: # TODO: refactor to separate build/publish steps - deploy + - $GEOMAG_TAG #ensures we use geomag-specific- deploy, swarm tagged runners variables: APP_NAME: geomag-algorithms FROM_IMAGE: code.usgs.gov:5001/devops/images/usgs/python:3.10-obspy