diff --git a/git_push_mirror/.gitlab-ci.yml b/git_push_mirror/.gitlab-ci.yml index 3bd1967..f6c4121 100644 --- a/git_push_mirror/.gitlab-ci.yml +++ b/git_push_mirror/.gitlab-ci.yml @@ -6,6 +6,7 @@ - apk update - apk add git script: + - if [ "0$GIT_SYNC_URL" == "0"]; then echo "[ERROR] you must define variable GIT_SYNC_URL for mirroring this repository."; fi - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/$CI_PROJECT_PATH --mirror $CI_PROJECT_NAME - cd $CI_PROJECT_NAME - git remote add destination $GIT_SYNC_URL @@ -14,7 +15,9 @@ artifacts: expire_in: 1 day rules: - - if: '$CI_COMMIT_BRANCH == "master"' - - if: '$CI_COMMIT_BRANCH == "development"' + - if: '$JOB_STOP_GIT_PUSH_MIRROR' + when: never + - if: '$CI_COMMIT_BRANCH == "master" && $GIT_SYNC_URL != null' + - if: '$CI_COMMIT_BRANCH == "development" && $GIT_SYNC_URL != null' when: always