-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
104 lines (98 loc) · 2.43 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
stages:
- build
- export
"build@main":
image: registry.gitlab.com/xsf/docker-images/xep-buildspace/image:0.1.0
stage: build
script:
- python3 tools/ci-restore-timestamps.py
- make html inbox-html inbox-xml pdf xeplist refs xml
- bash tools/ci-prune-build.sh
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: '$CI_COMMIT_REF_NAME =~ /^main$/'
when: always
- when: never
cache:
key: build-cache
paths:
- build/
artifacts:
paths:
- build/
expire_in: '1 day'
resource_group: xep-build
"pack@main":
image: docker:19.03.11
stage: export
services:
- docker:19.03.11-dind
script:
- 'export IMAGE_REF="${CI_REGISTRY_IMAGE}/packed:main-$(date -Idate)-${CI_COMMIT_SHORT_SHA}"'
- 'export LATEST_REF="${CI_REGISTRY_IMAGE}/packed:main-latest"'
- 'docker build -t "$IMAGE_REF" -f pack-only.Dockerfile .'
- 'docker image tag "$IMAGE_REF" "$LATEST_REF"'
- 'docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY'
- 'docker push "$IMAGE_REF"'
- 'docker push "$LATEST_REF"'
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: '$CI_COMMIT_REF_NAME =~ /^main$/'
when: on_success
- when: never
resource_group: xep-pack
"attic@main":
image: python:3
stage: export
script:
- bash -x ./tools/ci-archive.sh
cache:
paths:
- state/
key: attic-state
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: '$CI_COMMIT_REF_NAME =~ /^main$/'
when: on_success
- when: never
resource_group: xep-attic
"announce@main":
image: python:3
stage: export
script:
- bash -x ./tools/ci-announce.sh
cache:
paths:
- state/
key: announce-state
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: '$CI_COMMIT_REF_NAME =~ /^main$/'
when: on_success
- when: never
resource_group: xep-announce
"build@mr":
image: registry.gitlab.com/xsf/docker-images/xep-buildspace-slim/image:0.1.1
stage: build
script:
- python3 tools/ci-restore-timestamps.py
- make html inbox-html
- git fetch --depth=50 origin main
- bash tools/ci-changed-builds.sh origin/main
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: always
- when: never
cache:
key: build-cache
paths:
- build/
policy: pull
artifacts:
expose_as: "Changed Documents"
paths: ["rendered-changes/"]
expire_in: '7 days'