From 69464e995b185cec45cf661ba987b33793b3b1ff Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Wed, 23 Dec 2020 16:01:07 +0100
Subject: [PATCH 1/7] CI: use rules for everything

---
 .gitlab-ci.yml | 165 ++++++++++++++++++++++++-------------------------
 1 file changed, 80 insertions(+), 85 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index dce551fde..f977c2650 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -61,9 +61,8 @@ variables:
      paths:
        - installation
      expire_in: 2 hours
-  except:
-    variables:
-      - $SWEEP == "true"
+  rules:
+    - if: '$SWEEP != "true"'
   <<: *retry_policy
 
 .sl6docker_template: &sl6docker
@@ -84,11 +83,10 @@ install:SL6:
 install:CC7:
   <<: *install
   <<: *cc7docker
-  except:
-    variables:
-      - $SWEEP == "true"
-    refs:
-      - tags
+  rules:
+    - if: $CI_COMMIT_TAG
+      when: never
+    - if: '$SWEEP != "true"'
 
 include:
   - template: Code-Quality.gitlab-ci.yml
@@ -130,11 +128,10 @@ code_quality:
        junit: installation/ILCDIRAC/junit_unit.xml
      expire_in: 2 hours
   <<: *retry_policy
-  except:
-    variables:
-      - $SWEEP == "true"
-    refs:
-      - tags
+  rules:
+    - if: $CI_COMMIT_TAG
+      when: never
+    - if: '$SWEEP != "true"'
 
 unittest:SL6:
   <<: *unittest
@@ -152,11 +149,10 @@ checkFormat:
   <<: *retry_policy
   stage: unittest
   needs: ["install:SL6"]
-  except:
-    variables:
-      - $SWEEP == "true"
-    refs:
-      - tags
+  rules:
+    - if: $CI_COMMIT_TAG
+      when: never
+    - if: '$SWEEP != "true"'
   script:
     - export HOME=/root/
     - cd installation/ILCDIRAC
@@ -171,11 +167,10 @@ checkFormat:
   stage: integration
   variables:
     GIT_STRATEGY: none
-  except:
-    variables:
-      - $SWEEP == "true"
-    refs:
-      - tags
+  rules:
+    - if: $CI_COMMIT_TAG
+      when: never
+    - if: '$SWEEP != "true"'
   script:
     - export HOME=/root/
     - cd installation/ILCDIRAC
@@ -199,11 +194,10 @@ pylint:PY3K:
   stage: integration
   variables:
     GIT_STRATEGY: none
-  except:
-    variables:
-      - $SWEEP == "true"
-    refs:
-      - tags
+  rules:
+    - if: $CI_COMMIT_TAG
+      when: never
+    - if: '$SWEEP != "true"'
   script:
     - export HOME=/root/
     - cd installation/ILCDIRAC
@@ -240,11 +234,10 @@ pylint:PY3K:
 
 .prodTests_template: &prodTests
   stage: integration
-  except:
-    variables:
-      - $SWEEP == "true"
-    refs:
-      - tags
+  rules:
+    - if: $CI_COMMIT_TAG
+      when: never
+    - if: '$SWEEP != "true"'
   variables:
     GIT_STRATEGY: none
   script:
@@ -263,22 +256,21 @@ pylint:PY3K:
     expire_in: 2 days
 
 .prodOnly: &prod
-  only:
-    - branches@CLICdp/iLCDirac/ILCDIRAC
-  except:
-    variables:
-      - $SWEEP == "true"
-    refs:
-      - tags
+  rules:
+    - if: $CI_COMMIT_TAG
+      when: never
+    - if: '$SWEEP != "true"'
+      when: never
+    - if: '$CI_PROJECT_PATH == "CLICdp/iLCDirac/ILCDIRAC"'
   allow_failure: false
 
 .devsOnly: &devs
