瀏覽代碼

gitlab-ci: simplify package pipeline job conditions

Use the job stage to distinguish upload jobs instead of an
explicit variable.
Brad King 3 年之前
父節點
當前提交
3a90800a9c
共有 2 個文件被更改,包括 3 次插入6 次删除
  1. 3 3
      .gitlab/rules.yml
  2. 0 3
      .gitlab/upload.yml

+ 3 - 3
.gitlab/rules.yml

@@ -62,12 +62,12 @@
 
 .run_only_for_package:
     rules:
-        - if: '$CMAKE_CI_PACKAGE != null && $CMAKE_CI_JOB_UPLOAD_PACKAGE == null'
-          when: on_success
-        - if: '$CMAKE_CI_PACKAGE == "dev" && $CMAKE_CI_JOB_UPLOAD_PACKAGE == "true"'
+        - if: '$CMAKE_CI_PACKAGE == "dev"'
           variables:
               RSYNC_DESTINATION: "dev"
           when: on_success
+        - if: '$CMAKE_CI_PACKAGE != null && $CI_JOB_STAGE != "upload"'
+          when: on_success
         - when: never
 
 .run_only_for_continuous_master:

+ 0 - 3
.gitlab/upload.yml

@@ -19,9 +19,6 @@
         - test -n "$RSYNC_DESTINATION"
         - rsync -tv --recursive -e "ssh -i $RSYNC_BINARY_KEY -o StrictHostKeyChecking=no -o LogLevel=ERROR" build/ [email protected]:$RSYNC_DESTINATION/
 
-    variables:
-        CMAKE_CI_JOB_UPLOAD_PACKAGE: "true"
-
 .rsync_upload_help:
     stage: upload
     image: "fedora:34"