Page MenuHomePhorge

D6.1731130272.diff
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

D6.1731130272.diff

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,16 +1,47 @@
+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
+
+.report:
+ image:
+ name: 'reg.lily.kazv.moe/infra/phorge-ci-tools:servant'
+ rules:
+ - if: $TARGET_PHID
+ when: always
+ - when: never
+ before_script:
+ - pipelineUrl="$CI_PROJECT_URL"/-/pipelines/"$CI_PIPELINE_ID"
+
+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"
+
+report-start:
+ extends: .report
+ stage: prepare
+ script:
+ - 'echo "{\"receiver\": \"$TARGET_PHID\", \"type\": \"work\", \"unit\": [{\"name\": \"GitLab CI (information only)\", \"result\": \"skip\", \"details\": \"$pipelineUrl\", \"format\": \"remarkup\"}]}" | /tools/arcanist/bin/arc call-conduit --conduit-uri https://iron.lily-is.land/ --conduit-token "$CONDUIT_TOKEN" -- harbormaster.sendmessage'
build-debug:
stage: build
@@ -19,6 +50,7 @@
script: |
./script.sh
artifacts:
+ <<: *defaultArtifacts
paths:
- testfile
expire_in: 1 week
@@ -29,7 +61,9 @@
name: 'ubuntu:21.04'
script: |
./script.sh
+ false
artifacts:
+ <<: *defaultArtifacts
paths:
- testfile
expire_in: 1 week
@@ -41,7 +75,17 @@
script: |
export VAR=foo
./script.sh
+ false
artifacts:
+ <<: *defaultArtifacts
paths:
- testfile
expire_in: 1 week
+
+report-final:
+ extends: .report
+ stage: report
+ 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

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 8, 9:31 PM (12 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36715
Default Alt Text
D6.1731130272.diff (2 KB)

Event Timeline