-  except:
-    variables:
-      - $SWEEP == "true"
-    refs:
-      - tags
-      - branches@CLICdp/iLCDirac/ILCDIRAC
+  rules:
+    - if: $CI_COMMIT_TAG
+      when: never
+    - if: '$CI_PROJECT_PATH == "CLICdp/iLCDirac/ILCDIRAC"'
+      when: never
+    - if: '$SWEEP != "true"'
   allow_failure: true
 
 .sl6int: &sl6integration
@@ -336,11 +328,10 @@ prodTests:CC7dev:
       junit: installation/ILCDIRAC/junit_se.xml
   coverage: '/\d+\%\s*$/'
   <<: *retry_policy
-  only:
-    - schedules
-  except:
-    variables:
-      - $SWEEP == "true"
+  rules:
+    - if: '$SWEEP == "true"'
+      when: never
+    - if: '$CI_PIPELINE_SOURCE == "schedule"'
 
 setests:SL6:
   <<: *seTests
@@ -369,9 +360,8 @@ compiledoc:
   stage: unittest
   variables:
     GIT_STRATEGY: none
-  except:
-    variables:
-      - $SWEEP == "true"
+  rules:
+    - if: '$SWEEP != "true"'
   needs: ["install:SL6"]
   script:
     - export HOME=/root/
@@ -421,18 +411,20 @@ testmaketarballs:
 maketarballs:
   <<: *tarball
   stage: create
-  only:
-    - tags@CLICdp/iLCDirac/ILCDIRAC
+  rules:
+    - if: '$CI_PROJECT_PATH != "CLICdp/iLCDirac/ILCDIRAC"'
+      when: never
+    - if: $CI_COMMIT_TAG
   variables:
      ILCDIRAC_TAG: ${CI_COMMIT_TAG}
 
 makeILCConfig:
   <<: *cc7docker
   stage: create
-  only:
-    - tags@CLICdp/iLCDirac/ILCDIRAC
-  except:
-    - /.*-pre[0-9]*/
+  rules:
+    - if: '$CI_COMMIT_TAG =~ /.*-pre[0-9]*/'
+      when: never
+    - if: '$CI_COMMIT_TAG'
   script:
     - mkdir -p ILCDIRACTars/defaults;  echo -e "Releases = https://gitlab.cern.ch/CLICdp/iLCDirac/ILCDIRAC/raw/master/releases.cfg\nUploadCommand = ( cd %OUTLOCATION% ; tar -cf - *.tar.gz *.md5 *.cfg *.pdf *.html ) | ssh \`whoami\`@lxplus.cern.ch \'cd  /eos/project/l/lcd-web/www/ILCDIRACTars &&  tar -xvf - && ls *.tar.gz > tars.list\'\nBaseURL = http://lcd-data.web.cern.ch/lcd-data/ILCDIRACTars\nLocalInstallation\n{\n  Project = ILCDIRAC\n  ExternalsType = client\n  PythonVersion = 27\n  Release = $CI_COMMIT_TAG\n  LcgVer = $LCG_BUNDLE_VERSION\n  Setup = ILC-Production\n  ConfigurationServer = dips://voilcdirac13.cern.ch:9135/Configuration/Server, dips://voilcdirac14.cern.ch:9135/Configuration/Server\n}\n" > ILCDIRACTars/defaults/ilc.cfg
   artifacts:
@@ -447,10 +439,10 @@ deploydoc:
   tags:
     - docker
   image: gitlab-registry.cern.ch/ci-tools/ci-web-deployer:latest
-  only:
-    - tags@CLICdp/iLCDirac/ILCDIRAC
-  except:
-    - /.*-pre[0-9]*/
+  rules:
+    - if: '$CI_COMMIT_TAG =~ /.*-pre[0-9]*/'
+      when: never
+    - if: '$CI_COMMIT_TAG'
   needs: ["compiledoc"]
   variables:
     EOS_PATH: "/eos/project/l/lcd-web/www/doc/ilcdiracdoc/"
