|
1 | | - |
2 | 1 | .service-rust-base: |
3 | 2 | image: ${RUST_IMAGE} |
4 | 3 | stage: check |
| 4 | + cache: |
| 5 | + key: ${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG} |
| 6 | + fallback_keys: |
| 7 | + - ${CI_JOB_NAME}-${CI_DEFAULT_BRANCH} |
| 8 | + - ${CI_JOB_NAME} |
| 9 | + paths: |
| 10 | + - .cargo/registry/index/ |
| 11 | + - .cargo/registry/cache/ |
| 12 | + - .cargo/git/db/ |
| 13 | + - target/ |
5 | 14 |
|
6 | 15 | .service-format-check: |
7 | 16 | extends: .service-rust-base |
|
20 | 29 | script: |
21 | 30 | - cargo test --package ${SERVICE_NAME} |
22 | 31 |
|
23 | | -.service-build: |
24 | | - extends: .service-rust-base |
25 | | - stage: build |
26 | | - script: |
27 | | - - cargo build --release --package ${SERVICE_NAME} |
28 | | - artifacts: |
29 | | - paths: |
30 | | - - target/release/${SERVICE_NAME} |
31 | | - expire_in: 1 week |
32 | | - |
33 | 32 | .service-image: |
34 | 33 | image: |
35 | 34 | name: moby/buildkit:rootless |
36 | | - entrypoint: [''] |
| 35 | + entrypoint: [""] |
37 | 36 | before_script: |
38 | 37 | - mkdir -p ~/.docker |
39 | 38 | - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > ~/.docker/config.json |
|
44 | 43 | --frontend dockerfile.v0 \ |
45 | 44 | --local context=. \ |
46 | 45 | --local dockerfile=./services/${SERVICE_DIR} \ |
47 | | - --import-cache type=registry,ref=$CI_REGISTRY_IMAGE/${SERVICE_NAME}:$CI_COMMIT_SHA-cache \ |
48 | | - --export-cache type=registry,ref=$CI_REGISTRY_IMAGE/${SERVICE_NAME}:$CI_COMMIT_SHA-cache,mode=max \ |
| 46 | + --import-cache type=registry,ref=$CI_REGISTRY_IMAGE/${SERVICE_NAME}:cache-$CI_DEFAULT_BRANCH \ |
| 47 | + --import-cache type=registry,ref=$CI_REGISTRY_IMAGE/${SERVICE_NAME}:cache-$CI_COMMIT_REF_SLUG \ |
| 48 | + --export-cache type=registry,ref=$CI_REGISTRY_IMAGE/${SERVICE_NAME}:cache-$CI_COMMIT_REF_SLUG,mode=max \ |
49 | 49 | --output type=image,name=$CI_REGISTRY_IMAGE/${SERVICE_NAME}:$CI_COMMIT_SHA,push=true |
50 | 50 |
|
51 | 51 | ######################################################################## |
@@ -90,11 +90,6 @@ server-clippy: |
90 | 90 | - .server-workflow |
91 | 91 | - .service-clippy |
92 | 92 |
|
93 | | -server-build: |
94 | | - extends: |
95 | | - - .server-workflow |
96 | | - - .service-build |
97 | | - |
98 | 93 | server-image: |
99 | 94 | extends: |
100 | 95 | - .server-workflow |
@@ -145,11 +140,6 @@ moderation-clippy: |
145 | 140 | - .moderation-workflow |
146 | 141 | - .service-clippy |
147 | 142 |
|
148 | | -moderation-build: |
149 | | - extends: |
150 | | - - .moderation-workflow |
151 | | - - .service-build |
152 | | - |
153 | 143 | moderation-image: |
154 | 144 | extends: |
155 | 145 | - .moderation-workflow |
@@ -203,11 +193,6 @@ push-notifications-test: |
203 | 193 | - .push-notifications-workflow |
204 | 194 | - .service-test |
205 | 195 |
|
206 | | -push-notifications-build: |
207 | | - extends: |
208 | | - - .push-notifications-workflow |
209 | | - - .service-build |
210 | | - |
211 | 196 | push-notifications-image: |
212 | 197 | extends: |
213 | 198 | - .push-notifications-workflow |
|
0 commit comments