-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
114 lines (107 loc) · 2.9 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
114 lines (107 loc) · 2.9 KB
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
104
105
106
107
108
109
110
111
112
113
114
stages:
- test
- build
- manifest
include:
- project: code0-tech/development/telescopium
ref: build-branch
file: ci-template.gitlab-ci.yml
.dind:
variables:
DOCKER_MIRROR: https://mirror.gcr.io
DOCKER_OPTIONS: "--registry-mirror ${DOCKER_MIRROR}"
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2376
DOCKER_TLS_CERTDIR: /certs
services:
- name: docker:29.4.1-dind
alias: docker
entrypoint: [ "sh", "-c", "dockerd-entrypoint.sh $DOCKER_OPTIONS" ]
.node-actions:
- gls-action
- shopify-action
- woocommerce-action
- shopware-action
- twilio-action
- stripe-action
.rust-actions:
- cron-action
- rest-action
- mcp-action
test-node:
image: node:24.10.0
stage: test
parallel:
matrix:
- C0_ACTION: !reference [.node-actions]
script:
- cd actions/$C0_ACTION
- npm ci
- npm run typecheck
- npm run test
build-docker:
extends:
- .dind
image: docker:29.4.1
stage: build
tags:
- c0-$PLATFORM
parallel:
matrix:
- C0_ACTION: !reference [.node-actions]
PLATFORM: [amd64, arm64]
- C0_ACTION: !reference [.rust-actions]
PLATFORM: [amd64, arm64]
before_script:
- echo $C0_GH_TOKEN | docker login -u $ --password-stdin ghcr.io
- docker context create build-context
- docker buildx create --name container-builder --driver docker-container --bootstrap --use build-context
script:
- cd actions/$C0_ACTION
- CACHE_TO=""
- |
if [ "$CI_COMMIT_BRANCH" = "main" ]; then
CACHE_TO="--cache-to type=registry,ref=ghcr.io/code0-tech/centaurus/ci-cache:$C0_ACTION-$PLATFORM,mode=max"
fi
- >
docker buildx build
-t ghcr.io/code0-tech/centaurus/ci-builds/$C0_ACTION
--output type=registry,push-by-digest=true
--metadata-file manifest-${CI_JOB_ID}.json
--cache-from type=registry,ref=ghcr.io/code0-tech/centaurus/ci-cache:$C0_ACTION-$PLATFORM
$CACHE_TO
.
artifacts:
paths:
- actions/$C0_ACTION/manifest-*.json
expire_in: 1 day
manifest-docker:
extends:
- .dind
image: docker:29.4.1
stage: manifest
tags:
- c0-amd64
parallel:
matrix:
- C0_ACTION: !reference [.node-actions]
- C0_ACTION: !reference [.rust-actions]
needs:
- job: build-docker
parallel:
matrix:
- C0_ACTION: [ '$[[ matrix.C0_ACTION ]]' ]
PLATFORM: [amd64, arm64]
before_script:
- apk add --no-cache jq
- echo $C0_GH_TOKEN | docker login -u $ --password-stdin ghcr.io
script:
- cd actions/$C0_ACTION
- |
refs=""
for manifest in manifest-*.json; do
name=$(jq -r '."image.name"' "$manifest")
digest=$(jq -r '."containerimage.digest"' "$manifest")
refs="$refs $name@$digest"
done
docker buildx imagetools create -t "ghcr.io/code0-tech/centaurus/ci-builds/$C0_ACTION:0.0.0-experimental-$CI_PIPELINE_ID-$CI_COMMIT_SHA" $refs