@@ -467,12 +459,11 @@ docDev:
   tags:
     - docker
   image: gitlab-registry.cern.ch/ci-tools/ci-web-deployer:latest
-  when: manual
-  except:
-    variables:
-      - $SWEEP == "true"
-    refs:
-      - tags
+  rules:
+    - if: '$CI_COMMIT_TAG'
+      when: never
+    - if: '$SWEEP != "true"'
+      when: manual
   needs: ["compiledoc", "unittest:SL6"]
   variables:
     EOS_PATH: "/eos/project/l/lcd-web/www/doc/ilcdiracdocDev/"
@@ -490,12 +481,13 @@ docProd:
   tags:
     - docker
   image: gitlab-registry.cern.ch/ci-tools/ci-web-deployer:latest
-  only:
-    - branches@CLICdp/iLCDirac/ILCDIRAC
-  except:
-    variables:
-      - $SWEEP == "true"
-  when: manual
+  rules:
+    - if: '$SWEEP == "true"'
+      when: never
+    - if: '$CI_COMMIT_TAG'
+      when: never
+    - if: '$CI_PROJECT_PATH == "CLICdp/iLCDirac/ILCDIRAC"'
+      when: manual
   needs: ["compiledoc", "unittest:SL6"]
   variables:
     EOS_PATH: "/eos/project/l/lcd-web/www/doc/ilcdiracdoc/"
@@ -514,8 +506,10 @@ deploytag:
   tags:
     - docker
   image: gitlab-registry.cern.ch/ci-tools/ci-web-deployer:latest
-  only:
-    - tags@CLICdp/iLCDirac/ILCDIRAC
+  rules:
+    - if: '$CI_PROJECT_PATH != "CLICdp/iLCDirac/ILCDIRAC"'
+      when: never
+    - if: $CI_COMMIT_TAG
   needs: ["maketarballs", "makeILCConfig"]
   variables:
     EOS_PATH: "/eos/project/l/lcd-web/www/ILCDIRACTars/"
@@ -530,10 +524,12 @@ deployToCVMFS:
   stage: deployToCVMFS
   tags:
     - cvmfs
-  only:
-    - tags@CLICdp/iLCDirac/ILCDIRAC
-  except:
-    - /.*-pre[0-9]*/
+  rules:
+    - if: '$CI_PROJECT_PATH != "CLICdp/iLCDirac/ILCDIRAC"'
+      when: never
+    - if: '$CI_COMMIT_TAG =~ /.*-pre[0-9]*/'
+      when: never
+    - if: '$CI_COMMIT_TAG'
   needs: ["deploytag"]
   script:
     - sudo -u cvclicdp -i scripts/installILCDIRAC.sh $CI_COMMIT_TAG $CERT_PASSPHRASE
@@ -550,9 +546,8 @@ MR_SWEEP:
   variables:
     SWEEP_SINCE: "1 month ago"
     SWEEP_UNTIL: "now"
-  only:
-    variables:
-      - $SWEEP == "true"
+  rules:
+    - if: '$SWEEP == "true"'
   before_script: []
   after_script: []
   script:
-- 
GitLab


From 9528ae940eee0718f100f84336767d64ad28c1e1 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Wed, 23 Dec 2020 16:19:45 +0100
Subject: [PATCH 2/7] CI: refactor rules

---
 .gitlab-ci.yml | 151 +++++++++++++++++++++----------------------------
 1 file changed, 65 insertions(+), 86 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f977c2650..a16c8ed98 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -22,6 +22,51 @@ variables:
   ILCDIRAC_BRANCH: "Rel-v29r2"
   DIRAC_DEPRECATED_FAIL: "1"
 
