From 4b68c6af92978208ed5af2f97ed52faf3244468b Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sun, 18 Feb 2018 20:37:59 -0300 Subject: [PATCH] docs: several improvements --- docs/020-environment.md | 15 +++ ...110-snapcraft.md => 100-linux-packages.md} | 118 +++++++++++++++++- docs/100-nfpm.md | 100 --------------- docs/{115-release.md => 123-release.md} | 11 +- docs/125-artifactory.md | 16 ++- docs/130-docker.md | 8 +- docs/140-ci.md | 12 +- docs/150-github-enterprise.md | 16 --- docs/999-links.md | 2 +- 9 files changed, 156 insertions(+), 142 deletions(-) rename docs/{110-snapcraft.md => 100-linux-packages.md} (50%) delete mode 100644 docs/100-nfpm.md rename docs/{115-release.md => 123-release.md} (83%) delete mode 100644 docs/150-github-enterprise.md diff --git a/docs/020-environment.md b/docs/020-environment.md index 4a8f209ea..6a1c014ea 100644 --- a/docs/020-environment.md +++ b/docs/020-environment.md @@ -21,6 +21,21 @@ env_files: github_token: ~/.path/to/my/token ``` +## GitHub Enterprise + +You can use GoReleaser with GitHub Enterprise by providing its URLs in +the `.goreleaser.yml` configuration file: + +```yaml +# .goreleaser.yml +github_urls: + api: api.github.foo.bar + upload: uploads.github.foo.bar + download: github.foo.bar +``` + +If none are set, they default to GitHub's public URLs. + ## The dist folder By default, GoReleaser will create its artifacts in the `./dist` folder. diff --git a/docs/110-snapcraft.md b/docs/100-linux-packages.md similarity index 50% rename from docs/110-snapcraft.md rename to docs/100-linux-packages.md index 1a175ea3b..556c932f4 100644 --- a/docs/110-snapcraft.md +++ b/docs/100-linux-packages.md @@ -1,15 +1,125 @@ --- -title: Snapcraft +title: Linux Packages --- -GoReleaser can generate `snap` packages. [Snaps](http://snapcraft.io/) are a -new packaging format, that will let you publish your project directly to the -Ubuntu store. From there it will be installable in all the +GoReleaser can generate RPM, Deb and Snap packages for your projects. + +Let's see each option in detail: + +## NFPM + +GoReleaser can be wired to [nfpm](https://github.com/goreleaser/nfpm) to +generate and publish `.deb` and `.rpm` packages. + +Available options: + +```yml +# .goreleaser.yml +nfpm: + # You can change the name of the package. + # This is parsed with the Go template engine and the following variables + # are available: + # - ProjectName + # - Tag + # - Version (Git tag without `v` prefix) + # - Os + # - Arch + # - Arm (ARM version) + # - Env (environment variables) + # Default: `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}` + name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + + # Replacements for GOOS and GOARCH in the package name. + # Keys should be valid GOOSs or GOARCHs. + # Values are the respective replacements. + # Default is empty. + replacements: + amd64: 64-bit + 386: 32-bit + darwin: macOS + linux: Tux + + # Your app's vendor. + # Default is empty. + vendor: Drum Roll Inc. + # Your app's homepage. + # Default is empty. + homepage: https://example.com/ + + # Your app's maintainer (probably you). + # Default is empty. + maintainer: Drummer + + # Your app's description. + # Default is empty. + description: Software to create fast and easy drum rolls. + + # Your app's license. + # Default is empty. + license: Apache 2.0 + + # Formats to be generated. + formats: + - deb + - rpm + + # Packages your package depends on. + dependencies: + - git + - zsh + + # Packages your package recommends installing. + # For RPM packages rpmbuild >= 4.13 is required + recommends: + - bzr + - gtk + + # Packages your package suggests installing. + # For RPM packages rpmbuild >= 4.13 is required + suggests: + - cvs + - ksh + + # Packages that conflict with your package. + conflicts: + - svn + - bash + + # Override default /usr/local/bin destination for binaries + bindir: /usr/bin + + # Files or directories to add to your package (beyond the binary). + # Keys are source paths to get the files from. + # Values are the destination locations of the files in the package. + files: + "scripts/etc/init.d/": "/etc/init.d" + + # Config files to add to your package. They are about the same as + # the files keyword, except package managers treat them differently (while + # uninstalling, mostly). + # Keys are source paths to get the files from. + # Values are the destination locations of the files in the package. + config_files: + "conf/app.conf": "/etc/app.conf" +``` + +Note that GoReleaser will not install `rpmbuild` or any dependencies for you. +As for now, `rpmbuild` is recommended if you want to generate rpm packages. +You can install it with `apt-get install rpm` or `brew install rpm`. + +## Snapcraft + +GoReleaser can also generate `snap` packages. +[Snaps](http://snapcraft.io/) are a new packaging format, that will let you +publish your project directly to the Ubuntu store. +From there it will be installable in all the [supported Linux distros](https://snapcraft.io/docs/core/install), with automatic and transactional updates. You can read more about it in the [snapcraft docs](https://snapcraft.io/docs/). +Available options: + ```yml # .goreleaser.yml snapcraft: diff --git a/docs/100-nfpm.md b/docs/100-nfpm.md deleted file mode 100644 index 5ad31ec4a..000000000 --- a/docs/100-nfpm.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: NFPM ---- - -GoReleaser can be wired to [nfpm](https://github.com/goreleaser/nfpm) to -generate and publish `.deb` and `.rpm` packages. - -```yml -# .goreleaser.yml -nfpm: - # You can change the name of the package. - # This is parsed with the Go template engine and the following variables - # are available: - # - ProjectName - # - Tag - # - Version (Git tag without `v` prefix) - # - Os - # - Arch - # - Arm (ARM version) - # - Env (environment variables) - # Default: `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}` - name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" - - # Replacements for GOOS and GOARCH in the package name. - # Keys should be valid GOOSs or GOARCHs. - # Values are the respective replacements. - # Default is empty. - replacements: - amd64: 64-bit - 386: 32-bit - darwin: macOS - linux: Tux - - # Your app's vendor. - # Default is empty. - vendor: Drum Roll Inc. - # Your app's homepage. - # Default is empty. - homepage: https://example.com/ - - # Your app's maintainer (probably you). - # Default is empty. - maintainer: Drummer - - # Your app's description. - # Default is empty. - description: Software to create fast and easy drum rolls. - - # Your app's license. - # Default is empty. - license: Apache 2.0 - - # Formats to be generated. - formats: - - deb - - rpm - - # Packages your package depends on. - dependencies: - - git - - zsh - - # Packages your package recommends installing. - # For RPM packages rpmbuild >= 4.13 is required - recommends: - - bzr - - gtk - - # Packages your package suggests installing. - # For RPM packages rpmbuild >= 4.13 is required - suggests: - - cvs - - ksh - - # Packages that conflict with your package. - conflicts: - - svn - - bash - - # Override default /usr/local/bin destination for binaries - bindir: /usr/bin - - # Files or directories to add to your package (beyond the binary). - # Keys are source paths to get the files from. - # Values are the destination locations of the files in the package. - files: - "scripts/etc/init.d/": "/etc/init.d" - - # Config files to add to your package. They are about the same as - # the files keyword, except package managers treat them differently (while - # uninstalling, mostly). - # Keys are source paths to get the files from. - # Values are the destination locations of the files in the package. - config_files: - "conf/app.conf": "/etc/app.conf" -``` - -Note that GoReleaser will not install `rpmbuild` or any dependencies for you. -As for now, `rpmbuild` is recommended if you want to generate rpm packages. -You can install it with `apt-get install rpm` or `brew install rpm`. diff --git a/docs/115-release.md b/docs/123-release.md similarity index 83% rename from docs/115-release.md rename to docs/123-release.md index eec924657..fe8c348f3 100644 --- a/docs/115-release.md +++ b/docs/123-release.md @@ -1,9 +1,10 @@ --- -title: Releasing +title: Release --- -GoReleaser will create a release in GitHub with the current tag, upload all -the archives and checksums, also generate a changelog from the commits new since the last tag. +GoReleaser will create a GitHub release with the current tag, upload all +the artifacts and generate the changelog based on the new commits since the +previous tag. Let's see what can be customized in the `release` section: @@ -68,6 +69,6 @@ On Unix systems you can also generate the release notes in-line by using To list all commits since the last tag, but skip ones starting with `Merge` or `docs`, you could run this command: -```sh -goreleaser --release-notes <(git log --pretty=oneline --abbrev-commit $(git describe --tags --abbrev=0)^.. | grep -v '^[^ ]* \(Merge\|docs\)') +```console +$ goreleaser --release-notes <(some_changelog_generator) ``` diff --git a/docs/125-artifactory.md b/docs/125-artifactory.md index 6678f68e4..884cbf177 100644 --- a/docs/125-artifactory.md +++ b/docs/125-artifactory.md @@ -33,17 +33,14 @@ The `target` is the URL to upload the artifacts to (_without_ the name of the ar An example configuration for `goreleaser` in upload mode `binary` with the target can look like -``` -http://artifacts.company.com:8081/artifactory/example-repo-local/{{ .ProjectName }}/{{ .Version }}/{{ .Os }}/{{ .Arch }}{{ if .Arm }}{{ .Arm }}{{ end }} +```yaml +- mode: binary + target: 'http://artifacts.company.com:8081/artifactory/example-repo-local/{{ .ProjectName }}/{{ .Version }}/{{ .Os }}/{{ .Arch }}{{ if .Arm }}{{ .Arm }}{{ end }}' ``` -and will result in a final deployment like +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`. -``` -http://artifacts.company.com:8081/artifactory/example-repo-local/goreleaser/1.0.0/Darwin/x86_64/goreleaser -``` - -Support variables: +Supported variables: * Version * Tag @@ -52,7 +49,8 @@ Support variables: * Arch * Arm -_Attention_: Variables _Os_, _Arch_ and _Arm_ are only supported in upload mode `binary`. +_Attention_: Variables _Os_, _Arch_ and _Arm_ are only supported in upload +mode `binary`. ### Password / API Key diff --git a/docs/130-docker.md b/docs/130-docker.md index 8e48ba0ef..3d2c40365 100644 --- a/docs/130-docker.md +++ b/docs/130-docker.md @@ -111,9 +111,5 @@ This will build and publish the following images: * myuser/myimage:v1.6 * myuser/myimage:latest -Hope this feature serves you well! - -More info: - -* [#461](https://github.com/goreleaser/goreleaser/issues/461) -* [#505](https://github.com/goreleaser/goreleaser/issues/505) +With these settings you can hopefully push several different docker images +with multiple tags. diff --git a/docs/140-ci.md b/docs/140-ci.md index c4212d20c..a35bdddf5 100644 --- a/docs/140-ci.md +++ b/docs/140-ci.md @@ -16,11 +16,21 @@ You may want to setup your project to auto-deploy your new tags on # .travis.yml language: go -# needed for the nfpm pipe addons: apt: packages: + # needed for the nfpm pipe: - rpm + # needed for the snap pipe: + - snapcraft + +env: +# needed for the snap pipe: +- PATH=/snap/bin:$PATH + +install: +# needed for the snap pipe: +- sudo snap install snapcraft --classic # needed for the docker pipe services: diff --git a/docs/150-github-enterprise.md b/docs/150-github-enterprise.md deleted file mode 100644 index 899a98f6e..000000000 --- a/docs/150-github-enterprise.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: GitHub Enterprise ---- - -You can use GoReleaser with GitHub Enterprise by providing its URLs in -the `.goreleaser.yml` configuration file: - -```yaml -# .goreleaser.yml -github_urls: - api: api.github.foo.bar - upload: uploads.github.foo.bar - download: github.foo.bar -``` - -If none are set, they default to GitHub's public URLs. diff --git a/docs/999-links.md b/docs/999-links.md index e9f69ca9a..2b4359bb6 100644 --- a/docs/999-links.md +++ b/docs/999-links.md @@ -4,7 +4,7 @@ title: Links * Follow the progress on the [GitHub repository](https://github.com/goreleaser/goreleaser) * Follow [@goreleaser](https://twitter.com/goreleaser) on Twitter for updates -* [Slack](https://gophers.slack.com/messages/goreleaser/) to chat about GoReleaser, +* Chat on [Slack](https://gophers.slack.com/messages/goreleaser/) to chat about GoReleaser, questions, etc. Join using [this link](https://invite.slack.golangbridge.org/) * [Contributing Guidelines](https://github.com/goreleaser/goreleaser/blob/master/CONTRIBUTING.md)