From 7f2ccf25413eefe4f157edcc02d8ae23a7397ffc Mon Sep 17 00:00:00 2001
From: handreas <andreas.hamacher@monash.edu>
Date: Fri, 11 Sep 2020 10:19:22 +0000
Subject: [PATCH] still working on gc_key file

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

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9416c99e..93f781d1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -84,12 +84,11 @@ testlustre:
   - heat
   before_script:
     - cd $DEFAULT_PATH
-    #- echo "$GC_KEY" > GC_KEY
-    - chmod 400 GC_KEY
     - echo "$HPCCICD_openrc" > ./$NECTAR_ALLOCATION-openrc.sh
     - sleep 60
   script:
     - echo "heat stage"
+    - chmod 400 GC_KEY
     - source ./$NECTAR_ALLOCATION-openrc.sh
     - openstack stack list
     - openstack stack create --wait --template heat/lustre_HOT.yaml --parameter "project_name=$STACKNAME" $STACKNAME
@@ -110,11 +109,11 @@ build_cluster_cicd:
   - heat
   before_script:
     - cd $DEFAULT_PATH
-    - chmod 400 GC_KEY
     - echo "$HPCCICD_openrc" > ./$NECTAR_ALLOCATION-openrc.sh
   script:
     - echo "heat stage"
     #- source ./$NECTAR_ALLOCATION-openrc.sh
+    - chmod 400 GC_KEY
     - openstack stack list
     - bash -x ./heat/heatcicdwrapper.sh create_or_update $STACKNAME
     - bash -x ./heat/server_rebuild.sh all
@@ -132,10 +131,10 @@ ansible_create_cluster_stage:
   - ansible
   before_script:
     - cd $DEFAULT_PATH/..
-    - chmod 400 GC_KEY
     - echo "$HPCCICD_openrc" > ./$NECTAR_ALLOCATION-openrc.sh
   script:
     - echo "ansible_create_cluster_stage"
+    - chmod 400 GC_KEY
     - bash -x ./CICD/ansible_create_cluster_script.sh
     - cd CICD
     - ansible-playbook -i files/inventory.$STACKNAME --key-file ../GC_KEY --skip-tags SiteSpecific master_playbook.yml
@@ -154,11 +153,10 @@ tests:
   tags:
   - ansible
   before_script:
-    #- echo "$GC_KEY" > GC_KEY
-    - chmod 400 GC_KEY
     - echo "$HPCCICD_openrc" > ./$NECTAR_ALLOCATION-openrc.sh
   script:
     - echo "tests stage"
+    - chmod 400 GC_KEY
     - source ./$NECTAR_ALLOCATION-openrc.sh
     - openstack stack list
     - cd CICD
@@ -174,8 +172,6 @@ tests:
     - ansible -B 30 -i files/inventory.$STACKNAME --key-file ../GC_KEY -a "systemctl is-active --quiet mariadb" SQLNodes
     - ansible -B 30 -i files/inventory.$STACKNAME --key-file ../GC_KEY -a "systemctl is-active --quiet slurmctld" ManagementNodes
     - ansible -B 30 -i files/inventory.$STACKNAME --key-file ../GC_KEY -a "systemctl is-active --quiet slurmdbd" ManagementNodes
-
-
     - bash -e ./tests/run_tests.sh all "files/inventory.$STACKNAME" "../GC_KEY"
     - bash -e ./tests/run_tests.sh ComputeNodes "files/inventory.$STACKNAME" "../GC_KEY"
     - bash -e ./tests/run_tests.sh LoginNodes "files/inventory.$STACKNAME" "../GC_KEY"
@@ -213,11 +209,10 @@ manual_cluster_spawn:
     - echo "for this to work you have to provide a variable called manual stackname"
     - echo I still need to handle os password
     - echo $MANUAL_STACKNAME
-    - echo "$GC_KEY" > GC_KEY
-    - chmod 400 GC_KEY
     - echo "$HPCCICD_openrc" > ./$NECTAR_ALLOCATION-openrc.sh
   script:
     - source ./$NECTAR_ALLOCATION-openrc.sh
+    - chmod 400 GC_KEY
     - bash -x ./CICD/heat/heatcicdwrapper.sh create $MANUAL_STACKNAME ${CI_PROJECT_NAME}
     - openstack stack list
     - export STACKNAME=$MANUAL_STACKNAME
-- 
GitLab