Skip to content

Commit

Permalink
add gitlab configs for cztb2 (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
slabasan authored Sep 19, 2023
1 parent eff7751 commit 2cc3789
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .gitlab/cztb2-build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
stages:
- status_initiate
- build
- status_update

.on_cztb2:
tags:
- shell
- cztb2
rules:
# Only report failure if the pipeline failed.
- if: '$CI_JOB_NAME =~ /status_failure/'
when: on_failure
# A true statement is expected to allow jobs to run. Here is the default.
- when: on_success

.status_report: &status_report
- export context="cztb2"
- |
curl --url "https://api.github.com/repos/llnl/${CI_PROJECT_NAME}/statuses/${CI_COMMIT_SHA}" \
--header 'Content-Type: application/json' \
--header "authorization: Bearer ${GITHUB_TOKEN}" \
--data "{ \"state\": \"${pipeline_status}\", \"target_url\": \"${CI_PIPELINE_URL}\", \"description\": \"GitLab ${context} pipeline\", \"context\": \"ci/gitlab/${context}\" }"
status_pending:
tags:
- shell
- cztb2
extends: [.on_cztb2]
stage: status_initiate
script:
- export pipeline_status="pending"
- *status_report

status_success:
tags:
- shell
- cztb2
extends: [.on_cztb2]
stage: status_update
script:
- export pipeline_status="success"
- *status_report
when: on_success

status_failure:
tags:
- shell
- cztb2
extends: [.on_cztb2]
stage: status_update
script:
- export pipeline_status="failure"
- *status_report
when: on_failure

# build across power lab
build-cztb2:
tags:
- shell
- cztb2
stage: build
script:
- git clone $MSR_SAFE_ANSIBLE
- cd msr-safe-ansible-setup
- ansible-playbook msr-safe-powerlab-playbook.yml --extra-vars "branch=${TARGET_BRANCH}"
5 changes: 5 additions & 0 deletions .gitlab/subscribed-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Trigger a build pipeline for the following systems
cztb2-build-and-test:
variables:
CI_MACHINE: "cztb2"
extends: [.build]

0 comments on commit 2cc3789

Please sign in to comment.