+
+.rule_release_tags_template: &rule_release_tags
+  rules:
+    - if: '$CI_PROJECT_PATH != "CLICdp/iLCDirac/ILCDIRAC"'
+      when: never
+    - if: '$CI_COMMIT_TAG =~ /.*-pre[0-9]*/'
+      when: never
+    - if: '$CI_COMMIT_TAG'
+
+.rule_all_tags_template: &rule_all_tags
+  rules:
+    - if: '$CI_PROJECT_PATH != "CLICdp/iLCDirac/ILCDIRAC"'
+      when: never
+    - if: '$CI_COMMIT_TAG'
+
+.rule_normal_template: &rule_normal
+  rules:
+    - if: '$CI_COMMIT_TAG'
+      when: never
+    - if: '$SWEEP != "true"'
+
+.rule_no_sweep_template: &rule_no_sweep
+  rules:
+    - if: '$SWEEP != "true"'
+
+.rule_schedule_template: &rule_schedule
+  rules:
+    - if: '$SWEEP == "true"'
+      when: never
+    - if: '$CI_PIPELINE_SOURCE == "schedule"'
+
+.rule_template: &rule
+  rules:
+    - if: '$SWEEP == "true"'
+      when: never
+    - if: $CI_COMMIT_TAG
+      when: never
+    - if: '$CI_PROJECT_PATH == "CLICdp/iLCDirac/ILCDIRAC"'
+      when: always
+      allow_failure: false
+    - if: '$CI_PROJECT_PATH != "CLICdp/iLCDirac/ILCDIRAC"'
+      when: always
+      allow_failure: true
+
+
 .retry_template: &retry_policy
   retry:
     max: 2
@@ -149,10 +194,7 @@ checkFormat:
   <<: *retry_policy
   stage: unittest
   needs: ["install:SL6"]
-  rules:
-    - if: $CI_COMMIT_TAG
-      when: never
-    - if: '$SWEEP != "true"'
+  <<: *rule_normal
   script:
     - export HOME=/root/
     - cd installation/ILCDIRAC
@@ -167,10 +209,7 @@ checkFormat:
   stage: integration
   variables:
     GIT_STRATEGY: none
-  rules:
-    - if: $CI_COMMIT_TAG
-      when: never
-    - if: '$SWEEP != "true"'
+  <<: *rule_normal
   script:
     - export HOME=/root/
     - cd installation/ILCDIRAC
@@ -194,10 +233,7 @@ pylint:PY3K:
   stage: integration
   variables:
     GIT_STRATEGY: none
-  rules:
-    - if: $CI_COMMIT_TAG
-      when: never
-    - if: '$SWEEP != "true"'
+  <<: *rule_normal
   script:
     - export HOME=/root/
     - cd installation/ILCDIRAC
@@ -234,10 +270,7 @@ pylint:PY3K:
 
 .prodTests_template: &prodTests
   stage: integration
-  rules:
-    - if: $CI_COMMIT_TAG
-      when: never
-    - if: '$SWEEP != "true"'
+  <<: *rule
   variables:
     GIT_STRATEGY: none
   script:
@@ -255,24 +288,6 @@ pylint:PY3K:
     when: on_failure
     expire_in: 2 days
 
-.prodOnly: &prod
-  rules:
-    - if: $CI_COMMIT_TAG
-      when: never
-    - if: '$SWEEP != "true"'
-      when: never
-    - if: '$CI_PROJECT_PATH == "CLICdp/iLCDirac/ILCDIRAC"'
-  allow_failure: false
-
-.devsOnly: &devs
-  rules:
-    - if: $CI_COMMIT_TAG
-      when: never
-    - if: '$CI_PROJECT_PATH == "CLICdp/iLCDirac/ILCDIRAC"'
-      when: never
-    - if: '$SWEEP != "true"'
-  allow_failure: true
-
 .sl6int: &sl6integration
   <<: *sl6docker
   needs: ["install:SL6", "unittest:SL6"]
@@ -283,32 +298,17 @@ pylint:PY3K:
 
 jobTests:SL6:
   <<: *jobTests
