-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
74 lines (67 loc) · 2.1 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
67
68
69
70
71
72
73
74
---
stages: [process, schedule]
variables:
REPO_URL: https://oauth2:$ACCESS_TOKEN@$CI_SERVER_HOST/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME
default:
before_script:
- apk add --no-cache --upgrade git bash findutils grep curl jq shfmt rsync diffutils gawk openssh tar zstd
- git remote set-url origin $REPO_URL
- git fetch --tags --all --depth 20
include: ".gitlab-ci-*.yml"
on-commit:
stage: process
image: alpine:latest
script:
- .ci/on-commit.sh
artifacts:
paths:
- .ci/deptree.txt
- .ci/schedule-params.txt
expire_in: 1 hour
resource_group: chaotic
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"
on-schedule:
stage: process
image: alpine:latest
script:
- .ci/on-schedule.sh
- .ci/gitlab-clean.sh # Clean old artifacts
artifacts:
paths:
- .ci/deptree.txt
- .ci/schedule-params.txt
expire_in: 1 hour
resource_group: chaotic
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && ($SCHEDULED == "1" || $TRIGGER != null)
manual-schedule:
stage: process
image: alpine:latest
script:
- .ci/manual-schedule.sh
artifacts:
paths:
- .ci/deptree.txt
- .ci/schedule-params.txt
expire_in: 1 hour
resource_group: chaotic
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "web" && $PACKAGES != null
do-schedule:
stage: schedule
image:
name: registry.gitlab.com/garuda-linux/tools/chaotic-manager/manager
entrypoint: [""] # override entrypoint as we don't have the needed key during first execution yet
before_script:
- '[[ -z ${DEPLOY_KEY+x} ]] && echo "No deploy key available, backing off!" && exit 1'
- echo "$DEPLOY_KEY" >/app/sshkey
- chmod 400 /app/sshkey
script:
- |
if [ -f .ci/schedule-params.txt ]; then set -x; source ".ci/schedule-params.txt";
if [[ -v PARAMS_SCHEDULE ]]; then /entry_point.sh "${PARAMS_SCHEDULE[@]}"; fi;
if [[ -v PARAMS_AUTOREPOREMOVE ]]; then /entry_point.sh "${PARAMS_AUTOREPOREMOVE[@]}"; fi;
fi
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH