Skip to content
Snippets Groups Projects
.gitlab-ci.yml 9.87 KiB
variables:
  GIT_SUBMODULE_STRATEGY: recursive
  STACKNAME: CICD_${CI_PROJECT_NAME}_$CI_COMMIT_REF_NAME
  NECTAR_ALLOCATION: HPCCICD
  ANSIBLE_HOST_KEY_CHECKING: "False"
  DEFAULT_PATH: "CICD"

stages:
  - lint
  - extended
  #- heat_test
  - heat
  - ansible_create_cluster_stage
  - push_button_spawn_cluster
  - tests
  - integration_test #https://docs.gitlab.com/ee/ci/triggers/
  - clean
  - testlustre


trigger_pipeline_in_Clusterbuild:
  stage: integration_test
  tags:
  - ansible
  script:
  - echo ${CI_JOB_TOKEN}
  - curl --request POST --form token=${CI_JOB_TOKEN} --form "variables[TRIGGER_CI_COMMIT_SHA]=${CI_COMMIT_SHA}" --form ref=master https://gitlab.erc.monash.edu.au/api/v4/projects/193/trigger/pipeline  # ID is from clusterbuild
  only:
  - ${CI_PROJECT_NAME} == 'HPCasCode'


trigger_pipeline_in_monarch:
  stage: integration_test
  tags:
  - ansible
  script:
  - echo ${CI_JOB_TOKEN}
  - curl --request POST --form token=${CI_JOB_TOKEN} --form "variables[TRIGGER_CI_COMMIT_SHA]=${CI_COMMIT_SHA}" --form ref=master https://gitlab.erc.monash.edu.au/api/v4/projects/385/trigger/pipeline  # ID is from monarch
  only:
  - ${CI_PROJECT_NAME} == 'HPCasCode'

yamllint:
  stage: lint
  allow_failure: true
  tags:
  - yamllint
  script:
    - echo "stage yamllint"
    - cd CICD
    - yamllint -c ./.yamllintheat.yaml ./heat

# delete_stack_manual:
#   stage: delete_stack_manual
#   tags:
#   - heat
#   before_script:
#     - echo "$GC_KEY" > gc_key.pem
#     - chmod 400 gc_key.pem
#     - echo "$HPCCICD_openrc" > ./$NECTAR_ALLOCATION-openrc.sh
#   script:
#     - echo "heat stage"
#     - source ./$NECTAR_ALLOCATION-openrc.sh
#     - openstack stack list
#     - bash -x ./CICD/heat/heatcicdwrapper.sh delete_if_exists $STACKNAME
#   when: manual

ansiblelint:
  allow_failure: true
  stage: lint
  tags: