Skip to content

Commit 46e7741

Browse files
Merge upstream develop
2 parents 3d4d08b + c9cea34 commit 46e7741

73 files changed

Lines changed: 3003 additions & 288 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitlab/ci/build_app.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ app-web-image:
5858
- !reference [.release-workflow, rules]
5959
image:
6060
name: moby/buildkit:rootless
61-
entrypoint: ['']
61+
entrypoint: [""]
6262
before_script:
6363
- mkdir -p ~/.docker
6464
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > ~/.docker/config.json
@@ -71,8 +71,9 @@ app-web-image:
7171
--local dockerfile=./apps/polycentric \
7272
--opt build-arg:EXPO_PUBLIC_POLYCENTRIC_SEED_SERVERS=$EXPO_PUBLIC_POLYCENTRIC_SEED_SERVERS \
7373
--opt build-arg:SKIP_WORKSPACE_BUILD=1 \
74-
--import-cache type=registry,ref=$CI_REGISTRY_IMAGE/app:$CI_COMMIT_SHA-cache \
75-
--export-cache type=registry,ref=$CI_REGISTRY_IMAGE/app:$CI_COMMIT_SHA-cache,mode=max \
74+
--import-cache type=registry,ref=$CI_REGISTRY_IMAGE/app:cache-$CI_DEFAULT_BRANCH \
75+
--import-cache type=registry,ref=$CI_REGISTRY_IMAGE/app:cache-$CI_COMMIT_REF_SLUG \
76+
--export-cache type=registry,ref=$CI_REGISTRY_IMAGE/app:cache-$CI_COMMIT_REF_SLUG,mode=max \
7677
--output type=image,name=$CI_REGISTRY_IMAGE/app:$CI_COMMIT_SHA,push=true
7778
7879
.app-build-expo:

.gitlab/ci/build_js_sdks.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,17 @@
1818

1919
.js-sdks-base:
2020
extends: .js-sdk-workflow
21+
variables:
22+
PNPM_STORE_DIR: ${CI_PROJECT_DIR}/.pnpm-store
23+
cache:
24+
key: js-sdks-pnpm-${CI_COMMIT_REF_SLUG}
25+
fallback_keys:
26+
- js-sdks-pnpm-${CI_DEFAULT_BRANCH}
27+
paths:
28+
- .pnpm-store
2129
before_script:
2230
- npm install -g pnpm@10
31+
- pnpm config set store-dir ${PNPM_STORE_DIR}
2332
- pnpm config set @polycentric:registry https://${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/
2433
- pnpm install
2534

.gitlab/ci/build_rn_sdk.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,16 @@ rn-android-build:
2525
- !reference [.app-workflow, rules]
2626
- !reference [.release-workflow, rules]
2727
cache:
28-
- key:
29-
files:
30-
- packages/rs-core/Cargo.lock
31-
prefix: rs-core-cargo-deps
28+
- key: rs-core-cargo-deps-${CI_COMMIT_REF_SLUG}
29+
fallback_keys:
30+
- rs-core-cargo-deps-${CI_DEFAULT_BRANCH}
3231
paths:
3332
- .cargo/registry/index
3433
- .cargo/registry/cache
3534
- .cargo/git/db
36-
- key:
37-
files:
38-
- packages/rs-core/Cargo.lock
39-
- pnpm-lock.yaml
40-
prefix: rs-core-target-${CI_JOB_NAME}
35+
- key: rs-core-target-${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}
36+
fallback_keys:
37+
- rs-core-target-${CI_JOB_NAME}-${CI_DEFAULT_BRANCH}
4138
paths:
4239
- target
4340
script:

.gitlab/ci/build_rs_core.yml

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,16 @@
2020
variables:
2121
RUST_CORE_PATH: packages/rs-core
2222
cache:
23-
- key:
24-
files:
25-
- packages/rs-core/Cargo.lock
26-
prefix: rs-core-cargo-deps
23+
- key: rs-core-cargo-deps-${CI_COMMIT_REF_SLUG}
24+
fallback_keys:
25+
- rs-core-cargo-deps-${CI_DEFAULT_BRANCH}
2726
paths:
2827
- .cargo/registry/index
2928
- .cargo/registry/cache
3029
- .cargo/git/db
31-
- key:
32-
files:
33-
- packages/rs-core/Cargo.lock
34-
prefix: rs-core-target-${CI_JOB_NAME}
30+
- key: rs-core-target-${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}
31+
fallback_keys:
32+
- rs-core-target-${CI_JOB_NAME}-${CI_DEFAULT_BRANCH}
3533
paths:
3634
- target
3735

@@ -92,22 +90,6 @@ rs-core-uniffi-web-build:
9290
- !reference [.rn-sdk-workflow, rules]
9391
- !reference [.app-workflow, rules]
9492
- !reference [.release-workflow, rules]
95-
cache:
96-
- key:
97-
files:
98-
- packages/rs-core/Cargo.lock
99-
prefix: rs-core-cargo-deps
100-
paths:
101-
- .cargo/registry/index
102-
- .cargo/registry/cache
103-
- .cargo/git/db
104-
- key:
105-
files:
106-
- packages/rs-core/Cargo.lock
107-
- pnpm-lock.yaml
108-
prefix: rs-core-target-${CI_JOB_NAME}
109-
paths:
110-
- target
11193
script:
11294
- cd packages/rs-core-uniffi-web
11395
- |

.gitlab/ci/build_services.yml

Lines changed: 29 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
21
.service-rust-base:
32
image: ${RUST_IMAGE}
43
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/
514

615
.service-format-check:
716
extends: .service-rust-base
@@ -20,20 +29,10 @@
2029
script:
2130
- cargo test --package ${SERVICE_NAME}
2231

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-
3332
.service-image:
3433
image:
3534
name: moby/buildkit:rootless
36-
entrypoint: ['']
35+
entrypoint: [""]
3736
before_script:
3837
- mkdir -p ~/.docker
3938
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > ~/.docker/config.json
@@ -44,8 +43,9 @@
4443
--frontend dockerfile.v0 \
4544
--local context=. \
4645
--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 \
4949
--output type=image,name=$CI_REGISTRY_IMAGE/${SERVICE_NAME}:$CI_COMMIT_SHA,push=true
5050
5151
########################################################################
@@ -90,11 +90,6 @@ server-clippy:
9090
- .server-workflow
9191
- .service-clippy
9292

93-
server-build:
94-
extends:
95-
- .server-workflow
96-
- .service-build
97-
9893
server-image:
9994
extends:
10095
- .server-workflow
@@ -145,11 +140,6 @@ moderation-clippy:
145140
- .moderation-workflow
146141
- .service-clippy
147142

148-
moderation-build:
149-
extends:
150-
- .moderation-workflow
151-
- .service-build
152-
153143
moderation-image:
154144
extends:
155145
- .moderation-workflow
@@ -162,56 +152,51 @@ moderation-image:
162152
# notifications
163153
########################################################################
164154

165-
.notifications-workflow:
155+
.push-notifications-workflow:
166156
image: gitlab.futo.org:5050/devops/manifest-repo/library/docker:latest
167157
rules:
168-
- if: $CI_COMMIT_TAG =~ /^notifications-/
158+
- if: $CI_COMMIT_TAG =~ /^push-notifications-/
169159
when: always
170160
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
171161
changes:
172162
- Cargo.toml
173163
- Cargo.lock
174-
- services/notifications/**/*
164+
- services/push-notifications/**/*
175165
- services/common/**/*
176166
- .gitlab/ci/build_services.yml
177167
- .gitlab/ci/deploy_services.yml
178168
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
179169
when: never
180170
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
181171
changes:
182-
- services/notifications/**/*
172+
- services/push-notifications/**/*
183173
- services/common/**/*
184174
- .gitlab/ci/build_services.yml
185175
- .gitlab/ci/deploy_services.yml
186176
variables:
187177
RUNNER_SCRIPT_TIMEOUT: 179m
188-
SERVICE_NAME: notifications-service
189-
SERVICE_DIR: notifications
178+
SERVICE_NAME: push-notifications-service
179+
SERVICE_DIR: push-notifications
190180

191-
notifications-format-check:
181+
push-notifications-format-check:
192182
extends:
193-
- .notifications-workflow
183+
- .push-notifications-workflow
194184
- .service-format-check
195185

196-
notifications-clippy:
186+
push-notifications-clippy:
197187
extends:
198-
- .notifications-workflow
188+
- .push-notifications-workflow
199189
- .service-clippy
200190

201-
notifications-test:
191+
push-notifications-test:
202192
extends:
203-
- .notifications-workflow
193+
- .push-notifications-workflow
204194
- .service-test
205195

206-
notifications-build:
207-
extends:
208-
- .notifications-workflow
209-
- .service-build
210-
211-
notifications-image:
196+
push-notifications-image:
212197
extends:
213-
- .notifications-workflow
198+
- .push-notifications-workflow
214199
- .service-image
215200
rules:
216-
- !reference [.notifications-workflow, rules]
201+
- !reference [.push-notifications-workflow, rules]
217202
- !reference [.release-workflow, rules]

.gitlab/ci/deploy_services.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,41 +125,41 @@ moderation-deploy-manifest-production:
125125
# notifications
126126
########################################################################
127127

128-
.notifications-deploy-workflow:
128+
.push-notifications-deploy-workflow:
129129
rules:
130130
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
131131
changes:
132-
- services/notifications/**/*
132+
- services/push-notifications/**/*
133133
- services/common/**/*
134134
- .gitlab/ci/build_services.yml
135135
- .gitlab/ci/deploy_services.yml
136136
variables:
137-
SERVICE_NAME: notifications-service
137+
SERVICE_NAME: push-notifications-service
138138

139139
########################################
140140
# Tag the image with environment label #
141141
########################################
142142

143-
notifications-deploy-image-production:
143+
push-notifications-deploy-image-production:
144144
extends:
145-
- .notifications-deploy-workflow
145+
- .push-notifications-deploy-workflow
146146
- .service-deploy-image
147147
when: manual
148148
environment:
149-
name: production/notifications-service
149+
name: production/push-notifications-service
150150
needs:
151-
- job: notifications-image
151+
- job: push-notifications-image
152152
artifacts: false
153153

154154
###############################
155155
# Rolling restart on Manifest #
156156
###############################
157157

158-
notifications-deploy-manifest-production:
158+
push-notifications-deploy-manifest-production:
159159
extends:
160-
- .notifications-deploy-workflow
160+
- .push-notifications-deploy-workflow
161161
- .service-deploy-manifest
162162
variables:
163163
MANIFEST_QUICK_TARGETS: inventory/polycentric-east/notifications.yml:polycentriceast
164164
needs:
165-
- notifications-deploy-image-production
165+
- push-notifications-deploy-image-production

.gitlab/ci/scan_dependencies.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ trivy:
1818
# Console output
1919
- trivy filesystem --scanners misconfig,vuln --exit-code 1 --severity CRITICAL .
2020
cache:
21+
key: trivy-${CI_COMMIT_REF_SLUG}
22+
fallback_keys:
23+
- trivy-${CI_DEFAULT_BRANCH}
2124
paths:
2225
- .trivycache/
2326
artifacts:

0 commit comments

Comments
 (0)