mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-03 13:11:48 +02:00
25 lines
1.3 KiB
Markdown
25 lines
1.3 KiB
Markdown
# Publish to Artifactory using jfrog cli
|
|
This cookbook is an example of a [publishers](/customization/publishers/) section that uses the [jfrog cli](https://jfrog.com/getcli/) to upload files to Artifactory. It is an alternative to using the [Artifactory Publisher](/customization/artifactory.md) to upload to artifactory.
|
|
|
|
The benefit of this method is that it uses the jfrog cli configuration instead of environment variables for configuration.
|
|
|
|
This assumes you have the [jfrog cli](https://jfrog.com/getcli/) downloaded and in your path, and [configured](https://www.jfrog.com/confluence/display/CLI/JFrog+CLI#JFrogCLI-JFrogPlatformConfiguration) with an API key.
|
|
|
|
```yaml
|
|
publishers:
|
|
- name: artifactory
|
|
cmd: >-
|
|
jfrog rt u "{{ .ArtifactName }}" "my-repository/{{ tolower .Env.PROJECT_KEY }}/{{ tolower .ProjectName }}/{{ .Version }}/"
|
|
dir: "{{ dir .ArtifactPath }}"
|
|
```
|
|
|
|
Example of a [publishers](/customization/publishers/) section pushing files to a Artifactory instance using jfrog cli with api key in environment
|
|
|
|
```yaml
|
|
publishers:
|
|
- name: artifactory
|
|
cmd: >-
|
|
jfrog rt u "{{ .ArtifactName }}" "my-repository/{{ tolower .Env.PROJECT_KEY }}/{{ tolower .ProjectName }}/{{ .Version }}/" --api-key "{{ .Env.ARTIFACTORY_API_KEY }}"
|
|
dir: "{{ dir .ArtifactPath }}"
|
|
```
|