forked from pogobanane/doctor-cluster-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
66 lines (61 loc) · 1.79 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
stages:
- eval
- notify-eval-error
- build
- notify-build
eval:
stage: eval
script:
- nix run github:nix-community/nix-eval-jobs#nix-eval-jobs -- --workers 8 --gc-roots-dir $(pwd)/gcroot --flake '.#hydraJobs' > jobs.json
- nix run nixpkgs/nixpkgs-unstable#jq -- -r '.attr + " " + .drvPath' < jobs.json > jobs
- |
echo > generated-config.yml
while read -r line; do
IFS=" " read attr drvPath <<< "$line"
cat >> generated-config.yml <<EOF
build-$attr:
stage: build
retry: 2
script:
- nix build --out-link "result-$attr" -L "$drvPath"
- |
if [[ -n "$CACHIX_AUTH_TOKEN" ]]; then
nix run nixpkgs/nixpkgs-unstable#cachix -- push ${CACHIX_NAME:-tum-dse} "result-$attr"
fi
EOF
done < jobs
artifacts:
paths:
- generated-config.yml
- jobs.json
build:
stage: build
trigger:
include:
- artifact: generated-config.yml
job: eval
strategy: depend
notify-eval-error:
needs: ["eval"]
stage: notify-eval-error
when: on_failure
script:
- |
echo "eval failed ${CI_PIPELINE_URL}" | \
LOGNAME=gitlab nix run github:Mic92/nur-packages#ircsink -- --nick=gitlab --server=irc.r --target="#xxx" || true
notify-failure:
needs: ["build"]
stage: notify-build
when: on_failure
script:
- |
echo "build failed ${CI_PIPELINE_URL}" | \
LOGNAME=gitlab nix run github:Mic92/nur-packages#ircsink -- --nick=gitlab --server=irc.r --target="#xxx" || true
notify-success:
needs: ["build"]
stage: notify-build
when: on_success
script:
- |
echo "build succeeded ${CI_PIPELINE_URL}" | \
LOGNAME=gitlab nix run github:Mic92/nur-packages#ircsink -- --nick=gitlab --server=irc.r --target="#xxx" || true