> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# jfrog/artifactory-orb

Install, configure, and use the JFrog Artifactory CLI


## Commands

### build-integration

Publish build information to JFrog Artifactory with `jfrog rt bp`


| Parameter | Type | Default | Description |
|---|---|---|---|
| `build-name` | string | ${CIRCLE_PROJECT_REPONAME} | Artifactory build name, defaults to the value of $CIRCLE_PROJECT_REPONAME
 |
| `build-number` | string | ${CIRCLE_BUILD_NUM} | Artifactory build number, defaults to the value of $CIRCLE_BUILD_NUM
 |
| `include-env` | boolean | true | 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
 |
| `include-git` | boolean | true | Collect git details as part of Build Integration? For details, see https://jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-BuildIntegration-AddingGitInformation
 |

### configure

Configure the JFrog CLI

| Parameter | Type | Default | Description |
|---|---|---|---|
| `artifactory-key` | env_var_name | ARTIFACTORY_API_KEY | Name of environment variable storing your Artifactory API key
 |
| `artifactory-url` | env_var_name | ARTIFACTORY_URL | Name of environment variable storing the URL of your Artifactory instance
 |
| `artifactory-user` | env_var_name | ARTIFACTORY_USER | Name of environment variable storing your Artifactory username
 |

### docker-login

Log into a JFrog (or other) Docker registry


| Parameter | Type | Default | Description |
|---|---|---|---|
| `artifactory-key` | env_var_name | ARTIFACTORY_API_KEY | Name of environment variable storing your Artifactory API key
 |
| `artifactory-user` | env_var_name | ARTIFACTORY_USER | Name of environment variable storing your Artifactory username
 |
| `docker-registry` | string |  | 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
 |

### docker-publish

Push an image to a JFrog Docker registry


| Parameter | Type | Default | Description |
|---|---|---|---|
| `build-name` | string | ${CIRCLE_PROJECT_REPONAME} | Artifactory build name, defaults to the value of $CIRCLE_PROJECT_REPONAME
 |
| `build-number` | string | ${CIRCLE_BUILD_NUM} | Artifactory build number, defaults to the value of $CIRCLE_BUILD_NUM
 |
| `docker-tag` | string |  | Full named reference to Docker image (repo/name:tag)
 |
| `repository` | string |  | Remote repository name in JFrog Artifactory
 |

### install

Install the JFrog CLI

### upload

Upload files to Artifactory via `jfrog rt upload`. For details, see https://jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-UploadingFiles


| Parameter | Type | Default | Description |
|---|---|---|---|
| `build-name` | string | ${CIRCLE_PROJECT_REPONAME} | Artifactory build name, defaults to the value of $CIRCLE_PROJECT_REPONAME
 |
| `build-number` | string | ${CIRCLE_BUILD_NUM} | Artifactory build number, defaults to the value of $CIRCLE_BUILD_NUM
 |
| `file-spec` | string |  | Absolute or relative path to a JFrog JSON File Spec. `use-file-spec` must be set to `true`.
 |
| `source` | string |  | Absolute or relative path to artifacts which should be uploaded to Artifactory. Specify multiple artifacts by using wildcards.
 |
| `spec-vars` | string |  | 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}.
 |
| `target` | string |  | Target path in Artifactory for uploads, in the following format: [repository_name]/[repository_path]
 |
| `use-file-spec` | boolean | false | 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
 |

## Jobs

### docker-publish

Log into a JFrog Docker registry, build a Docker image, and push it to the registry


| Parameter | Type | Default | Description |
|---|---|---|---|
| `artifactory-key` | env_var_name | ARTIFACTORY_API_KEY | Name of environment variable storing your Artifactory API key
 |
| `artifactory-user` | env_var_name | ARTIFACTORY_USER | Name of environment variable storing your Artifactory username
 |
| `build-integration` | boolean | true | Should Artifactory 'Build Publish' task be executed |
| `build-name` | string | ${CIRCLE_PROJECT_REPONAME} | Name used in Artifactory Build Integration |
| `build-number` | string | ${CIRCLE_BUILD_NUM} | Build Number used in Artifactory Build Integration |
| `dependency-steps` | steps |  | Include any additional steps to collect dependency information before `jfrog rt bp` is executed.
 |
| `docker-registry` | string |  | 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
 |
| `docker-steps` | steps | [object Object] | Steps to Build and Tag image, defaults to `docker build -t ${DOCKERTAG} .`
 |
| `docker-tag` | string |  | Fully qualified(including reigstry) tag to use when issuing docker push commands. Will also be exposed to 'docker-steps' as a ${DOCKERTAG}
 |
| `include-env` | boolean | true | 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
 |
| `include-git` | boolean | true | Collect git details as part of Build Integration? For details, see https://jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-BuildIntegration-AddingGitInformation
 |
| `repository` | string |  | Remote repository name in JFrog Artifactory
 |

### upload

Upload artifacts to Artifactory

| Parameter | Type | Default | Description |
|---|---|---|---|
| `build-integration` | boolean | true | Should Artifactory 'Build Publish' task be executed |
| `build-name` | string | ${CIRCLE_PROJECT_REPONAME} | Artifactory build name, defaults to the value of $CIRCLE_PROJECT_REPONAME
 |
| `build-number` | string | ${CIRCLE_BUILD_NUM} | Artifactory build number, defaults to the value of $CIRCLE_BUILD_NUM
 |
| `build-steps` | steps |  | Steps to generate artifacts. Alternately provide `workspace-path`.
 |
| `docker` | string | circleci/openjdk:8 | Docker image to use for build |
| `file-spec` | string |  | 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`.
 |
| `include-env` | boolean | true |  |
| `include-git` | boolean | true |  |
| `source` | string |  | Absolute or relative path to artifacts which should be uploaded to Artifactory. Specify multiple artifacts by using wildcards.
 |
| `spec-vars` | string |  | 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}.
 |
| `target` | string |  | Target path in Artifactory for uploads, in the following format: [repository_name]/[repository_path]
 |
| `use-file-spec` | boolean | false | 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
 |
| `workspace-path` | string |  | The key of a workflow workspace which contains artifacts. Alternately provide `build-steps`
 |

## Executors

### default

The default executor for jobs in this orb. Specify your own Docker image or use the default (circleci/openjdk:8).


| Parameter | Type | Default | Description |
|---|---|---|---|
| `docker-image` | string | circleci/openjdk:8 | Docker image to use in this executor, defaults to circleci/openjdk:8
 |

### machine

A machine executor that can run Docker commands: https://circleci.com/docs/2.0/executor-types/#using-machine


## Examples

### build-integration-command

Install and configure the JFrog CLI, then upload build information (includes git and environment info by default) to JFrog Artifactory


```yaml
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

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.


```yaml
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

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.


```yaml
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

Use the `upload` job to upload artifacts to JFrog's Artifactory


```yaml
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
```