]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Modifying .gitlab-ci.yml
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 24 Jun 2020 07:21:36 +0000 (09:21 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 24 Jun 2020 07:21:36 +0000 (09:21 +0200)
.gitlab-ci.yml

index 27b8995a4720f025ada85be44dbf7a912e8839e7..9af809f55bca2644e22b55aa8e9507dc1a1dc246 100644 (file)
@@ -6,6 +6,7 @@ stages:
   - deploy
 
 variables:
+  OS_ID: centos7
   FLAKE8_MAX_LINE_LENGTH: 99
   FLAKE8_MAX_COMPLEXITY: 20
   FLAKE8_IGNORE_ERRORS: 'E226,E302,E41,E402'
@@ -34,6 +35,7 @@ variables:
   LANG: $JOB_LANGUAGE
   LC_ALL: $JOB_LANGUAGE
   SYSTEM_STATUS: 'unknown'
+  CONFIG_FILE: 'etc/create.ini'
 
 .template_job: &job_definition
   before_script:
@@ -44,17 +46,36 @@ variables:
     - pip install --upgrade --upgrade-strategy eager --requirement requirements.txt
     - pip list --format columns
     - if [ -x bin/compile-xlate-msgs.sh ] ; then bin/compile-xlate-msgs.sh; fi
-    - 'if [ "$CI_COMMIT_REF_NAME" = "master" ] ; then SYSTEM_STATUS="production"; elif [ "$CI_COMMIT_REF_NAME" = "test" ] ; then SYSTEM_STATUS="testing"; else SYSTEM_STATUS="development"; fi'
-    - 'echo "Ref name: ${CI_COMMIT_REF_NAME}"'
-    - 'echo "System status: ${SYSTEM_STATUS}"'
+    - ' if [ "$CI_COMMIT_REF_NAME" = "master" -o "$CI_COMMIT_REF_NAME" = "production" ] ; then
+            SYSTEM_STATUS="production";
+        elif [ "$CI_COMMIT_REF_NAME" = "test" -o "$CI_COMMIT_REF_NAME" = "testing" ] ; then
+            SYSTEM_STATUS="testing";
+        else
+            SYSTEM_STATUS="development";
+        fi'
+    - 'echo; echo "Ref name: ${CI_COMMIT_REF_NAME}"; "System status: ${SYSTEM_STATUS}"'
+    - ' if [ -z "${VSPHERE_HOST}" ] ; then
+            if [ "$CI_COMMIT_REF_NAME" = "master" -o "$CI_COMMIT_REF_NAME" = "production" ] ; then
+                VSPHERE_HOST="vcs01.ppbrln.internal"
+            else
+                VSPHERE_HOST="test-vcsa01.pixelpark.net"
+            fi
+        fi'
+    - 'echo; echo "VCenter Host: \"${VSPHERE_HOST}\""'
+    - 'CONFIG_FILE=etc/create-${OS_ID}-${SYSTEM_STATUS}.ini'
+    - 'echo; echo "Configuration file: \"${CONFIG_FILE}\""'
+    - 'touch "${CONFIG_FILE}"'
+    - echo
   tags:
     - deploy
   after_script:
-    - deactivate
+    - 'rm -fv "${CONFIG_FILE}"'
 
 Test source:
   <<: *job_definition
   stage: test
+  variables:
+    OS_ID: centos8
   script:
     - hostname -f
     - whoami
@@ -133,3 +154,4 @@ Linter:
 #  only:
 #    - schedules
 
+# vim: et list