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

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

parent 2e6036f5
No related branches found
No related tags found
3 merge requests!297Cicd merge back,!284Cicd,!282CICD
*.swp
*.retry
*-openrc.sh
gc_key.pem
CICD/files/slurm.conf
CICD/files/slurmdbd.conf
CICD/files/ssh_known_hosts
......@@ -7,12 +7,21 @@ stages:
# - integration_test_downstream # working but unwanted here
# - trigger_pipeline_in_B # working but unwanted here
- yamllint
# - heat
- heat
- ansible_create_cluster_stage
- push_button_spawn_cluster
# - e2e
- 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:
# stage: integration_test_downstream
......@@ -21,33 +30,33 @@ stages:
# 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
heat_test:
stage: heat
allow_failure: false
tags:
- heat
before_script:
- source ./keys/$NECTAR_ALLOCATION-openrc.sh
- export HEAT_TEST_STACKNAME=_TESTING_HEAT
- bash -x ./heat/heatcicdwrapper.sh delete_if_exists $HEAT_TEST_STACKNAME
- sleep 60
script:
- echo "heat_test stage"
- source ./keys/$NECTAR_ALLOCATION-openrc.sh
- bash -x ./heat/heatcicdwrapper.sh create $HEAT_TEST_STACKNAME
- openstack stack list
- bash -x ./heat/heatcicdwrapper.sh update $HEAT_TEST_STACKNAME
- openstack stack list
- bash -x ./heat/heatcicdwrapper.sh delete_if_exists $HEAT_TEST_STACKNAME
- openstack stack list
after_script:
- sleep 20 # artifically wait a bit to make sure it is really dead
only:
changes: #https://docs.gitlab.com/ee/ci/yaml/#onlychangesexceptchanges
- "heat/heatcicdwrapper.sh"
- "heat/*.{yml,yaml}"
- schedules
#- CICD/.gitlab-ci.yml
# heat_test:
# stage: heat
# allow_failure: false
# tags:
# - heat
# before_script:
# - source ./$NECTAR_ALLOCATION-openrc.sh
# - export HEAT_TEST_STACKNAME=_TESTING_HEAT
# - bash -x ./heat/heatcicdwrapper.sh delete_if_exists $HEAT_TEST_STACKNAME
# - sleep 60
# script:
# - echo "heat_test stage"
# - source ./$NECTAR_ALLOCATION-openrc.sh
# - bash -x ./heat/heatcicdwrapper.sh create $HEAT_TEST_STACKNAME
# - openstack stack list
# - bash -x ./heat/heatcicdwrapper.sh update $HEAT_TEST_STACKNAME
# - openstack stack list
# - bash -x ./heat/heatcicdwrapper.sh delete_if_exists $HEAT_TEST_STACKNAME
# - openstack stack list
# after_script:
# - sleep 20 # artifically wait a bit to make sure it is really dead
# only:
# changes: #https://docs.gitlab.com/ee/ci/yaml/#onlychangesexceptchanges
# - "heat/heatcicdwrapper.sh"
# - "heat/*.{yml,yaml}"
# - schedules
# #- CICD/.gitlab-ci.yml
yamllint:
stage: yamllint
......@@ -100,7 +109,7 @@ tests:
script:
- echo "tests stage"
- 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
- 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
......@@ -131,7 +140,7 @@ manual_cluster_spawn:
- echo I still need to handle os password
- echo $MANUAL_STACKNAME
script:
- source ./keys/$NECTAR_ALLOCATION-openrc.sh
- source ./$NECTAR_ALLOCATION-openrc.sh
- bash -x ./heat/heatcicdwrapper.sh create $MANUAL_STACKNAME
- git submodule update --init --remote --merge
- openstack stack list
......@@ -154,10 +163,6 @@ clean:
- echo "cleanup master"
- sleep 30
script:
- source ./keys/$NECTAR_ALLOCATION-openrc.sh
- bash -x ./heat/heatcicdwrapper.sh delete_if_exists _reporefmaster # hardcoding master stackname on purpose here
only:
refs:
- "master"
changes:
- schedules
- source ./$NECTAR_ALLOCATION-openrc.sh
- bash -x ./heat/heatcicdwrapper.sh delete_if_exists $STACKNAME
......@@ -9,7 +9,6 @@ cd CICD
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
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 -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