diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,16 +1,31 @@ +workflow: + rules: + # Run when triggered manually + - if: '$CI_PIPELINE_SOURCE == "trigger"' + # Branch pipelines always run + - if: $CI_COMMIT_BRANCH + # Tags other than phorge's staging area + - if: '$CI_COMMIT_TAG !~ /^phabricator\//' + stages: - prepare - build + - report + +default: + after_script: + - touch status.env + - 'if [ "$CI_JOB_STATUS" != "success" ]; then echo FAILED=1 >> status.env; fi' + artifacts: &defaultArtifacts + reports: + dotenv: status.env prepare-env: stage: prepare script: | tag="$CI_COMMIT_REF_SLUG" - echo "tag=$tag" >> prepare.env - echo "libkazvTag=servant" >> prepare.env - artifacts: - reports: - dotenv: prepare.env + echo source="$CI_PIPELINE_SOURCE" + echo target="$TARGET_PHID" build-debug: stage: build @@ -19,6 +34,7 @@ script: | ./script.sh artifacts: + <<: *defaultArtifacts paths: - testfile expire_in: 1 week @@ -30,6 +46,7 @@ script: | ./script.sh artifacts: + <<: *defaultArtifacts paths: - testfile expire_in: 1 week @@ -42,6 +59,17 @@ export VAR=foo ./script.sh artifacts: + <<: *defaultArtifacts paths: - testfile expire_in: 1 week + +report: + stage: report + image: + name: 'reg.lily.kazv.moe/infra/phorge-ci-tools:servant' + when: always + script: + - TYPE=pass + - if [ -n "$FAILED" ]; then TYPE=fail; fi + - 'echo "{\"receiver\": \"$TARGET_PHID\", \"type\": \"$TYPE\"}" | /tools/arcanist/bin/arc call-conduit --conduit-uri https://iron.lily-is.land/ --conduit-token "$CONDUIT_TOKEN" -- harbormaster.sendmessage' diff --git a/hello.sh b/hello.sh --- a/hello.sh +++ b/hello.sh @@ -1,2 +1,3 @@ #!/bin/bash echo 'Hello, world' +### Something