-  <<: *devs
-  <<: *sl6integration
-
-jobTests:SL6Prod:
-  <<: *jobTests
-  <<: *prod
+  <<: *rule
   <<: *sl6integration
 
 jobTests:CC7:
   <<: *jobTests
-  <<: *devs
-  <<: *cc7integration
-
-jobTests:CC7Prod:
-  <<: *jobTests
-  <<: *prod
+  <<: *rule
   <<: *cc7integration
 
-prodTests:CC7prod:
+prodTests:CC7:
   <<: *prodTests
-  <<: *prod
-  <<: *cc7integration
-
-prodTests:CC7dev:
-  <<: *prodTests
-  <<: *devs
+  <<: *rule
   <<: *cc7integration
 
 .seTests_template: &seTests
@@ -328,40 +328,36 @@ prodTests:CC7dev:
       junit: installation/ILCDIRAC/junit_se.xml
   coverage: '/\d+\%\s*$/'
   <<: *retry_policy
-  rules:
-    - if: '$SWEEP == "true"'
-      when: never
-    - if: '$CI_PIPELINE_SOURCE == "schedule"'
+  <<: *rule_schedule
 
 setests:SL6:
   <<: *seTests
-  <<: *devs
+  <<: *rule
   <<: *sl6integration
 
 setests:SL6Prod:
   <<: *seTests
-  <<: *prod
+  <<: *rule
   <<: *sl6integration
   allow_failure: true
 
 setests:CC7:
   <<: *seTests
-  <<: *devs
+  <<: *rule
   <<: *cc7integration
 
 setests:CC7Prod:
   <<: *seTests
-  <<: *prod
+  <<: *rule
   <<: *cc7integration
   allow_failure: true
 
 compiledoc:
   <<: *sl6docker
+  <<: *rule_no_sweep
   stage: unittest
   variables:
     GIT_STRATEGY: none
-  rules:
-    - if: '$SWEEP != "true"'
   needs: ["install:SL6"]
   script:
     - export HOME=/root/
@@ -403,7 +399,7 @@ compiledoc:
 
 testmaketarballs:
   <<: *tarball
-  <<: *prod
+  <<: *rule
   stage: integration
   variables:
     ILCDIRAC_TAG: v29r2p2
@@ -411,20 +407,14 @@ testmaketarballs:
 maketarballs:
   <<: *tarball
   stage: create
-  rules:
-    - if: '$CI_PROJECT_PATH != "CLICdp/iLCDirac/ILCDIRAC"'
-      when: never
-    - if: $CI_COMMIT_TAG
+  <<: *rule_all_tags
   variables:
      ILCDIRAC_TAG: ${CI_COMMIT_TAG}
 
 makeILCConfig:
   <<: *cc7docker
   stage: create
-  rules:
-    - if: '$CI_COMMIT_TAG =~ /.*-pre[0-9]*/'
-      when: never
-    - if: '$CI_COMMIT_TAG'
+  <<: *rule_release_tags
   script:
     - mkdir -p ILCDIRACTars/defaults;  echo -e "Releases = https://gitlab.cern.ch/CLICdp/iLCDirac/ILCDIRAC/raw/master/releases.cfg\nUploadCommand = ( cd %OUTLOCATION% ; tar -cf - *.tar.gz *.md5 *.cfg *.pdf *.html ) | ssh \`whoami\`@lxplus.cern.ch \'cd  /eos/project/l/lcd-web/www/ILCDIRACTars &&  tar -xvf - && ls *.tar.gz > tars.list\'\nBaseURL = http://lcd-data.web.cern.ch/lcd-data/ILCDIRACTars\nLocalInstallation\n{\n  Project = ILCDIRAC\n  ExternalsType = client\n  PythonVersion = 27\n  Release = $CI_COMMIT_TAG\n  LcgVer = $LCG_BUNDLE_VERSION\n  Setup = ILC-Production\n  ConfigurationServer = dips://voilcdirac13.cern.ch:9135/Configuration/Server, dips://voilcdirac14.cern.ch:9135/Configuration/Server\n}\n" > ILCDIRACTars/defaults/ilc.cfg
   artifacts:
