1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/docs/160-artifactory.md
Andy Grunwald d9f349dd0c docs: Add first draft of documentation for Artifactory
The first draft of the Artifactory pipeline documentation was added.
2017-12-02 21:03:06 +01:00

2.2 KiB

title
Artifactory

Since 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:

artifactories:
  - target: http://<Your-Instance>:8081/artifactory/example-repo-local/{{ .ProjectName }}/{{ .Os }}/{{ .Arch }}{{ if .Arm }}{{ .Arm }}{{ end }}
    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

http://artifacts.company.com:8081/artifactory/example-repo-local/{{ .ProjectName }}/{{ .Os }}/{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}

will result in a final deployment like

http://artifacts.company.com:8081/artifactory/example-repo-local/goreleaser/Darwin/x86_64/goreleaser

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:

# .goreleaser.yml
artifactories:
  # You can have multiple Artifactory instances.
  -
    # URL of your Artifactory instance + path to deploy to
    target: http://artifacts.company.com:8081/artifactory/example-repo-local/{{ .ProjectName }}/{{ .Os }}/{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}
    # User that will be used for the deployment

These settings should allow you to push your artifacts into multiple Artifactories.