Browse Source

gitlab: use template

Nathalie Furmento 4 years ago
parent
commit
b0c586c880
1 changed files with 10 additions and 8 deletions
  1. 10 8
      .gitlab-ci.yml

+ 10 - 8
.gitlab-ci.yml

@@ -30,20 +30,22 @@ build:
       when: never  # Prevent pipeline run for push event
       when: never  # Prevent pipeline run for push event
     - when: always # Run pipeline for all other cases
     - when: always # Run pipeline for all other cases
 
 
-check:
+.check_template:
   stage: deploy
   stage: deploy
-  script:
-    - ./contrib/gitlab/deploy.sh
+  needs: [build]
+  dependencies:
+    - build
   rules:
   rules:
     - if: '$CI_PIPELINE_SOURCE == "push"'
     - if: '$CI_PIPELINE_SOURCE == "push"'
       when: never  # Prevent pipeline run for push event
       when: never  # Prevent pipeline run for push event
     - when: always # Run pipeline for all other cases
     - when: always # Run pipeline for all other cases
 
 
+check:
+  extend: .check_template
+  script:
+    - ./contrib/gitlab/deploy.sh
+
 simgrid:
 simgrid:
-  stage: deploy
+  extend: .check_template
   script:
   script:
     - ./contrib/gitlab/simgrid.sh
     - ./contrib/gitlab/simgrid.sh
-  rules:
-    - if: '$CI_PIPELINE_SOURCE == "push"'
-      when: never  # Prevent pipeline run for push event
-    - when: always # Run pipeline for all other cases