github.com/droot/goreleaser@v0.66.2-0.20180420030140-c2db5fb17157/docs/125-artifactory.md (about) 1 --- 2 title: Artifactory 3 --- 4 5 Since [v0.38.0](https://github.com/goreleaser/goreleaser/releases/tag/v0.38.0), 6 GoReleaser supports building and pushing artifacts into Artifactory. 7 8 ## How it works 9 10 You can declare multiple Artifactory instances. 11 All binaries generated by your `builds` section will be pushed to 12 each configured Artifactory. 13 14 If you have only one Artifactory instance, 15 the configuration is as easy as adding the 16 upload target and a username to your `.goreleaser.yml` file: 17 18 ```yaml 19 artifactories: 20 - name: production 21 target: http://<Your-Instance>:8081/artifactory/example-repo-local/{{ .ProjectName }}/{{ .Version }}/ 22 username: goreleaser 23 ``` 24 25 Prerequisites: 26 27 * A running Artifactory instances 28 * A user + password / API key with grants to upload an artifact 29 30 ### Target 31 32 The `target` is the URL to upload the artifacts to (_without_ the name of the artifact). 33 34 An example configuration for `goreleaser` in upload mode `binary` with the target can look like 35 36 ```yaml 37 - mode: binary 38 target: 'http://artifacts.company.com:8081/artifactory/example-repo-local/{{ .ProjectName }}/{{ .Version }}/{{ .Os }}/{{ .Arch }}{{ if .Arm }}{{ .Arm }}{{ end }}' 39 ``` 40 41 and will result in a final deployment like `http://artifacts.company.com:8081/artifactory/example-repo-local/goreleaser/1.0.0/Darwin/x86_64/goreleaser`. 42 43 Supported variables: 44 45 * Version 46 * Tag 47 * ProjectName 48 * Os 49 * Arch 50 * Arm 51 52 _Attention_: Variables _Os_, _Arch_ and _Arm_ are only supported in upload 53 mode `binary`. 54 55 ### Password / API Key 56 57 Your configured username needs to be authenticated against your Artifactory. 58 59 The password or API key will be stored in a environment variable. 60 The configured name of your Artifactory instance will be used. 61 With this way we support auth for multiple instances. 62 This also means that the `name` per configured instance needs to be unique 63 per goreleaser configuration. 64 65 The name of the environment variable will be `ARTIFACTORY_NAME_SECRET`. 66 If your instance is named `production`, you need to store the secret in the 67 environment variable `ARTIFACTORY_PRODUCTION_SECRET`. 68 The name will be transformed to uppercase. 69 70 ## Customization 71 72 Of course, you can customize a lot of things: 73 74 ```yaml 75 # .goreleaser.yml 76 artifactories: 77 # You can have multiple Artifactory instances. 78 - 79 # Unique name of your artifactory instance. Used to identify the instance 80 name: production 81 # Upload mode. Valid options are `binary` and `archive`. 82 # If mode is `archive`, variables _Os_, _Arch_ and _Arm_ for target name are not supported. 83 # In that case these variables are empty. 84 # Default is `archive`. 85 mode: archive 86 # URL of your Artifactory instance + path to deploy to 87 target: http://artifacts.company.com:8081/artifactory/example-repo-local/{{ .ProjectName }}/{{ .Version }}/ 88 # User that will be used for the deployment 89 username: deployuser 90 ``` 91 92 These settings should allow you to push your artifacts into multiple Artifactories.