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