@@ -439,10 +429,7 @@ deploydoc:
   tags:
     - docker
   image: gitlab-registry.cern.ch/ci-tools/ci-web-deployer:latest
-  rules:
-    - if: '$CI_COMMIT_TAG =~ /.*-pre[0-9]*/'
-      when: never
-    - if: '$CI_COMMIT_TAG'
+  <<: *rule_release_tags
   needs: ["compiledoc"]
   variables:
     EOS_PATH: "/eos/project/l/lcd-web/www/doc/ilcdiracdoc/"
@@ -506,10 +493,7 @@ deploytag:
   tags:
     - docker
   image: gitlab-registry.cern.ch/ci-tools/ci-web-deployer:latest
-  rules:
-    - if: '$CI_PROJECT_PATH != "CLICdp/iLCDirac/ILCDIRAC"'
-      when: never
-    - if: $CI_COMMIT_TAG
+  <<: *rule_all_tags
   needs: ["maketarballs", "makeILCConfig"]
   variables:
     EOS_PATH: "/eos/project/l/lcd-web/www/ILCDIRACTars/"
@@ -524,12 +508,7 @@ deployToCVMFS:
   stage: deployToCVMFS
   tags:
     - cvmfs
-  rules:
-    - if: '$CI_PROJECT_PATH != "CLICdp/iLCDirac/ILCDIRAC"'
-      when: never
-    - if: '$CI_COMMIT_TAG =~ /.*-pre[0-9]*/'
-      when: never
-    - if: '$CI_COMMIT_TAG'
+  <<: *rule_release_tags
   needs: ["deploytag"]
   script:
     - sudo -u cvclicdp -i scripts/installILCDIRAC.sh $CI_COMMIT_TAG $CERT_PASSPHRASE
-- 
GitLab


From 6c937f0126c4d87b05fe672f7e3aafce58cc7772 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Wed, 23 Dec 2020 16:41:38 +0100
Subject: [PATCH 3/7] CI: add workflow rule: only run jobs for merge requests,
 schedules, tags

---
 .gitlab-ci.yml | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a16c8ed98..4eae420d8 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,3 +1,10 @@
+workflow:
+  rules:
+    - if: $CI_MERGE_REQUEST_IID
+    - if: $CI_COMMIT_TAG
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
+    - if: '$CI_PIPELINE_SOURCE == "schedule"'
+
 before_script:
   - echo $LCG_BUNDLE_VERSION $ILCDIRAC_VERSION $DIRAC_BRANCH $SETUP
   - source /cvmfs/clicdp.cern.ch/software/git/2.13.2/x86_64-slc6-gcc7-opt/setup.sh
-- 
GitLab


From a40e8a5293da4cbd41a98dc57084278241fb3b5a Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Wed, 23 Dec 2020 17:03:16 +0100
Subject: [PATCH 4/7] CI: do not hide job failure

---
 .gitlab-ci.d/run-cvmfstests.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.d/run-cvmfstests.sh b/.gitlab-ci.d/run-cvmfstests.sh
index 16f07178d..bdb0c0797 100755
--- a/.gitlab-ci.d/run-cvmfstests.sh
+++ b/.gitlab-ci.d/run-cvmfstests.sh
@@ -3,7 +3,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 source .gitlab-ci.d/set-reportstyle.sh
 export COVERAGE_PROCESS_START=$DIR/../.coveragerc
 export PYTEST_ADDOPTS="${PYTEST_ADDOPTS} --cov-append --junitxml=junit_job.xml"
-pytest -n 2  --randomly-dont-reorganize $DIR/../Tests/Integration/Test_Jobs.py
-coverage combine --append tmp*/*/.coverage*
-coverage report -i
-coverage html -i
+pytest -n 2  --randomly-dont-reorganize $DIR/../Tests/Integration/Test_Jobs.py && \
+    coverage combine --append tmp*/*/.coverage* && \
+    coverage report -i && \
+    coverage html -i
-- 
GitLab


