From dc54b018c33d145b5878ecb514aff88e58d06a12 Mon Sep 17 00:00:00 2001
From: jdestin <jeremy.destin@inra.fr>
Date: Thu, 30 Jan 2020 15:45:47 +0100
Subject: [PATCH 1/3] Implement adr-0002.

---
 .gitlab-ci.yml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f2459b62..6472c711 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -117,12 +117,16 @@ deploy-to-staging:
   <<: *deploy_to_vm
   only:
     refs:
-      - master
+      - branches
     changes:
       - .gitlab-ci.yml
       - backend/src/**/*
       - frontend/**/*
-
+  except:
+    refs:
+      - master
+  when: manual
+  allow_failure: false
 
 deploy-to-beta:
   stage: staging
-- 
GitLab


From 49396eb2e49fbd2715821b4508118edaf2c53749 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9lia=20Michotey?= <celia.michotey@inra.fr>
Date: Fri, 31 Jan 2020 17:21:37 +0100
Subject: [PATCH 2/3] Create beta stage and always deploy beta application.

---
 .gitlab-ci.yml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6472c711..74a9c1cc 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,6 +2,7 @@
 stages:
   - test
   - build
+  - beta
   - staging
   - production
 
@@ -129,7 +130,7 @@ deploy-to-staging:
   allow_failure: false
 
 deploy-to-beta:
-  stage: staging
+  stage: beta
   variables:
     ENV: beta
     APP_PORT: ${BETA_GPDS_PORT}
@@ -145,10 +146,8 @@ deploy-to-beta:
       - .gitlab-ci.yml
       - backend/src/**/*
       - frontend/**/*
-  when: manual
   allow_failure: false
 
-
 deploy-to-int:
   stage: production
   variables:
-- 
GitLab


From fe80c62e430c12856ed7a1bb14524b7d02e5ca83 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rapha=C3=ABl=20Flores?= <raphael.flores@inra.fr>
Date: Mon, 10 Feb 2020 09:59:34 +0100
Subject: [PATCH 3/3] Factorize changes section to hidden job.

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

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 74a9c1cc..9c9fca69 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -107,6 +107,11 @@ build:
     - ssh root@${SERVER_IP} "systemctl restart bootapp@${APP_NAME}-${ENV}"
     - eval $(ssh-agent -k)
     - echo "Deploy done. Application should be available at http://${SERVER_IP}:${APP_PORT}/${CONTEXT_PATH}"
+  only:
+    changes:
+      - .gitlab-ci.yml
+      - backend/src/**/*
+      - frontend/**/*
 
 
 deploy-to-staging:
@@ -119,10 +124,6 @@ deploy-to-staging:
   only:
     refs:
       - branches
-    changes:
-      - .gitlab-ci.yml
-      - backend/src/**/*
-      - frontend/**/*
   except:
     refs:
       - master
@@ -142,10 +143,6 @@ deploy-to-beta:
   only:
     refs:
       - branches
-    changes:
-      - .gitlab-ci.yml
-      - backend/src/**/*
-      - frontend/**/*
   allow_failure: false
 
 deploy-to-int:
@@ -158,10 +155,6 @@ deploy-to-int:
   only:
     refs:
       - master
-    changes:
-      - .gitlab-ci.yml
-      - backend/src/**/*
-      - frontend/**/*
   when: manual
   allow_failure: false
 
@@ -176,10 +169,6 @@ deploy-to-prod-public:
   only:
     refs:
       - master
-    changes:
-      - .gitlab-ci.yml
-      - backend/src/**/*
-      - frontend/**/*
   when: manual
   allow_failure: false
 
@@ -194,9 +183,5 @@ deploy-to-prod-private:
   only:
     refs:
       - master
-    changes:
-      - .gitlab-ci.yml
-      - backend/src/**/*
-      - frontend/**/*
   when: manual
   allow_failure: false
-- 
GitLab