Use CircleCI version 2.1 at the top of your .circleci/config.yml file.
1
version: 2.1
Add the orbs
stanza below your version, invoking the orb:
1
2
orbs:
artifactory-orb: jfrog/artifactory-orb@1.0.1
Use artifactory-orb
elements in your existing workflows and jobs.
Opt-in to use of uncertified orbs on your organization’s Security settings page.
Install and configure the JFrog CLI, then upload build information (includes git and environment info by default) to JFrog Artifactory
1
2
3
4
5
6
7
8
9
10
11
12
jobs:
build:
docker:
- image: circleci/node:10
steps:
- checkout
- artifactory/install
- artifactory/configure
- artifactory/build-integration
orbs:
artifactory: circleci/artifactory@1.0.0
version: 2.1
Use the `docker-publish` job to build and tag a Docker image, then push it to a JFrog Docker registry. This example includes a custom value for `docker-steps`, which allows you to override the default `docker build` logic. The value passed to the `docker-tag` parameter is automatically stored as a job environment variable called `$DOCKERTAG`, so make sure to include that env var in your custom `docker build` logic.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
orbs:
artifactory: circleci/artifactory@1.0.0
version: 2.1
workflows:
custom-docker-example:
jobs:
- artifactory/docker-publish:
docker-registry: orbdemos-docker-local.jfrog.io
docker-steps:
- run: docker build -t $DOCKERTAG docker-publish-assets
docker-tag: >-
orbdemos-docker-local.jfrog.io/hello-world-custom:1.0-${CIRCLE_BUILD_NUM}
name: Docker Publish Custom Build
repository: docker-local
Use the `docker-publish` job to build and tag a Docker image, then push it to a JFrog Docker registry. This example assumes that your Dockerfile is stored in the root of your repository.
1
2
3
4
5
6
7
8
9
10
11
orbs:
artifactory: circleci/artifactory@1.0.0
version: 2.1
workflows:
simple-docker-example:
jobs:
- artifactory/docker-publish:
docker-registry: orbdemos-docker-local.jfrog.io
docker-tag: orbdemos-docker-local.jfrog.io/hello-world:1.0-${CIRCLE_BUILD_NUM}
name: Docker Publish Simple
repository: docker-local
Use the `upload` job to upload artifacts to JFrog's Artifactory
1
2
3
4
5
6
7
8
9
10
11
12
orbs:
artifactory: circleci/artifactory@1.0.0
version: 2.1
workflows:
publish:
jobs:
- artifactory/upload:
build-steps:
- run: mvn install -B
name: Publish Maven Jar
source: test/artifact.jar
target: repo/path
Log into a JFrog Docker registry, build a Docker image, and push it to the registry
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
artifactory-key | Name of environment variable storing your Artifactory API key
| No | ARTIFACTORY_API_KEY | env_var_name |
artifactory-user | Name of environment variable storing your Artifactory username
| No | ARTIFACTORY_USER | env_var_name |
build-integration | Should Artifactory 'Build Publish' task be executed | No | true | boolean |
build-name | Name used in Artifactory Build Integration | No | ${CIRCLE_PROJECT_REPONAME} | string |
build-number | Build Number used in Artifactory Build Integration | No | ${CIRCLE_BUILD_NUM} | string |
dependency-steps | Include any additional steps to collect dependency information before `jfrog rt bp` is executed.
| No | [] | steps |
docker-registry | The URL to use for docker login, depends on web server configuration of Artifactory: https://jfrog.com/confluence/display/RTF/Getting+Started+with+Artifactory+as+a+Docker+Registry
| Yes | - | string |
docker-steps | Steps to Build and Tag image, defaults to `docker build -t ${DOCKERTAG} .`
| No | [sequence of length 1] see source | steps |
docker-tag | Fully qualified(including reigstry) tag to use when issuing docker push commands. Will also be exposed to 'docker-steps' as a ${DOCKERTAG}
| Yes | - | string |
include-env | Collect environment variable details as part of Build Integration? For details, see https://jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-BuildIntegration-CollectingEnvironmentVariables
| No | true | boolean |
include-git | Collect git details as part of Build Integration? For details, see https://jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-BuildIntegration-AddingGitInformation
| No | true | boolean |
repository | Remote repository name in JFrog Artifactory
| Yes | - | string |
Upload artifacts to Artifactory
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
build-integration | Should Artifactory 'Build Publish' task be executed | No | true | boolean |
build-name | Artifactory build name, defaults to the value of $CIRCLE_PROJECT_REPONAME
| No | ${CIRCLE_PROJECT_REPONAME} | string |
build-number | Artifactory build number, defaults to the value of $CIRCLE_BUILD_NUM
| No | ${CIRCLE_BUILD_NUM} | string |
build-steps | Steps to generate artifacts. Alternately provide `workspace-path`.
| No | [] | steps |
docker | Docker image to use for build | No | circleci/openjdk:8 | string |
file-spec | Absolute or relative path to a JFrog JSON File Spec. To provide a File Spec, the `use-file-spec` parameter must be set to `true`.
| No | '' | string |
include-env | - | No | true | boolean |
include-git | - | No | true | boolean |
source | Absolute or relative path to artifacts which should be uploaded to Artifactory. Specify multiple artifacts by using wildcards.
| No | '' | string |
spec-vars | List of variables in the form of "key1=value1;key2=value2;..." to be replaced in the File Spec. `use-file-spec` must be set to `true`. In the File Spec, the variables should be used as follows: ${key1}.
| No | '' | string |
target | Target path in Artifactory for uploads, in the following format: [repository_name]/[repository_path]
| No | '' | string |
use-file-spec | Use a JFrog JSON File Spec to configure Artifactory upload, rather than inline command arguments/options. Defaults to false. For details, see https://jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-UsingFileSpecs
| No | false | boolean |
workspace-path | The key of a workflow workspace which contains artifacts. Alternately provide `build-steps`
| No | '' | string |
Publish build information to JFrog Artifactory with `jfrog rt bp`
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
build-name | Artifactory build name, defaults to the value of $CIRCLE_PROJECT_REPONAME
| No | ${CIRCLE_PROJECT_REPONAME} | string |
build-number | Artifactory build number, defaults to the value of $CIRCLE_BUILD_NUM
| No | ${CIRCLE_BUILD_NUM} | string |
include-env | Collect environment variable details as part of Build Integration? For details, see https://jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-BuildIntegration-CollectingEnvironmentVariables
| No | true | boolean |
include-git | Collect git details as part of Build Integration? For details, see https://jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-BuildIntegration-AddingGitInformation
| No | true | boolean |
Configure the JFrog CLI
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
artifactory-key | Name of environment variable storing your Artifactory API key
| No | ARTIFACTORY_API_KEY | env_var_name |
artifactory-url | Name of environment variable storing the URL of your Artifactory instance
| No | ARTIFACTORY_URL | env_var_name |
artifactory-user | Name of environment variable storing your Artifactory username
| No | ARTIFACTORY_USER | env_var_name |
Log into a JFrog (or other) Docker registry
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
artifactory-key | Name of environment variable storing your Artifactory API key
| No | ARTIFACTORY_API_KEY | env_var_name |
artifactory-user | Name of environment variable storing your Artifactory username
| No | ARTIFACTORY_USER | env_var_name |
docker-registry | The URL to use for docker login, depends on web server configuration of Artifactory: https://jfrog.com/confluence/display/RTF/Getting+Started+with+Artifactory+as+a+Docker+Registry
| Yes | - | string |
Push an image to a JFrog Docker registry
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
build-name | Artifactory build name, defaults to the value of $CIRCLE_PROJECT_REPONAME
| No | ${CIRCLE_PROJECT_REPONAME} | string |
build-number | Artifactory build number, defaults to the value of $CIRCLE_BUILD_NUM
| No | ${CIRCLE_BUILD_NUM} | string |
docker-tag | Full named reference to Docker image (repo/name:tag)
| Yes | - | string |
repository | Remote repository name in JFrog Artifactory
| Yes | - | string |
Upload files to Artifactory via `jfrog rt upload`. For details, see https://jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-UploadingFiles
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
build-name | Artifactory build name, defaults to the value of $CIRCLE_PROJECT_REPONAME
| No | ${CIRCLE_PROJECT_REPONAME} | string |
build-number | Artifactory build number, defaults to the value of $CIRCLE_BUILD_NUM
| No | ${CIRCLE_BUILD_NUM} | string |
file-spec | Absolute or relative path to a JFrog JSON File Spec. `use-file-spec` must be set to `true`.
| No | '' | string |
source | Absolute or relative path to artifacts which should be uploaded to Artifactory. Specify multiple artifacts by using wildcards.
| No | '' | string |
spec-vars | List of variables in the form of "key1=value1;key2=value2;..." to be replaced in the File Spec. `use-file-spec` must be set to `true`. In the File Spec, the variables should be used as follows: ${key1}.
| No | '' | string |
target | Target path in Artifactory for uploads, in the following format: [repository_name]/[repository_path]
| No | '' | string |
use-file-spec | Use a JFrog JSON File Spec to configure Artifactory upload, rather than inline command arguments/options. Defaults to false. For details, see https://jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-UsingFileSpecs
| No | false | boolean |
The default executor for jobs in this orb. Specify your own Docker image or use the default (circleci/openjdk:8).
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
docker-image | Docker image to use in this executor, defaults to circleci/openjdk:8
| No | circleci/openjdk:8 | string |
A machine executor that can run Docker commands: https://circleci.com/docs/2.0/executor-types/#using-machine
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
# This code is licensed from CircleCI to the user under the MIT license.
# See here for details: https://circleci.com/developer/orbs/licensing
commands:
build-integration:
description: |
Publish build information to JFrog Artifactory with `jfrog rt bp`
parameters:
build-name:
default: ${CIRCLE_PROJECT_REPONAME}
description: |
Artifactory build name, defaults to the value of $CIRCLE_PROJECT_REPONAME
type: string
build-number:
default: ${CIRCLE_BUILD_NUM}
description: |
Artifactory build number, defaults to the value of $CIRCLE_BUILD_NUM
type: string
include-env:
default: true
description: |
Collect environment variable details as part of Build Integration? For details, see https://jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-BuildIntegration-CollectingEnvironmentVariables
type: boolean
include-git:
default: true
description: |
Collect git details as part of Build Integration? For details, see https://jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-BuildIntegration-AddingGitInformation
type: boolean
steps:
- when:
condition: <<parameters.include-git>>
steps:
- run:
command: jfrog rt bag <<parameters.build-name>> <<parameters.build-number>>
name: Collect git details with JFrog CLI
- when:
condition: <<parameters.include-env>>
steps:
- run:
command: jfrog rt bce <<parameters.build-name>> <<parameters.build-number>>
name: Collect environment variable details with JFrog CLI
- run:
command: jfrog rt bp <<parameters.build-name>> <<parameters.build-number>>
name: Publish build details with JFrog CLI
configure:
description: Configure the JFrog CLI
parameters:
artifactory-key:
default: ARTIFACTORY_API_KEY
description: |
Name of environment variable storing your Artifactory API key
type: env_var_name
artifactory-url:
default: ARTIFACTORY_URL
description: |
Name of environment variable storing the URL of your Artifactory instance
type: env_var_name
artifactory-user:
default: ARTIFACTORY_USER
description: |
Name of environment variable storing your Artifactory username
type: env_var_name
steps:
- run:
command: |
: "${<<parameters.artifactory-url>>?Artifactory URL, API Key, and User \
must be set as Environment variables before running this command.}"
: "${<<parameters.artifactory-key>>?Artifactory URL, API Key, and User \
must be set as Environment variables before running this command.}"
: "${<<parameters.artifactory-user>>?Artifactory URL, API Key, and User \
must be set as Environment variables before running this command.}"
echo "configuring jfrog CLI with target ${<<parameters.artifactory-user>>}@${<<parameters.artifactory-url>>}"
jfrog rt c \
--user=${<<parameters.artifactory-user>>} \
--url=${<<parameters.artifactory-url>>} \
--apikey=${<<parameters.artifactory-key>>} \
--interactive=false
name: Configure JFrog CLI
docker-login:
description: |
Log into a JFrog (or other) Docker registry
parameters:
artifactory-key:
default: ARTIFACTORY_API_KEY
description: |
Name of environment variable storing your Artifactory API key
type: env_var_name
artifactory-user:
default: ARTIFACTORY_USER
description: |
Name of environment variable storing your Artifactory username
type: env_var_name
docker-registry:
description: |
The URL to use for docker login, depends on web server configuration of Artifactory: https://jfrog.com/confluence/display/RTF/Getting+Started+with+Artifactory+as+a+Docker+Registry
type: string
steps:
- run:
command: |
docker login -u $<<parameters.artifactory-user>> -p $<<parameters.artifactory-key>> <<parameters.docker-registry>>
name: Log into JFrog Docker registry
docker-publish:
description: |
Push an image to a JFrog Docker registry
parameters:
build-name:
default: ${CIRCLE_PROJECT_REPONAME}
description: |
Artifactory build name, defaults to the value of $CIRCLE_PROJECT_REPONAME
type: string
build-number:
default: ${CIRCLE_BUILD_NUM}
description: |
Artifactory build number, defaults to the value of $CIRCLE_BUILD_NUM
type: string
docker-tag:
description: |
Full named reference to Docker image (repo/name:tag)
type: string
repository:
description: |
Remote repository name in JFrog Artifactory
type: string
steps:
- run:
command: |
jfrog rt dp <<parameters.docker-tag>> <<parameters.repository>> --build-name=<<parameters.build-name>> --build-number=<<parameters.build-number>>
name: Docker push to JFrog registry
install:
description: Install the JFrog CLI
steps:
- run:
command: |
echo "Checking for existence of CLI"
set +e
jfrog -v
if [ $? -gt 0 ]; then
echo "Not found, installing latest"
curl -fL https://getcli.jfrog.io | sh
chmod a+x jfrog && sudo mv jfrog /usr/local/bin
else
echo "CLI exists, skipping install"
fi
name: Install JFrog CLI
upload:
description: |
Upload files to Artifactory via `jfrog rt upload`. For details, see https://jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-UploadingFiles
parameters:
build-name:
default: ${CIRCLE_PROJECT_REPONAME}
description: |
Artifactory build name, defaults to the value of $CIRCLE_PROJECT_REPONAME
type: string
build-number:
default: ${CIRCLE_BUILD_NUM}
description: |
Artifactory build number, defaults to the value of $CIRCLE_BUILD_NUM
type: string
file-spec:
default: ""
description: |
Absolute or relative path to a JFrog JSON File Spec. `use-file-spec` must be set to `true`.
type: string
source:
default: ""
description: |
Absolute or relative path to artifacts which should be uploaded to Artifactory. Specify multiple artifacts by using wildcards.
type: string
spec-vars:
default: ""
description: |
List of variables in the form of "key1=value1;key2=value2;..." to be replaced in the File Spec. `use-file-spec` must be set to `true`. In the File Spec, the variables should be used as follows: ${key1}.
type: string
target:
default: ""
description: |
Target path in Artifactory for uploads, in the following format: [repository_name]/[repository_path]
type: string
use-file-spec:
default: false
description: |
Use a JFrog JSON File Spec to configure Artifactory upload, rather than inline command arguments/options. Defaults to false. For details, see https://jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-UsingFileSpecs
type: boolean
steps:
- when:
condition: <<parameters.use-file-spec>>
steps:
- run:
command: |
jfrog rt upload \
<<#parameters.source>>"<<parameters.source>>"<</parameters.source>> \
<<#parameters.target>><<parameters.target>><</parameters.target>> \
--spec=<<parameters.file-spec>> \
--spec-vars="<<parameters.spec-vars>>" \
--build-name=<<parameters.build-name>> \
--build-number=<<parameters.build-number>>
name: Upload assets with JFrog CLI
- unless:
condition: <<parameters.use-file-spec>>
steps:
- run:
command: |
jfrog rt upload "<<parameters.source>>" <<parameters.target>> \
--build-name=<<parameters.build-name>> \
--build-number=<<parameters.build-number>>
name: Upload assets with JFrog CLI
description: |
Install, configure, and use the JFrog Artifactory CLI
examples:
build-integration-command:
description: |
Install and configure the JFrog CLI, then upload build information (includes git and environment info by default) to JFrog Artifactory
usage:
jobs:
build:
docker:
- image: circleci/node:10
steps:
- checkout
- artifactory/install
- artifactory/configure
- artifactory/build-integration
orbs:
artifactory: circleci/artifactory@1.0.0
version: 2.1
publish-docker-custom-build:
description: |
Use the `docker-publish` job to build and tag a Docker image, then push it to a JFrog Docker registry. This example includes a custom value for `docker-steps`, which allows you to override the default `docker build` logic. The value passed to the `docker-tag` parameter is automatically stored as a job environment variable called `$DOCKERTAG`, so make sure to include that env var in your custom `docker build` logic.
usage:
orbs:
artifactory: circleci/artifactory@1.0.0
version: 2.1
workflows:
custom-docker-example:
jobs:
- artifactory/docker-publish:
docker-registry: orbdemos-docker-local.jfrog.io
docker-steps:
- run: docker build -t $DOCKERTAG docker-publish-assets
docker-tag: orbdemos-docker-local.jfrog.io/hello-world-custom:1.0-${CIRCLE_BUILD_NUM}
name: Docker Publish Custom Build
repository: docker-local
publish-docker-simple:
description: |
Use the `docker-publish` job to build and tag a Docker image, then push it to a JFrog Docker registry. This example assumes that your Dockerfile is stored in the root of your repository.
usage:
orbs:
artifactory: circleci/artifactory@1.0.0
version: 2.1
workflows:
simple-docker-example:
jobs:
- artifactory/docker-publish:
docker-registry: orbdemos-docker-local.jfrog.io
docker-tag: orbdemos-docker-local.jfrog.io/hello-world:1.0-${CIRCLE_BUILD_NUM}
name: Docker Publish Simple
repository: docker-local
upload-job:
description: |
Use the `upload` job to upload artifacts to JFrog's Artifactory
usage:
orbs:
artifactory: circleci/artifactory@1.0.0
version: 2.1
workflows:
publish:
jobs:
- artifactory/upload:
build-steps:
- run: mvn install -B
name: Publish Maven Jar
source: test/artifact.jar
target: repo/path
executors:
default:
description: |
The default executor for jobs in this orb. Specify your own Docker image or use the default (circleci/openjdk:8).
docker:
- image: <<parameters.docker-image>>
parameters:
docker-image:
default: circleci/openjdk:8
description: |
Docker image to use in this executor, defaults to circleci/openjdk:8
type: string
machine:
description: |
A machine executor that can run Docker commands: https://circleci.com/docs/2.0/executor-types/#using-machine
machine: true
jobs:
docker-publish:
description: |
Log into a JFrog Docker registry, build a Docker image, and push it to the registry
environment:
RAWTAG: <<parameters.docker-tag>>
executor: machine
parameters:
artifactory-key:
default: ARTIFACTORY_API_KEY
description: |
Name of environment variable storing your Artifactory API key
type: env_var_name
artifactory-user:
default: ARTIFACTORY_USER
description: |
Name of environment variable storing your Artifactory username
type: env_var_name
build-integration:
default: true
description: Should Artifactory 'Build Publish' task be executed
type: boolean
build-name:
default: ${CIRCLE_PROJECT_REPONAME}
description: Name used in Artifactory Build Integration
type: string
build-number:
default: ${CIRCLE_BUILD_NUM}
description: Build Number used in Artifactory Build Integration
type: string
dependency-steps:
default: []
description: |
Include any additional steps to collect dependency information before `jfrog rt bp` is executed.
type: steps
docker-registry:
description: |
The URL to use for docker login, depends on web server configuration of Artifactory: https://jfrog.com/confluence/display/RTF/Getting+Started+with+Artifactory+as+a+Docker+Registry
type: string
docker-steps:
default:
- run: docker build -t ${DOCKERTAG} .
description: |
Steps to Build and Tag image, defaults to `docker build -t ${DOCKERTAG} .`
type: steps
docker-tag:
description: |
Fully qualified(including reigstry) tag to use when issuing docker push commands. Will also be exposed to 'docker-steps' as a ${DOCKERTAG}
type: string
include-env:
default: true
description: |
Collect environment variable details as part of Build Integration? For details, see https://jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-BuildIntegration-CollectingEnvironmentVariables
type: boolean
include-git:
default: true
description: |
Collect git details as part of Build Integration? For details, see https://jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-BuildIntegration-AddingGitInformation
type: boolean
repository:
description: |
Remote repository name in JFrog Artifactory
type: string
steps:
- checkout
- install
- configure
- docker-login:
artifactory-key: <<parameters.artifactory-key>>
artifactory-user: <<parameters.artifactory-user>>
docker-registry: <<parameters.docker-registry>>
- run: eval echo "export DOCKERTAG=${RAWTAG}" >> $BASH_ENV
- steps: <<parameters.dependency-steps>>
- steps: << parameters.docker-steps >>
- docker-publish:
build-name: <<parameters.build-name>>
build-number: <<parameters.build-number>>
docker-tag: <<parameters.docker-tag>>
repository: <<parameters.repository>>
- when:
condition: <<parameters.build-integration>>
steps:
- build-integration:
build-name: <<parameters.build-name>>
build-number: <<parameters.build-number>>
include-env: <<parameters.include-env>>
include-git: <<parameters.include-git>>
upload:
description: Upload artifacts to Artifactory
docker:
- image: <<parameters.docker>>
parameters:
build-integration:
default: true
description: Should Artifactory 'Build Publish' task be executed
type: boolean
build-name:
default: ${CIRCLE_PROJECT_REPONAME}
description: |
Artifactory build name, defaults to the value of $CIRCLE_PROJECT_REPONAME
type: string
build-number:
default: ${CIRCLE_BUILD_NUM}
description: |
Artifactory build number, defaults to the value of $CIRCLE_BUILD_NUM
type: string
build-steps:
default: []
description: |
Steps to generate artifacts. Alternately provide `workspace-path`.
type: steps
docker:
default: circleci/openjdk:8
description: Docker image to use for build
type: string
file-spec:
default: ""
description: |
Absolute or relative path to a JFrog JSON File Spec. To provide a File Spec, the `use-file-spec` parameter must be set to `true`.
type: string
include-env:
default: true
type: boolean
include-git:
default: true
type: boolean
source:
default: ""
description: |
Absolute or relative path to artifacts which should be uploaded to Artifactory. Specify multiple artifacts by using wildcards.
type: string
spec-vars:
default: ""
description: |
List of variables in the form of "key1=value1;key2=value2;..." to be replaced in the File Spec. `use-file-spec` must be set to `true`. In the File Spec, the variables should be used as follows: ${key1}.
type: string
target:
default: ""
description: |
Target path in Artifactory for uploads, in the following format: [repository_name]/[repository_path]
type: string
use-file-spec:
default: false
description: |
Use a JFrog JSON File Spec to configure Artifactory upload, rather than inline command arguments/options. Defaults to false. For details, see https://jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-UsingFileSpecs
type: boolean
workspace-path:
default: ""
description: |
The key of a workflow workspace which contains artifacts. Alternately provide `build-steps`
type: string
steps:
- checkout
- when:
condition: <<parameters.build-steps>>
steps: <<parameters.build-steps>>
- when:
condition: <<parameters.workspace-path>>
steps:
- attach_workspace:
at: <<parameters.workspace-path>>
- install
- configure
- upload:
build-name: <<parameters.build-name>>
build-number: <<parameters.build-number>>
file-spec: <<parameters.file-spec>>
source: <<parameters.source>>
spec-vars: <<parameters.spec-vars>>
target: <<parameters.target>>
use-file-spec: <<parameters.use-file-spec>>
- when:
condition: <<parameters.build-integration>>
steps:
- build-integration:
build-name: <<parameters.build-name>>
build-number: <<parameters.build-number>>
include-env: <<parameters.include-env>>
include-git: <<parameters.include-git>>
version: 2.1