From a8f07fc7e092cff8b2834349000b5746e359ac7c Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Thu, 24 Dec 2020 12:14:02 +0100
Subject: [PATCH 5/7] CI: refactor doc, use allow_failure to unblock

---
 .gitlab-ci.yml | 30 ++++++++++--------------------
 1 file changed, 10 insertions(+), 20 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4eae420d8..bdb3c0922 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -448,7 +448,7 @@ deploydoc:
   <<: *retry_policy
 
 
-docDev:
+.doc_template: &doc
   stage: deploy
   tags:
     - docker
@@ -458,9 +458,9 @@ docDev:
       when: never
     - if: '$SWEEP != "true"'
       when: manual
+      allow_failure: true
   needs: ["compiledoc", "unittest:SL6"]
   variables:
-    EOS_PATH: "/eos/project/l/lcd-web/www/doc/ilcdiracdocDev/"
     CI_OUTPUT_DIR: "ilcdiracdoc"
   script:
     - mv installation/ILCDIRAC/htmlcov ilcdiracdoc/ || echo "No htmlcov"
@@ -470,29 +470,19 @@ docDev:
   <<: *retry_policy
 
 
+docDev:
+  <<: *doc
+  variables:
+   EOS_PATH: "/eos/project/l/lcd-web/www/doc/ilcdiracdocDev/"
+
+
 docProd:
-  stage: deploy
-  tags:
-    - docker
-  image: gitlab-registry.cern.ch/ci-tools/ci-web-deployer:latest
   rules:
-    - if: '$SWEEP == "true"'
-      when: never
-    - if: '$CI_COMMIT_TAG'
+    - if: '$CI_PROJECT_PATH != "CLICdp/iLCDirac/ILCDIRAC"'
       when: never
-    - if: '$CI_PROJECT_PATH == "CLICdp/iLCDirac/ILCDIRAC"'
-      when: manual
-  needs: ["compiledoc", "unittest:SL6"]
+  <<: *doc
   variables:
     EOS_PATH: "/eos/project/l/lcd-web/www/doc/ilcdiracdoc/"
-    CI_OUTPUT_DIR: "ilcdiracdoc"
-  script:
-    - mv installation/ILCDIRAC/htmlcov ilcdiracdoc/ || echo "No htmlcov"
-    - deploy-eos
-  before_script: []
-  after_script: []
-  <<: *retry_policy
-
 
 
 deploytag:
-- 
GitLab


From e3ea76f09bfe6902287d1a846f7e6bac3c316ed5 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Thu, 24 Dec 2020 12:30:44 +0100
Subject: [PATCH 6/7] CI: Refactor SEtests

---
 .gitlab-ci.yml | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index bdb3c0922..1932b24ac 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -342,23 +342,11 @@ setests:SL6:
   <<: *rule
   <<: *sl6integration
 
-setests:SL6Prod:
-  <<: *seTests
-  <<: *rule
-  <<: *sl6integration
-  allow_failure: true
-
 setests:CC7:
   <<: *seTests
   <<: *rule
   <<: *cc7integration
 
-setests:CC7Prod:
-  <<: *seTests
-  <<: *rule
-  <<: *cc7integration
-  allow_failure: true
-
 compiledoc:
   <<: *sl6docker
   <<: *rule_no_sweep
-- 
GitLab


From 461028665583214c9b14d57189dff2889a84651f Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Thu, 24 Dec 2020 12:51:44 +0100
Subject: [PATCH 7/7] CI: code_climate only with overlay driver

---
 .gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1932b24ac..d8140566d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -146,7 +146,7 @@ include:
 code_quality:
   stage: integration
   tags:
-    - docker
+    - overlay
   image: docker:stable
   variables:
     DOCKER_DRIVER: overlay
-- 
GitLab