codefresh 0.78.4 → 0.79.1
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/.dockerignore +1 -0
- package/Dockerfile +3 -4
- package/check-version.js +1 -1
- package/codefresh-release.yml +268 -61
- package/codefresh.yml +64 -20
- package/e2e/README.md +10 -0
- package/e2e/data/crud.pip.yaml +23 -0
- package/e2e/data/test-run.pip.yaml +23 -0
- package/e2e/e2e.spec.sh +25 -0
- package/e2e/helpers.sh +10 -0
- package/e2e/scenarios/agents.sh +1 -0
- package/e2e/scenarios/annotations.sh +2 -0
- package/e2e/scenarios/boards.sh +3 -0
- package/e2e/scenarios/builds.sh +1 -0
- package/e2e/scenarios/clusters.sh +1 -0
- package/e2e/scenarios/compositions.sh +1 -0
- package/e2e/scenarios/contexts.sh +1 -0
- package/e2e/scenarios/environments.sh +1 -0
- package/e2e/scenarios/helm-repo.sh +1 -0
- package/e2e/scenarios/images.sh +1 -0
- package/e2e/scenarios/pipeline-run.sh +26 -0
- package/e2e/scenarios/pipelines.sh +31 -0
- package/e2e/scenarios/projects.sh +17 -0
- package/e2e/scenarios/registry.sh +1 -0
- package/e2e/scenarios/repository.sh +2 -0
- package/e2e/scenarios/runtime-environment.sh +1 -0
- package/e2e/scenarios/step-types.sh +1 -0
- package/e2e/scenarios/system-runtime-environments.sh +1 -0
- package/e2e/scenarios/teams.sh +1 -0
- package/e2e/scenarios/tokens.sh +1 -0
- package/e2e/scenarios/triggers.sh +3 -0
- package/lib/interface/cli/commands/workflow/logs.cmd.js +6 -1
- package/lib/interface/cli/completion/completion.spec.js +18 -15
- package/lib/interface/cli/completion/tree.json +1 -1
- package/lib/interface/cli/helpers/helpers.sdk.spec.js +0 -9
- package/lib/interface/cli/helpers/logs.js +2 -12
- package/lib/logic/cli-config/Manager.js +4 -5
- package/lib/logic/cli-config/Model.js +4 -5
- package/lib/logic/cli-config/manager.spec.js +10 -13
- package/lib/logic/entities/Agent.js +1 -3
- package/lib/logic/entities/CodefreshRepo.js +1 -1
- package/lib/logic/entities/Entity.js +1 -0
- package/lib/logic/entities/Environment.js +1 -0
- package/lib/logic/entities/GitRepo.js +1 -1
- package/lib/logic/entities/HelmRepo.js +1 -2
- package/lib/logic/entities/Pipeline.js +1 -1
- package/lib/logic/entities/RuntimeEnvironments.js +1 -1
- package/lib/logic/entities/StepType.js +2 -2
- package/lib/logic/entities/StepTypeVersion.js +0 -1
- package/lib/logic/entities/Team.js +2 -2
- package/lib/logic/entities/Token.js +2 -2
- package/lib/logic/entities/Workflow.js +1 -1
- package/lib/logic/index.js +0 -2
- package/package.json +32 -20
- package/yarn.lock +1507 -891
package/.dockerignore
CHANGED
package/Dockerfile
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# go hub binary
|
|
2
2
|
FROM golang:alpine as go
|
|
3
3
|
RUN apk --update add ca-certificates git
|
|
4
|
-
RUN go
|
|
4
|
+
RUN go install github.com/github/hub@latest
|
|
5
5
|
|
|
6
6
|
# python yq binary
|
|
7
7
|
FROM six8/pyinstaller-alpine:alpine-3.6-pyinstaller-v3.4 as yq
|
|
@@ -11,9 +11,9 @@ RUN pip install yq==${YQ_VERSION}
|
|
|
11
11
|
RUN pyinstaller --noconfirm --onefile --log-level DEBUG --clean --distpath /tmp/ $(which yq)
|
|
12
12
|
|
|
13
13
|
# Main
|
|
14
|
-
FROM node:
|
|
14
|
+
FROM node:12.22.12-alpine3.15
|
|
15
15
|
|
|
16
|
-
RUN apk --update add --no-cache ca-certificates git curl bash
|
|
16
|
+
RUN apk --update add --no-cache ca-certificates git curl bash jq
|
|
17
17
|
|
|
18
18
|
COPY --from=go /go/bin/hub /usr/local/bin/hub
|
|
19
19
|
COPY --from=yq /tmp/yq /usr/local/bin/yq
|
|
@@ -31,7 +31,6 @@ RUN yarn install --prod --frozen-lockfile && \
|
|
|
31
31
|
COPY . /cf-cli
|
|
32
32
|
|
|
33
33
|
RUN yarn generate-completion
|
|
34
|
-
RUN apk del yarn
|
|
35
34
|
|
|
36
35
|
RUN ln -s $(pwd)/lib/interface/cli/codefresh /usr/local/bin/codefresh
|
|
37
36
|
|
package/check-version.js
CHANGED
package/codefresh-release.yml
CHANGED
|
@@ -1,35 +1,79 @@
|
|
|
1
1
|
# this pipeline should only be executed on master branch
|
|
2
2
|
version: '1.0'
|
|
3
|
-
|
|
3
|
+
mode: parallel
|
|
4
|
+
stages:
|
|
5
|
+
- prepare
|
|
6
|
+
- docker
|
|
7
|
+
- build
|
|
8
|
+
- github
|
|
9
|
+
- packages
|
|
10
|
+
- documentation
|
|
4
11
|
steps:
|
|
12
|
+
fail_if_not_master:
|
|
13
|
+
stage: prepare
|
|
14
|
+
title: "Validate running on master branch"
|
|
15
|
+
image: codefresh/build-cli
|
|
16
|
+
commands:
|
|
17
|
+
- >-
|
|
18
|
+
if [ "${{CF_BRANCH}}" != "master" ]; then
|
|
19
|
+
echo This pipeline should be run only on master
|
|
20
|
+
exit 1
|
|
21
|
+
fi
|
|
5
22
|
|
|
6
23
|
main_clone:
|
|
24
|
+
stage: prepare
|
|
7
25
|
title: 'Cloning main repository...'
|
|
8
26
|
type: git-clone
|
|
9
27
|
repo: codefresh-io/cli
|
|
10
28
|
revision: ${{CF_BRANCH}}
|
|
11
29
|
git: cf_github
|
|
12
|
-
|
|
13
|
-
fail_if_not_master:
|
|
14
|
-
title: "Validate running on master branch"
|
|
15
|
-
image: codefresh/build-cli
|
|
16
|
-
commands:
|
|
17
|
-
- 'echo This pipeline should be run only on master'
|
|
18
|
-
- 'exit 1'
|
|
19
30
|
when:
|
|
20
|
-
|
|
21
|
-
|
|
31
|
+
steps:
|
|
32
|
+
- name: fail_if_not_master
|
|
33
|
+
on:
|
|
34
|
+
- success
|
|
22
35
|
|
|
23
36
|
extract_version:
|
|
37
|
+
stage: prepare
|
|
24
38
|
title: "Exporting package.json version"
|
|
25
39
|
image: codefresh/build-cli
|
|
26
40
|
commands:
|
|
27
41
|
- 'export PACKAGE_VERSION=$(jq -r ".version" package.json)'
|
|
28
42
|
- "echo Current version: $PACKAGE_VERSION"
|
|
29
43
|
- "cf_export PACKAGE_VERSION"
|
|
44
|
+
when:
|
|
45
|
+
steps:
|
|
46
|
+
- name: main_clone
|
|
47
|
+
on:
|
|
48
|
+
- success
|
|
49
|
+
|
|
50
|
+
install:
|
|
51
|
+
stage: prepare
|
|
52
|
+
title: "Installing dependencies"
|
|
53
|
+
image: codefresh/build-cli
|
|
54
|
+
commands:
|
|
55
|
+
- "yarn install"
|
|
56
|
+
when:
|
|
57
|
+
steps:
|
|
58
|
+
- name: main_clone
|
|
59
|
+
on:
|
|
60
|
+
- success
|
|
61
|
+
|
|
62
|
+
generate_comletion:
|
|
63
|
+
stage: prepare
|
|
64
|
+
title: "Generating commands completion tree"
|
|
65
|
+
image: codefresh/build-cli
|
|
66
|
+
commands:
|
|
67
|
+
- "yarn generate-completion"
|
|
68
|
+
when:
|
|
69
|
+
steps:
|
|
70
|
+
- name: install
|
|
71
|
+
on:
|
|
72
|
+
- success
|
|
30
73
|
|
|
31
|
-
# in case the candidate image will not be found the release flow will crash and this means that the build pipelines has failed
|
|
74
|
+
# in case the candidate image will not be found the release flow will crash and this means that the build pipelines has failed
|
|
32
75
|
push_step:
|
|
76
|
+
stage: docker
|
|
33
77
|
type: push
|
|
34
78
|
title: "Push release image"
|
|
35
79
|
image_name: codefresh/cli
|
|
@@ -48,8 +92,14 @@ steps:
|
|
|
48
92
|
registry: cf-quay
|
|
49
93
|
title: "push to quay.io"
|
|
50
94
|
candidate: quay.io/codefresh/cli:${{CF_SHORT_REVISION}}
|
|
95
|
+
when:
|
|
96
|
+
steps:
|
|
97
|
+
- name: extract_version
|
|
98
|
+
on:
|
|
99
|
+
- success
|
|
51
100
|
|
|
52
101
|
create_manifest_list:
|
|
102
|
+
stage: docker
|
|
53
103
|
type: "codefresh-inc/multiarch-manifester"
|
|
54
104
|
arguments:
|
|
55
105
|
image_name: codefresh/cli
|
|
@@ -72,36 +122,107 @@ steps:
|
|
|
72
122
|
tags:
|
|
73
123
|
- ${{PACKAGE_VERSION}}
|
|
74
124
|
- latest
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
- "yarn install"
|
|
81
|
-
- "yarn generate-completion"
|
|
82
|
-
|
|
83
|
-
deploy_to_npm:
|
|
84
|
-
title: "Publishing To Npm"
|
|
85
|
-
type: npm-publish
|
|
86
|
-
arguments:
|
|
87
|
-
NPM_TOKEN: '${{NPM_TOKEN}}'
|
|
88
|
-
DIR: ./cli
|
|
125
|
+
when:
|
|
126
|
+
steps:
|
|
127
|
+
- name: push_step
|
|
128
|
+
on:
|
|
129
|
+
- success
|
|
89
130
|
|
|
90
131
|
compile_executables:
|
|
132
|
+
stage: build
|
|
91
133
|
title: "Compiling executables"
|
|
92
134
|
image: codefresh/build-cli
|
|
93
135
|
commands:
|
|
94
136
|
- "rm -rf dist"
|
|
95
137
|
- "yarn pkg"
|
|
138
|
+
when:
|
|
139
|
+
steps:
|
|
140
|
+
- name: generate_comletion
|
|
141
|
+
on:
|
|
142
|
+
- success
|
|
143
|
+
|
|
144
|
+
archive_linux:
|
|
145
|
+
stage: build
|
|
146
|
+
title: "Archiving linux distribution"
|
|
147
|
+
image: codefresh/build-cli
|
|
148
|
+
commands:
|
|
149
|
+
- "rm -rf ./dist/linux"
|
|
150
|
+
- "mkdir -p ./dist/linux"
|
|
151
|
+
- "cp --force README.md LICENSE ./dist/linux"
|
|
152
|
+
- "cp --force ./dist/codefresh-linux ./dist/linux/codefresh"
|
|
153
|
+
- "tar -cf codefresh-v${{PACKAGE_VERSION}}-linux-x64.tar README.md LICENSE -C ./dist/linux codefresh"
|
|
154
|
+
- "gzip -f codefresh-v${{PACKAGE_VERSION}}-linux-x64.tar"
|
|
155
|
+
when:
|
|
156
|
+
steps:
|
|
157
|
+
- name: compile_executables
|
|
158
|
+
on:
|
|
159
|
+
- success
|
|
160
|
+
|
|
161
|
+
archive_macos:
|
|
162
|
+
stage: build
|
|
163
|
+
title: "Archiving macos distribution"
|
|
164
|
+
image: codefresh/build-cli
|
|
165
|
+
commands:
|
|
166
|
+
- "rm -rf ./dist/macos"
|
|
167
|
+
- "mkdir -p ./dist/macos"
|
|
168
|
+
- "cp --force README.md LICENSE ./dist/macos"
|
|
169
|
+
- "cp --force ./dist/codefresh-macos ./dist/macos/codefresh"
|
|
170
|
+
- "tar -cf codefresh-v${{PACKAGE_VERSION}}-macos-x64.tar README.md LICENSE -C ./dist/macos codefresh"
|
|
171
|
+
- "gzip -f codefresh-v${{PACKAGE_VERSION}}-macos-x64.tar"
|
|
172
|
+
when:
|
|
173
|
+
steps:
|
|
174
|
+
- name: compile_executables
|
|
175
|
+
on:
|
|
176
|
+
- success
|
|
177
|
+
|
|
178
|
+
archive_win:
|
|
179
|
+
stage: build
|
|
180
|
+
title: "Archiving win distribution"
|
|
181
|
+
image: codefresh/build-cli
|
|
182
|
+
commands:
|
|
183
|
+
- "rm -rf ./dist/win"
|
|
184
|
+
- "mkdir -p ./dist/win"
|
|
185
|
+
- "cp --force README.md LICENSE ./dist/win"
|
|
186
|
+
- "cp --force ./dist/codefresh-win.exe ./dist/win/codefresh.exe"
|
|
187
|
+
- "zip codefresh-v${{PACKAGE_VERSION}}-win-x64.zip README.md LICENSE -j ./dist/win/codefresh.exe "
|
|
188
|
+
when:
|
|
189
|
+
steps:
|
|
190
|
+
- name: compile_executables
|
|
191
|
+
on:
|
|
192
|
+
- success
|
|
193
|
+
|
|
194
|
+
archive_alpine:
|
|
195
|
+
stage: build
|
|
196
|
+
title: "Archiving macos distribution"
|
|
197
|
+
image: codefresh/build-cli
|
|
198
|
+
commands:
|
|
199
|
+
- "rm -rf ./dist/alpine"
|
|
200
|
+
- "mkdir -p ./dist/alpine"
|
|
201
|
+
- "cp --force README.md LICENSE ./dist/alpine"
|
|
202
|
+
- "cp --force ./dist/codefresh-alpine ./dist/alpine/codefresh"
|
|
203
|
+
- "tar -cf codefresh-v${{PACKAGE_VERSION}}-alpine-x64.tar README.md LICENSE -C ./dist/alpine codefresh"
|
|
204
|
+
- "gzip -f codefresh-v${{PACKAGE_VERSION}}-alpine-x64.tar"
|
|
205
|
+
when:
|
|
206
|
+
steps:
|
|
207
|
+
- name: compile_executables
|
|
208
|
+
on:
|
|
209
|
+
- success
|
|
96
210
|
|
|
97
211
|
create_release:
|
|
212
|
+
stage: github
|
|
98
213
|
title: "Create github release"
|
|
99
214
|
image: codefresh/build-cli
|
|
100
215
|
fail_fast: false
|
|
101
216
|
commands:
|
|
102
217
|
- 'curl --fail -X POST -d ''{"tag_name":"v${{PACKAGE_VERSION}}","target_commitish":"${{CF_REVISION}}","name":"Codefresh V${{PACKAGE_VERSION}}"}'' -H "Content-Type: application/json" -H "Authorization: token ${{GITHUB_TOKEN}}" https://api.github.com/repos/codefresh-io/cli/releases'
|
|
218
|
+
when:
|
|
219
|
+
steps:
|
|
220
|
+
- name: compile_executables
|
|
221
|
+
on:
|
|
222
|
+
- success
|
|
103
223
|
|
|
104
224
|
get_release:
|
|
225
|
+
stage: github
|
|
105
226
|
title: "Get github release"
|
|
106
227
|
image: codefresh/build-cli
|
|
107
228
|
commands:
|
|
@@ -109,52 +230,93 @@ steps:
|
|
|
109
230
|
- "export GITHUB_RELEASE_ID=$(curl --fail https://api.github.com/repos/codefresh-io/cli/releases/tags/v${{PACKAGE_VERSION}} | jq -r '.id')"
|
|
110
231
|
- "echo Github release id: $GITHUB_RELEASE_ID"
|
|
111
232
|
- "cf_export GITHUB_RELEASE_ID"
|
|
233
|
+
when:
|
|
234
|
+
steps:
|
|
235
|
+
- name: create_release
|
|
236
|
+
on:
|
|
237
|
+
- success
|
|
238
|
+
- failure
|
|
112
239
|
|
|
113
|
-
|
|
114
|
-
|
|
240
|
+
upload_linux:
|
|
241
|
+
stage: github
|
|
242
|
+
title: "Upload linux executable to github release"
|
|
115
243
|
image: codefresh/build-cli
|
|
116
244
|
commands:
|
|
117
|
-
#
|
|
118
|
-
- "rm -rf *.gz"
|
|
119
|
-
- "rm -rf *.zip"
|
|
120
|
-
- "cp README.md LICENSE ./dist --force"
|
|
121
|
-
# upload linux-x64 asset
|
|
122
|
-
- "mv ./dist/codefresh-linux ./dist/codefresh"
|
|
123
|
-
- "tar -cf codefresh-v${{PACKAGE_VERSION}}-linux-x64.tar README.md LICENSE -C ./dist ./codefresh "
|
|
124
|
-
- "gzip codefresh-v${{PACKAGE_VERSION}}-linux-x64.tar"
|
|
245
|
+
# upload linux-x64 asset
|
|
125
246
|
- 'curl --fail -X POST -H "Content-Type:application/octet-stream" -H "Authorization: token ${{GITHUB_TOKEN}}" --data-binary @codefresh-v${{PACKAGE_VERSION}}-linux-x64.tar.gz https://uploads.github.com/repos/codefresh-io/cli/releases/${{GITHUB_RELEASE_ID}}/assets?name=codefresh-v${{PACKAGE_VERSION}}-linux-x64.tar.gz'
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
247
|
+
when:
|
|
248
|
+
steps:
|
|
249
|
+
- name: get_release
|
|
250
|
+
on:
|
|
251
|
+
- success
|
|
252
|
+
- name: archive_linux
|
|
253
|
+
on:
|
|
254
|
+
- success
|
|
255
|
+
|
|
256
|
+
upload_macos:
|
|
257
|
+
stage: github
|
|
258
|
+
title: "Upload macos executable to github release"
|
|
259
|
+
image: codefresh/build-cli
|
|
260
|
+
commands:
|
|
261
|
+
# upload macos-x64 asset
|
|
130
262
|
- 'curl --fail -X POST -H "Content-Type:application/octet-stream" -H "Authorization: token ${{GITHUB_TOKEN}}" --data-binary @codefresh-v${{PACKAGE_VERSION}}-macos-x64.tar.gz https://uploads.github.com/repos/codefresh-io/cli/releases/${{GITHUB_RELEASE_ID}}/assets?name=codefresh-v${{PACKAGE_VERSION}}-macos-x64.tar.gz'
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
263
|
+
when:
|
|
264
|
+
steps:
|
|
265
|
+
- name: get_release
|
|
266
|
+
on:
|
|
267
|
+
- success
|
|
268
|
+
- name: archive_macos
|
|
269
|
+
on:
|
|
270
|
+
- success
|
|
271
|
+
|
|
272
|
+
upload_win:
|
|
273
|
+
stage: github
|
|
274
|
+
title: "Upload win executable to github release"
|
|
275
|
+
image: codefresh/build-cli
|
|
276
|
+
commands:
|
|
277
|
+
# upload win-x64 asset
|
|
134
278
|
- 'curl --fail -X POST -H "Content-Type:application/octet-stream" -H "Authorization: token ${{GITHUB_TOKEN}}" --data-binary @codefresh-v${{PACKAGE_VERSION}}-win-x64.zip https://uploads.github.com/repos/codefresh-io/cli/releases/${{GITHUB_RELEASE_ID}}/assets?name=codefresh-v${{PACKAGE_VERSION}}-win-x64.zip'
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
279
|
+
when:
|
|
280
|
+
steps:
|
|
281
|
+
- name: get_release
|
|
282
|
+
on:
|
|
283
|
+
- success
|
|
284
|
+
- name: archive_win
|
|
285
|
+
on:
|
|
286
|
+
- success
|
|
140
287
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
288
|
+
upload_alpine:
|
|
289
|
+
stage: github
|
|
290
|
+
title: "Upload alpine executable to github release"
|
|
291
|
+
image: codefresh/build-cli
|
|
144
292
|
commands:
|
|
145
|
-
|
|
146
|
-
- "
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
293
|
+
# upload alpine-x64 asset
|
|
294
|
+
- 'curl --fail -X POST -H "Content-Type:application/octet-stream" -H "Authorization: token ${{GITHUB_TOKEN}}" --data-binary @codefresh-v${{PACKAGE_VERSION}}-alpine-x64.tar.gz https://uploads.github.com/repos/codefresh-io/cli/releases/${{GITHUB_RELEASE_ID}}/assets?name=codefresh-v${{PACKAGE_VERSION}}-alpine-x64.tar.gz'
|
|
295
|
+
when:
|
|
296
|
+
steps:
|
|
297
|
+
- name: get_release
|
|
298
|
+
on:
|
|
299
|
+
- success
|
|
300
|
+
- name: archive_alpine
|
|
301
|
+
on:
|
|
302
|
+
- success
|
|
303
|
+
|
|
304
|
+
deploy_to_npm:
|
|
305
|
+
stage: packages
|
|
306
|
+
title: "Publishing To Npm"
|
|
307
|
+
type: npm-publish
|
|
308
|
+
arguments:
|
|
309
|
+
NPM_TOKEN: '${{NPM_TOKEN}}'
|
|
310
|
+
DIR: ./cli
|
|
311
|
+
when:
|
|
312
|
+
steps:
|
|
313
|
+
- name: generate_comletion
|
|
314
|
+
on:
|
|
315
|
+
- success
|
|
316
|
+
|
|
156
317
|
|
|
157
318
|
update_brew_formula:
|
|
319
|
+
stage: packages
|
|
158
320
|
title: "Updating homebrew formula"
|
|
159
321
|
image: codefresh/build-cli
|
|
160
322
|
commands:
|
|
@@ -171,3 +333,48 @@ steps:
|
|
|
171
333
|
\"content\": \"$(openssl base64 -A -in codefresh.rb)\", \
|
|
172
334
|
\"sha\": $(curl -X GET https://api.github.com/repos/codefresh-io/homebrew-cli/contents/Formula/codefresh.rb | jq .sha) \
|
|
173
335
|
}" https://api.github.com/repos/codefresh-io/homebrew-cli/contents/Formula/codefresh.rb
|
|
336
|
+
when:
|
|
337
|
+
steps:
|
|
338
|
+
- name: upload_macos
|
|
339
|
+
on:
|
|
340
|
+
- success
|
|
341
|
+
|
|
342
|
+
update_documentation:
|
|
343
|
+
stage: documentation
|
|
344
|
+
title: "Update documentation http://cli.codefresh.io"
|
|
345
|
+
image: docker:18.01
|
|
346
|
+
commands:
|
|
347
|
+
- "apk update && apk add git nodejs"
|
|
348
|
+
- "npm install"
|
|
349
|
+
- "echo cleaning previous public dir and recreating worktree"
|
|
350
|
+
- "rm -rf public && git worktree prune && git worktree add -B gh-pages public origin/gh-pages"
|
|
351
|
+
- "echo Building public docs"
|
|
352
|
+
- "npm run build-public-docs"
|
|
353
|
+
- "echo Push new docs to gh-pages detached branch"
|
|
354
|
+
- 'git config --global user.email "auto-ci@codefresh.io" && git config --global user.name "Automated CI"'
|
|
355
|
+
- 'cd public && git add --all && git commit -m "Publish new documentation for version ${{PACKAGE_VERSION}}" && git push https://${{GITHUB_TOKEN}}@github.com/codefresh-io/cli.git'
|
|
356
|
+
environment:
|
|
357
|
+
- HUGO_VERSION=0.32.0
|
|
358
|
+
when:
|
|
359
|
+
steps:
|
|
360
|
+
- name: upload_linux
|
|
361
|
+
on:
|
|
362
|
+
- success
|
|
363
|
+
- name: upload_macos
|
|
364
|
+
on:
|
|
365
|
+
- success
|
|
366
|
+
- name: upload_win
|
|
367
|
+
on:
|
|
368
|
+
- success
|
|
369
|
+
- name: upload_alpine
|
|
370
|
+
on:
|
|
371
|
+
- success
|
|
372
|
+
- name: update_brew_formula
|
|
373
|
+
on:
|
|
374
|
+
- success
|
|
375
|
+
- name: deploy_to_npm
|
|
376
|
+
on:
|
|
377
|
+
- success
|
|
378
|
+
- name: create_manifest_list
|
|
379
|
+
on:
|
|
380
|
+
- success
|
package/codefresh.yml
CHANGED
|
@@ -10,24 +10,6 @@ steps:
|
|
|
10
10
|
revision: ${{CF_BRANCH}}
|
|
11
11
|
git: cf_github
|
|
12
12
|
|
|
13
|
-
install_dependencies:
|
|
14
|
-
title: 'Installing testing dependencies'
|
|
15
|
-
image: codefresh/node-tester-image:10.15.3
|
|
16
|
-
commands:
|
|
17
|
-
- yarn install --frozen-lockfile
|
|
18
|
-
|
|
19
|
-
eslint:
|
|
20
|
-
title: 'Running linting logic'
|
|
21
|
-
image: codefresh/node-tester-image:10.15.3
|
|
22
|
-
commands:
|
|
23
|
-
- yarn eslint
|
|
24
|
-
|
|
25
|
-
unit-tests:
|
|
26
|
-
title: 'Running unit tests'
|
|
27
|
-
image: codefresh/node-tester-image:10.15.3
|
|
28
|
-
commands:
|
|
29
|
-
- yarn test
|
|
30
|
-
|
|
31
13
|
extract_version:
|
|
32
14
|
title: "Exporting package.json version"
|
|
33
15
|
image: codefresh/build-cli
|
|
@@ -36,6 +18,57 @@ steps:
|
|
|
36
18
|
- "echo Current version: $PACKAGE_VERSION"
|
|
37
19
|
- "cf_export PACKAGE_VERSION"
|
|
38
20
|
|
|
21
|
+
check_version:
|
|
22
|
+
title: 'Checking if version already exists'
|
|
23
|
+
image: codefresh/build-cli
|
|
24
|
+
fail_fast: false
|
|
25
|
+
commands:
|
|
26
|
+
- >-
|
|
27
|
+
RELEASE_ID="$(curl -s https://api.github.com/repos/codefresh-io/cli/releases/tags/v${{PACKAGE_VERSION}} | jq .id)"
|
|
28
|
+
echo "Release id: $RELEASE_ID"
|
|
29
|
+
|
|
30
|
+
if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = 'null' ]; then
|
|
31
|
+
echo "Version is ok: ${{PACKAGE_VERSION}}"
|
|
32
|
+
else
|
|
33
|
+
echo "Release already exists ${{PACKAGE_VERSION}}"
|
|
34
|
+
exit 1
|
|
35
|
+
fi
|
|
36
|
+
when:
|
|
37
|
+
condition:
|
|
38
|
+
all:
|
|
39
|
+
skipVersionCheck: '"${{SKIP_VERSION_CHECK}}" != "true"'
|
|
40
|
+
|
|
41
|
+
install_dependencies:
|
|
42
|
+
title: 'Installing testing dependencies'
|
|
43
|
+
image: codefresh/build-cli
|
|
44
|
+
commands:
|
|
45
|
+
- yarn install --frozen-lockfile
|
|
46
|
+
|
|
47
|
+
parallel_tests:
|
|
48
|
+
type: parallel
|
|
49
|
+
steps:
|
|
50
|
+
eslint:
|
|
51
|
+
title: 'Running linting logic'
|
|
52
|
+
image: codefresh/build-cli
|
|
53
|
+
commands:
|
|
54
|
+
- yarn eslint
|
|
55
|
+
|
|
56
|
+
unit_tests:
|
|
57
|
+
title: 'Running unit tests'
|
|
58
|
+
image: codefresh/build-cli
|
|
59
|
+
commands:
|
|
60
|
+
- yarn test
|
|
61
|
+
|
|
62
|
+
e2e_tests:
|
|
63
|
+
title: 'Running e2e tests'
|
|
64
|
+
image: codefresh/build-cli
|
|
65
|
+
commands:
|
|
66
|
+
- "echo Running e2e on account: ${{CF_ACCOUNT}}"
|
|
67
|
+
- CF_API_KEY=${{CF_E2E_API_KEY}} yarn e2e
|
|
68
|
+
when:
|
|
69
|
+
branch:
|
|
70
|
+
ignore: [ master ]
|
|
71
|
+
|
|
39
72
|
build_images:
|
|
40
73
|
type: parallel
|
|
41
74
|
steps:
|
|
@@ -49,7 +82,7 @@ steps:
|
|
|
49
82
|
run_arm_build:
|
|
50
83
|
type: codefresh-run
|
|
51
84
|
arguments:
|
|
52
|
-
PIPELINE_ID:
|
|
85
|
+
PIPELINE_ID: codefresh-io/cli/build-arm
|
|
53
86
|
TRIGGER_ID: codefresh-io/cli
|
|
54
87
|
BRANCH: ${{CF_BRANCH}}
|
|
55
88
|
DETACH: false
|
|
@@ -105,9 +138,17 @@ steps:
|
|
|
105
138
|
tags:
|
|
106
139
|
- ${{CF_SHORT_REVISION}}
|
|
107
140
|
|
|
141
|
+
fail_on_bad_version:
|
|
142
|
+
image: codefresh/build-cli
|
|
143
|
+
commands:
|
|
144
|
+
- exit 1
|
|
145
|
+
when:
|
|
146
|
+
condition:
|
|
147
|
+
all:
|
|
148
|
+
versionCheckFailed: steps.check_version.result == 'failure'
|
|
149
|
+
|
|
108
150
|
execute_release_pipeline:
|
|
109
151
|
title: "Execute release pipeline in case version was changed"
|
|
110
|
-
fail_fast: false
|
|
111
152
|
type: codefresh-run
|
|
112
153
|
arguments:
|
|
113
154
|
PIPELINE_ID: 'codefresh-io/cli/release'
|
|
@@ -118,3 +159,6 @@ steps:
|
|
|
118
159
|
when:
|
|
119
160
|
branch:
|
|
120
161
|
only: [ master ]
|
|
162
|
+
condition:
|
|
163
|
+
all:
|
|
164
|
+
versionCheckSucceeded: steps.check_version.result != 'failure'
|
package/e2e/README.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Codefresh Cli E2E
|
|
2
|
+
|
|
3
|
+
Account -- codefresh-cli-e2e
|
|
4
|
+
|
|
5
|
+
If you want to debug e2e:
|
|
6
|
+
1) enable debug on the `build` pipeline
|
|
7
|
+
2) put breakpoint after `e2e_tests` step
|
|
8
|
+
3) then you can see logs of each test under `/codefresh/volume/cli/e2e/scenarios`
|
|
9
|
+
|
|
10
|
+
##### Note: try to create projects that do not contain same words (like _cli-e2e_ and _cli-e2e_-test)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
version: '1.0'
|
|
2
|
+
kind: pipeline
|
|
3
|
+
metadata:
|
|
4
|
+
name: pipeline-crud/crud
|
|
5
|
+
project: pipeline-crud
|
|
6
|
+
originalYamlString: |
|
|
7
|
+
version: '1.0'
|
|
8
|
+
steps:
|
|
9
|
+
test:
|
|
10
|
+
image: alpine
|
|
11
|
+
commands:
|
|
12
|
+
- echo test
|
|
13
|
+
spec:
|
|
14
|
+
triggers: []
|
|
15
|
+
stages: []
|
|
16
|
+
variables: []
|
|
17
|
+
contexts: []
|
|
18
|
+
steps:
|
|
19
|
+
test:
|
|
20
|
+
image: alpine
|
|
21
|
+
commands:
|
|
22
|
+
- echo test
|
|
23
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
version: '1.0'
|
|
2
|
+
kind: pipeline
|
|
3
|
+
metadata:
|
|
4
|
+
name: test-run/test-run
|
|
5
|
+
project: test-run
|
|
6
|
+
originalYamlString: |
|
|
7
|
+
version: '1.0'
|
|
8
|
+
steps:
|
|
9
|
+
test:
|
|
10
|
+
image: alpine
|
|
11
|
+
commands:
|
|
12
|
+
- echo test
|
|
13
|
+
spec:
|
|
14
|
+
triggers: []
|
|
15
|
+
stages: []
|
|
16
|
+
variables: []
|
|
17
|
+
contexts: []
|
|
18
|
+
steps:
|
|
19
|
+
test:
|
|
20
|
+
image: alpine
|
|
21
|
+
commands:
|
|
22
|
+
- echo test
|
|
23
|
+
|
package/e2e/e2e.spec.sh
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# fail if one of the commands returns non-zero code
|
|
2
|
+
set -e
|
|
3
|
+
set -o pipefail
|
|
4
|
+
|
|
5
|
+
export SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
|
|
6
|
+
source "$SCRIPT_DIR/helpers.sh"
|
|
7
|
+
|
|
8
|
+
codefresh version
|
|
9
|
+
echo
|
|
10
|
+
|
|
11
|
+
for executable in $SCRIPT_DIR/scenarios/*.sh
|
|
12
|
+
do
|
|
13
|
+
source $executable > "$executable.log" 2>&1 &
|
|
14
|
+
echo "[$!] Executing: $executable"
|
|
15
|
+
done
|
|
16
|
+
echo
|
|
17
|
+
|
|
18
|
+
for job in `jobs -p`
|
|
19
|
+
do
|
|
20
|
+
echo "Waiting for $job..."
|
|
21
|
+
wait $job || exit 1
|
|
22
|
+
done
|
|
23
|
+
|
|
24
|
+
echo
|
|
25
|
+
echo "All tests executed successfully!"
|
package/e2e/helpers.sh
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
codefresh get agents
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
codefresh get builds
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
codefresh get clusters
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
codefresh get compositions
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
codefresh get contexts
|