Skip to content
Snippets Groups Projects
Commit 46f7409b authored by Andreas Hamacher's avatar Andreas Hamacher
Browse files

fixing some issues from the first commit. mainly key handling and pathes

Former-commit-id: 746a1a35
parent cd14b158
No related branches found
No related tags found
No related merge requests found
*.swp
*.retry *.retry
*-openrc.sh *-openrc.sh
gc_key.pem gc_key.pem
CICD/files/slurm.conf
CICD/files/slurmdbd.conf
CICD/files/ssh_known_hosts
...@@ -7,12 +7,21 @@ stages: ...@@ -7,12 +7,21 @@ stages:
# - integration_test_downstream # working but unwanted here # - integration_test_downstream # working but unwanted here
# - trigger_pipeline_in_B # working but unwanted here # - trigger_pipeline_in_B # working but unwanted here
- yamllint - yamllint
# - heat - heat
- ansible_create_cluster_stage - ansible_create_cluster_stage
- push_button_spawn_cluster - push_button_spawn_cluster
# - e2e # - e2e
- tests - tests
# - clean # only on master - clean # only on master
setup:
stage: .pre
tags:
- ansible
script:
- echo $GC_KEY > gc_key.pem
- chmod 400 gc_key.pem
- echo $HPCCICD_openrc > ./$NECTAR_ALLOCATION-openrc.sh
#trigger_pipeline_in_B: #trigger_pipeline_in_B:
# stage: integration_test_downstream # stage: integration_test_downstream
...@@ -21,33 +30,33 @@ stages: ...@@ -21,33 +30,33 @@ stages:
# script: # script:
# - "curl --request POST --form token=${CI_JOB_TOKEN} --form ref=master https://gitlab.erc.monash.edu.au/api/v4/projects/1085/trigger/pipeline" # ID is from pysshauthz # - "curl --request POST --form token=${CI_JOB_TOKEN} --form ref=master https://gitlab.erc.monash.edu.au/api/v4/projects/1085/trigger/pipeline" # ID is from pysshauthz
heat_test: # heat_test:
stage: heat # stage: heat
allow_failure: false # allow_failure: false
tags: # tags:
- heat # - heat
before_script: # before_script:
- source ./keys/$NECTAR_ALLOCATION-openrc.sh # - source ./$NECTAR_ALLOCATION-openrc.sh
- export HEAT_TEST_STACKNAME=_TESTING_HEAT # - export HEAT_TEST_STACKNAME=_TESTING_HEAT
- bash -x ./heat/heatcicdwrapper.sh delete_if_exists $HEAT_TEST_STACKNAME # - bash -x ./heat/heatcicdwrapper.sh delete_if_exists $HEAT_TEST_STACKNAME
- sleep 60 # - sleep 60
script: # script:
- echo "heat_test stage" # - echo "heat_test stage"
- source ./keys/$NECTAR_ALLOCATION-openrc.sh # - source ./$NECTAR_ALLOCATION-openrc.sh
- bash -x ./heat/heatcicdwrapper.sh create $HEAT_TEST_STACKNAME # - bash -x ./heat/heatcicdwrapper.sh create $HEAT_TEST_STACKNAME
- openstack stack list # - openstack stack list
- bash -x ./heat/heatcicdwrapper.sh update $HEAT_TEST_STACKNAME # - bash -x ./heat/heatcicdwrapper.sh update $HEAT_TEST_STACKNAME
- openstack stack list # - openstack stack list
- bash -x ./heat/heatcicdwrapper.sh delete_if_exists $HEAT_TEST_STACKNAME # - bash -x ./heat/heatcicdwrapper.sh delete_if_exists $HEAT_TEST_STACKNAME
- openstack stack list # - openstack stack list
after_script: # after_script:
- sleep 20 # artifically wait a bit to make sure it is really dead # - sleep 20 # artifically wait a bit to make sure it is really dead
only: # only:
changes: #https://docs.gitlab.com/ee/ci/yaml/#onlychangesexceptchanges # changes: #https://docs.gitlab.com/ee/ci/yaml/#onlychangesexceptchanges
- "heat/heatcicdwrapper.sh" # - "heat/heatcicdwrapper.sh"
- "heat/*.{yml,yaml}" # - "heat/*.{yml,yaml}"
- schedules # - schedules
#- CICD/.gitlab-ci.yml # #- CICD/.gitlab-ci.yml
yamllint: yamllint:
stage: yamllint stage: yamllint
...@@ -100,7 +109,7 @@ tests: ...@@ -100,7 +109,7 @@ tests:
script: script:
- echo "tests stage" - echo "tests stage"
- export ANSIBLE_HOST_KEY_CHECKING=False - export ANSIBLE_HOST_KEY_CHECKING=False
- source ./keys/$NECTAR_ALLOCATION-openrc.sh - source ./$NECTAR_ALLOCATION-openrc.sh
- python3 dependencies/ansible_cluster_in_a_box/scripts/make_inventory.py static CICD$STACKNAME | tee ./files/cicd_inventory - python3 dependencies/ansible_cluster_in_a_box/scripts/make_inventory.py static CICD$STACKNAME | tee ./files/cicd_inventory
- grep -qv "I could not find any resouces tagged with project_name:" ./files/cicd_inventory #fail if inventory file is empty - grep -qv "I could not find any resouces tagged with project_name:" ./files/cicd_inventory #fail if inventory file is empty
- chmod 755 ./files/cicd_inventory - chmod 755 ./files/cicd_inventory
...@@ -131,7 +140,7 @@ manual_cluster_spawn: ...@@ -131,7 +140,7 @@ manual_cluster_spawn:
- echo I still need to handle os password - echo I still need to handle os password
- echo $MANUAL_STACKNAME - echo $MANUAL_STACKNAME
script: script:
- source ./keys/$NECTAR_ALLOCATION-openrc.sh - source ./$NECTAR_ALLOCATION-openrc.sh
- bash -x ./heat/heatcicdwrapper.sh create $MANUAL_STACKNAME - bash -x ./heat/heatcicdwrapper.sh create $MANUAL_STACKNAME
- git submodule update --init --remote --merge - git submodule update --init --remote --merge
- openstack stack list - openstack stack list
...@@ -154,10 +163,6 @@ clean: ...@@ -154,10 +163,6 @@ clean:
- echo "cleanup master" - echo "cleanup master"
- sleep 30 - sleep 30
script: script:
- source ./keys/$NECTAR_ALLOCATION-openrc.sh - source ./$NECTAR_ALLOCATION-openrc.sh
- bash -x ./heat/heatcicdwrapper.sh delete_if_exists _reporefmaster # hardcoding master stackname on purpose here - bash -x ./heat/heatcicdwrapper.sh delete_if_exists $STACKNAME
only:
refs:
- "master"
changes:
- schedules
...@@ -9,7 +9,6 @@ cd CICD ...@@ -9,7 +9,6 @@ cd CICD
echo "[ansible_create_cluster_script] Prefixing the Stackname with CICD because heatcicdwrapper does he same" echo "[ansible_create_cluster_script] Prefixing the Stackname with CICD because heatcicdwrapper does he same"
python3 ../scripts/make_inventory.py static CICD$STACKNAME | tee ./files/inventory.$STACKNAME && chmod 755 ./files/inventory.$STACKNAME python3 ../scripts/make_inventory.py static CICD$STACKNAME | tee ./files/inventory.$STACKNAME && chmod 755 ./files/inventory.$STACKNAME
grep -qv "I could not find any resouces tagged with project_name:" ./files/inventory.$STACKNAME #fail if inventory file is empty grep -qv "I could not find any resouces tagged with project_name:" ./files/inventory.$STACKNAME #fail if inventory file is empty
chmod 400 ../gc_key.pem
ansible -m ping -i files/inventory.$STACKNAME --key-file ../gc_key.pem all ansible -m ping -i files/inventory.$STACKNAME --key-file ../gc_key.pem all
ansible -i files/inventory.$STACKNAME --key-file ../gc_key.pem -a "sudo ls" all ansible -i files/inventory.$STACKNAME --key-file ../gc_key.pem -a "sudo ls" all
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment