@payfit/nx-core 5.13.0-ephemeral-feature-migrate-to-github-actions.2 → 5.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/generators/init/globalFiles/.circleci/config.yml.template +282 -0
- package/dist/src/generators/init/globalFiles/.dockerignore.template +12 -0
- package/dist/src/generators/init/globalFiles/.npmrc.template +1 -0
- package/dist/src/generators/local-lambda-setup/files/scripts/invoke_lambda_local.sh.template +0 -0
- package/dist/src/utils/spacelift/lib/__generated__/gql.js +1 -1
- package/dist/src/utils/spacelift/lib/__generated__/graphql.d.ts +1416 -31
- package/dist/src/utils/spacelift/lib/__generated__/graphql.js +117 -9
- package/dist/src/utils/spacelift/lib/__generated__/graphql.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
version: 2.1
|
|
2
|
+
<% if (keepContinuationJobs) { %>
|
|
3
|
+
setup: true
|
|
4
|
+
<% } %>
|
|
5
|
+
orbs:
|
|
6
|
+
nx: nrwl/nx@1.7
|
|
7
|
+
aws-cli: circleci/aws-cli@5.4
|
|
8
|
+
github: payfit/github@0.9
|
|
9
|
+
node: circleci/node@7.1
|
|
10
|
+
<%_ if (keepContinuationJobs) { -%>
|
|
11
|
+
continuation: circleci/continuation@1.0
|
|
12
|
+
payfit-nx: payfit/nx@2
|
|
13
|
+
<%_ } -%>
|
|
14
|
+
<%_ if (keepEdpJob) { -%>
|
|
15
|
+
edp: payfit/edp@0
|
|
16
|
+
<% } %>
|
|
17
|
+
|
|
18
|
+
parameters:
|
|
19
|
+
node_version:
|
|
20
|
+
type: string
|
|
21
|
+
default: '<%= nodeVersion %>'
|
|
22
|
+
|
|
23
|
+
references:
|
|
24
|
+
setup_env_node: &setup_env_node
|
|
25
|
+
docker:
|
|
26
|
+
- image: cimg/node:<< pipeline.parameters.node_version >>
|
|
27
|
+
setup_env_machine: &setup_env_machine # Used for getting docker cli
|
|
28
|
+
machine:
|
|
29
|
+
image: ubuntu-2204:current
|
|
30
|
+
install_packages: &install_packages
|
|
31
|
+
check-cache: always
|
|
32
|
+
pkg-manager: yarn-berry
|
|
33
|
+
attach_workspace: &attach_workspace
|
|
34
|
+
at: ~/project
|
|
35
|
+
nx/set-shas: &nx_set_shas_option
|
|
36
|
+
error-on-no-successful-workflow: false
|
|
37
|
+
main-branch-name: main
|
|
38
|
+
workflow-name: build-test-deploy
|
|
39
|
+
<% if (keepContinuationJobs) { %>
|
|
40
|
+
only_main_and_deploy_branches: &only_main_and_deploy_branches
|
|
41
|
+
branches:
|
|
42
|
+
only:
|
|
43
|
+
- main
|
|
44
|
+
- /^deploy.*/
|
|
45
|
+
<% } %>
|
|
46
|
+
|
|
47
|
+
jobs:
|
|
48
|
+
install_packages:
|
|
49
|
+
<<: *setup_env_node
|
|
50
|
+
steps:
|
|
51
|
+
- checkout
|
|
52
|
+
- node/install-packages: *install_packages
|
|
53
|
+
|
|
54
|
+
lint:
|
|
55
|
+
<<: *setup_env_node
|
|
56
|
+
steps:
|
|
57
|
+
- checkout
|
|
58
|
+
- node/install-packages: *install_packages
|
|
59
|
+
- nx/set-shas: *nx_set_shas_option
|
|
60
|
+
- run: npx nx affected -t lint
|
|
61
|
+
|
|
62
|
+
nx-conformance:
|
|
63
|
+
<<: *setup_env_node
|
|
64
|
+
steps:
|
|
65
|
+
- checkout
|
|
66
|
+
- node/install-packages: *install_packages
|
|
67
|
+
- run: npx nx-cloud record -- npx nx-cloud conformance:check
|
|
68
|
+
|
|
69
|
+
nx-sync:
|
|
70
|
+
<<: *setup_env_node
|
|
71
|
+
steps:
|
|
72
|
+
- checkout
|
|
73
|
+
- node/install-packages: *install_packages
|
|
74
|
+
- run: npx nx-cloud record -- npx nx sync:check
|
|
75
|
+
|
|
76
|
+
format:
|
|
77
|
+
<<: *setup_env_node
|
|
78
|
+
steps:
|
|
79
|
+
- checkout
|
|
80
|
+
- node/install-packages: *install_packages
|
|
81
|
+
- run: npx nx-cloud record -- npx nx format:check
|
|
82
|
+
|
|
83
|
+
build:
|
|
84
|
+
<<: *setup_env_node
|
|
85
|
+
steps:
|
|
86
|
+
- checkout
|
|
87
|
+
- node/install-packages: *install_packages
|
|
88
|
+
- nx/set-shas: *nx_set_shas_option
|
|
89
|
+
- run: npx nx run-many -t build
|
|
90
|
+
- persist_to_workspace:
|
|
91
|
+
root: '.'
|
|
92
|
+
paths:
|
|
93
|
+
- dist
|
|
94
|
+
- apps/*/dist
|
|
95
|
+
- packages/*/dist
|
|
96
|
+
- libs/*/dist
|
|
97
|
+
|
|
98
|
+
docker-build:
|
|
99
|
+
<<: *setup_env_machine
|
|
100
|
+
resource_class: large
|
|
101
|
+
<% if (parallelizeDockerBuilds > 0) { -%>
|
|
102
|
+
parallelism: <%= parallelizeDockerBuilds %>
|
|
103
|
+
<% } -%>
|
|
104
|
+
steps:
|
|
105
|
+
- checkout
|
|
106
|
+
- attach_workspace: *attach_workspace
|
|
107
|
+
- node/install:
|
|
108
|
+
install-yarn: true
|
|
109
|
+
- node/install-packages: *install_packages
|
|
110
|
+
- nx/set-shas: *nx_set_shas_option
|
|
111
|
+
- aws-cli/setup:
|
|
112
|
+
role_arn: ${PUBLISH_ROLE_ARN}
|
|
113
|
+
profile_name: 'OIDC-PROFILE'
|
|
114
|
+
- run:
|
|
115
|
+
name: docker-build
|
|
116
|
+
<% if (parallelizeDockerBuilds > 0) { -%>
|
|
117
|
+
command: |
|
|
118
|
+
PROJECT_WITH_DOCKER=$(npx nx show projects --affected --base=$NX_BASE --head=$NX_HEAD --with-target=docker-build)
|
|
119
|
+
if [ -n "$PROJECT_WITH_DOCKER" ]; then
|
|
120
|
+
echo "$PROJECT_WITH_DOCKER" | circleci tests run --command='xargs -I {} bash -c "npx nx run-many -t docker-build --parallel=3 -p {} --buildArgs=\"NODE_VERSION=<< pipeline.parameters.node_version >>\""'
|
|
121
|
+
else
|
|
122
|
+
echo "No affected project, nothing to do"
|
|
123
|
+
circleci-agent step halt
|
|
124
|
+
fi
|
|
125
|
+
<% } else { -%>
|
|
126
|
+
command: npx nx affected -t docker-build --buildArgs=\"NODE_VERSION=<< pipeline.parameters.node_version >>\"
|
|
127
|
+
<% } %>
|
|
128
|
+
|
|
129
|
+
test:
|
|
130
|
+
<<: *setup_env_node
|
|
131
|
+
resource_class: large
|
|
132
|
+
steps:
|
|
133
|
+
- checkout
|
|
134
|
+
- node/install-packages: *install_packages
|
|
135
|
+
- nx/set-shas: *nx_set_shas_option
|
|
136
|
+
- run: npx nx affected -t test
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
publish:
|
|
140
|
+
<<: *setup_env_machine
|
|
141
|
+
steps:
|
|
142
|
+
- checkout
|
|
143
|
+
- attach_workspace: *attach_workspace
|
|
144
|
+
- node/install:
|
|
145
|
+
install-yarn: true
|
|
146
|
+
- node/install-packages: *install_packages
|
|
147
|
+
- nx/set-shas: *nx_set_shas_option
|
|
148
|
+
- aws-cli/setup:
|
|
149
|
+
role_arn: ${PUBLISH_ROLE_ARN}
|
|
150
|
+
profile_name: 'OIDC-PROFILE'
|
|
151
|
+
- run:
|
|
152
|
+
name: 'Install Helm 3'
|
|
153
|
+
command: |
|
|
154
|
+
curl -sSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
|
|
155
|
+
- run:
|
|
156
|
+
name: 'Install Tsh'
|
|
157
|
+
command: |
|
|
158
|
+
curl -LsSO https://cdn.teleport.dev/teleport-${TELEPORT_VERSION}-linux-amd64-bin.tar.gz
|
|
159
|
+
tar -xzf teleport-${TELEPORT_VERSION}-linux-amd64-bin.tar.gz
|
|
160
|
+
cd teleport
|
|
161
|
+
sudo ./install
|
|
162
|
+
cd ../
|
|
163
|
+
rm -rf teleport
|
|
164
|
+
- run:
|
|
165
|
+
name: 'Install Oras'
|
|
166
|
+
command: |
|
|
167
|
+
curl -LO "https://github.com/oras-project/oras/releases/download/v${ORAS_VERSION}/oras_${ORAS_VERSION}_linux_amd64.tar.gz"
|
|
168
|
+
mkdir -p oras-install/
|
|
169
|
+
tar -zxf oras_${ORAS_VERSION}_*.tar.gz -C oras-install/
|
|
170
|
+
sudo mv oras-install/oras /usr/local/bin/
|
|
171
|
+
rm -rf oras_${ORAS_VERSION}_*.tar.gz oras-install/
|
|
172
|
+
- run:
|
|
173
|
+
name: Release
|
|
174
|
+
command: |
|
|
175
|
+
export GITHUB_TOKEN="$(cat github_token)"
|
|
176
|
+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/PayFit/${CIRCLE_PROJECT_REPONAME}.git
|
|
177
|
+
npx nx run <%= packageJsonName %>:release
|
|
178
|
+
|
|
179
|
+
<% if (keepContinuationJobs) { %>
|
|
180
|
+
affected-merge-continuation:
|
|
181
|
+
<<: *setup_env_node
|
|
182
|
+
steps:
|
|
183
|
+
- checkout
|
|
184
|
+
- node/install-packages: *install_packages
|
|
185
|
+
- nx/set-shas: *nx_set_shas_option
|
|
186
|
+
- payfit-nx/affected-apps:
|
|
187
|
+
output-file: affected-list.txt
|
|
188
|
+
main-branch-name: main
|
|
189
|
+
allow-on-hold-workflow: true
|
|
190
|
+
nx-ci-execution-id: $CIRCLE_WORKFLOW_ID
|
|
191
|
+
projects-to-exclude: '<%= packageJsonName %>'
|
|
192
|
+
- payfit-nx/merge-circle-config:
|
|
193
|
+
shared-config-file: .circleci/shared-config.yml
|
|
194
|
+
affected-list-file: affected-list.txt
|
|
195
|
+
config-output: .circleci/continue-config.yml
|
|
196
|
+
- run:
|
|
197
|
+
name: skip if no continuous workflow to run
|
|
198
|
+
command: |
|
|
199
|
+
if [[ $(yq '. | has("workflows")' .circleci/continue-config.yml) != true ]]
|
|
200
|
+
then
|
|
201
|
+
echo "no continuous workflow to run, stopping"
|
|
202
|
+
circleci-agent step halt
|
|
203
|
+
fi
|
|
204
|
+
- run:
|
|
205
|
+
name: Setup parameters
|
|
206
|
+
command: |
|
|
207
|
+
echo "{\"workflow-id\": \"$CIRCLE_WORKFLOW_ID\"}" > parameters.json
|
|
208
|
+
- continuation/continue:
|
|
209
|
+
configuration_path: .circleci/continue-config.yml
|
|
210
|
+
parameters: parameters.json
|
|
211
|
+
<% } %>
|
|
212
|
+
|
|
213
|
+
workflows:
|
|
214
|
+
build-test-deploy:
|
|
215
|
+
jobs:
|
|
216
|
+
- github/auth:
|
|
217
|
+
outputFile: github_token
|
|
218
|
+
name: github_authenticate
|
|
219
|
+
context:
|
|
220
|
+
- NX_COMMON_PACKAGES # TSH config / AWS credentials / NPM token
|
|
221
|
+
- install_packages:
|
|
222
|
+
context: NX_COMMON_PACKAGES # TSH config / AWS credentials / NPM token
|
|
223
|
+
|
|
224
|
+
- lint:
|
|
225
|
+
context: NX_COMMON_PACKAGES # TSH config / AWS credentials / NPM token
|
|
226
|
+
requires:
|
|
227
|
+
- install_packages
|
|
228
|
+
|
|
229
|
+
- nx-sync:
|
|
230
|
+
context: NX_COMMON_PACKAGES # TSH config / AWS credentials / NPM token
|
|
231
|
+
requires:
|
|
232
|
+
- install_packages
|
|
233
|
+
|
|
234
|
+
- format:
|
|
235
|
+
context: NX_COMMON_PACKAGES # TSH config / AWS credentials / NPM token
|
|
236
|
+
requires:
|
|
237
|
+
- install_packages
|
|
238
|
+
|
|
239
|
+
- nx-conformance:
|
|
240
|
+
context: NX_COMMON_PACKAGES # TSH config / AWS credentials / NPM token
|
|
241
|
+
requires:
|
|
242
|
+
- install_packages
|
|
243
|
+
|
|
244
|
+
- build:
|
|
245
|
+
context: NX_COMMON_PACKAGES # TSH config / AWS credentials / NPM token
|
|
246
|
+
requires:
|
|
247
|
+
- install_packages
|
|
248
|
+
|
|
249
|
+
- docker-build:
|
|
250
|
+
context: NX_COMMON_PACKAGES # TSH config / AWS credentials / NPM token
|
|
251
|
+
requires:
|
|
252
|
+
- install_packages
|
|
253
|
+
- build
|
|
254
|
+
|
|
255
|
+
- test:
|
|
256
|
+
context: NX_COMMON_PACKAGES # TSH config / AWS credentials / NPM token
|
|
257
|
+
requires:
|
|
258
|
+
- install_packages
|
|
259
|
+
|
|
260
|
+
<%_ if (edpJobs) { -%>
|
|
261
|
+
<%- edpJobs.replace(/^/gm, ' ') %>
|
|
262
|
+
<%_ } -%>
|
|
263
|
+
|
|
264
|
+
- publish:
|
|
265
|
+
name: Publish
|
|
266
|
+
requires:
|
|
267
|
+
- github_authenticate
|
|
268
|
+
- test
|
|
269
|
+
- docker-build
|
|
270
|
+
- nx-conformance
|
|
271
|
+
context:
|
|
272
|
+
- NX_COMMON_PACKAGES # TSH config / AWS credentials / NPM token
|
|
273
|
+
|
|
274
|
+
<% if (keepContinuationJobs) { %>
|
|
275
|
+
- affected-merge-continuation:
|
|
276
|
+
requires:
|
|
277
|
+
- build
|
|
278
|
+
- test
|
|
279
|
+
context:
|
|
280
|
+
- NX_COMMON_PACKAGES # TSH config / AWS credentials / NPM token
|
|
281
|
+
filters: *only_main_and_deploy_branches
|
|
282
|
+
<% } %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
|
package/dist/src/generators/local-lambda-setup/files/scripts/invoke_lambda_local.sh.template
CHANGED
|
File without changes
|