From f3f2053370d71058954582409655e5cfbe7ad174 Mon Sep 17 00:00:00 2001
From: Wolfgang Knopki <wolfgang.knopki@hft-stuttgart.de>
Date: Fri, 22 Nov 2019 15:57:03 +0100
Subject: [PATCH] [cicd] deployment to testserver

---
 .gitlab-ci.yml | 56 ++++++++++++++++++++++++++++++++++----------------
 1 file changed, 38 insertions(+), 18 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9f8793a..0b10476 100755
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,22 +1,42 @@
 # This file is a template, and might need editing before it works on your project.
 # Full project: https://gitlab.com/pages/plain-html
-pages:
-  variables:
-    EXPORT_PAGES_DIR: "/opt/tomcat9/webapps/ROOT/"
+
+variables:
+  EXPORT_PAGES_DIR: "/opt/tomcat9/webapps/ROOT/"
+
+pages-master:    
   stage: deploy
-  script:
-  - echo $EXPORT_PAGES_DIR
-  - mkdir .public
-  - cp -r css .public
-  - cp -r images .public
-  - cp -r js .public
-  - cp -r includes .public
-  - cp *.html .public
-  - mv .public public
-  - cp -r public/* "$EXPORT_PAGES_DIR"
-  artifacts:
-    paths:
-    - public
-  only:
-  - master
+    script:
+    - echo $EXPORT_PAGES_DIR
+    - mkdir .public
+    - cp -r css .public
+    - cp -r images .public
+    - cp -r js .public
+    - cp -r includes .public
+    - cp *.html .public
+    - mv .public public
+    - cp -r public/* "$EXPORT_PAGES_DIR"
+    artifacts:
+      paths:
+      - public
+    only:
+    - master
 
+pages-devel:    
+  stage: deploy
+    script:
+    - echo $EXPORT_PAGES_DIR
+    - mkdir .public
+    - cp -r css .public
+    - cp -r images .public
+    - cp -r js .public
+    - cp -r includes .public
+    - cp *.html .public
+    - mv .public public
+    - scp -r public/* ubuntu@193.196.52.30:"$EXPORT_PAGES_DIR"
+    - ssh -t ubuntu@193.196.52.30 "sudo chown tomcat:tomcat $EXPORT_PAGES_DIR"
+    artifacts:
+      paths:
+      - public
+    only:
+    - devel
-- 
GitLab