2017-12-02 22:03:06 +02:00
|
|
|
---
|
|
|
|
title: Artifactory
|
|
|
|
---
|
|
|
|
|
|
|
|
Since [v0.38.0](https://github.com/goreleaser/goreleaser/releases/tag/v0.38.0),
|
|
|
|
GoReleaser supports building and pushing artifacts into Artifactory.
|
|
|
|
|
|
|
|
## How it works
|
|
|
|
|
|
|
|
You can declare multiple Artifactory instances.
|
|
|
|
All binaries generated by your `builds` section will be pushed to
|
|
|
|
each configured Artifactory.
|
|
|
|
|
|
|
|
If you have only one Artifactory instance,
|
|
|
|
the configuration is as easy as adding the
|
|
|
|
upload target and a usernameto your `.goreleaser.yml` file:
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
artifactories:
|
2017-12-02 22:14:04 +02:00
|
|
|
- target: http://<Your-Instance>:8081/artifactory/example-repo-local/{{ .ProjectName }}/{{ .Version }}/{{ .Os }}/{{ .Arch }}{{ if .Arm }}{{ .Arm }}{{ end }}
|
2017-12-02 22:03:06 +02:00
|
|
|
username: goreleaser
|
|
|
|
```
|
|
|
|
|
|
|
|
Prerequisites:
|
|
|
|
|
|
|
|
- A running Artifactory instances
|
|
|
|
- A user + password / API key with grants to upload an artifact
|
|
|
|
|
|
|
|
### Target
|
|
|
|
|
|
|
|
The `target` is the final URL of _without_ the binary name.
|
|
|
|
|
|
|
|
A configuration for `goreleaser` with the target
|
|
|
|
|
|
|
|
```
|
2017-12-02 22:14:04 +02:00
|
|
|
http://artifacts.company.com:8081/artifactory/example-repo-local/{{ .ProjectName }}/{{ .Version }}/{{ .Os }}/{{ .Arch }}{{ if .Arm }}{{ .Arm }}{{ end }}
|
2017-12-02 22:03:06 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
will result in a final deployment like
|
|
|
|
|
|
|
|
```
|
2017-12-02 22:14:04 +02:00
|
|
|
http://artifacts.company.com:8081/artifactory/example-repo-local/goreleaser/1.0.0/Darwin/x86_64/goreleaser
|
2017-12-02 22:03:06 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
Support variables:
|
|
|
|
|
|
|
|
- Os
|
|
|
|
- Arch
|
|
|
|
- Arm
|
|
|
|
- Version
|
|
|
|
- Tag
|
|
|
|
- ProjectName
|
|
|
|
|
|
|
|
### Password / API Key
|
|
|
|
|
|
|
|
Your configured username needs to be authenticated against your Artifactory.
|
|
|
|
|
|
|
|
The password or API key will be stored in a environment variable.
|
|
|
|
If you have only one Artifactory configured, you will store the secret in `ARTIFACTORY_0_SECRET`.
|
|
|
|
|
|
|
|
If you have multiple instances configured, you store the password for the second instance in `ARTIFACTORY_1_SECRET`,
|
|
|
|
for the third in `ARTIFACTORY_2_SECRET` and so on.
|
|
|
|
|
|
|
|
## Customization
|
|
|
|
|
|
|
|
Of course, you can customize a lot of things:
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
# .goreleaser.yml
|
|
|
|
artifactories:
|
|
|
|
# You can have multiple Artifactory instances.
|
|
|
|
-
|
|
|
|
# URL of your Artifactory instance + path to deploy to
|
2017-12-02 22:14:04 +02:00
|
|
|
target: http://artifacts.company.com:8081/artifactory/example-repo-local/{{ .ProjectName }}/{{ .Version }}/{{ .Os }}/{{ .Arch }}{{ if .Arm }}{{ .Arm }}{{ end }}
|
2017-12-02 22:03:06 +02:00
|
|
|
# User that will be used for the deployment
|
|
|
|
```
|
|
|
|
|
|
|
|
These settings should allow you to push your artifacts into multiple Artifactories.
|