2020-05-24 21:09:47 +02:00
|
|
|
# Install
|
|
|
|
|
2021-07-12 19:49:15 +02:00
|
|
|
You can install the pre-compiled binary (in several different ways), use Docker or compile from source.
|
2020-05-24 21:09:47 +02:00
|
|
|
|
2021-07-12 19:49:15 +02:00
|
|
|
Bellow you can find the steps for each of them.
|
2020-05-24 21:09:47 +02:00
|
|
|
|
|
|
|
## Install the pre-compiled binary
|
|
|
|
|
2021-07-12 19:49:15 +02:00
|
|
|
### homebrew tap
|
2020-05-24 21:09:47 +02:00
|
|
|
|
2021-04-23 14:29:19 +02:00
|
|
|
```sh
|
|
|
|
brew install goreleaser/tap/nfpm
|
|
|
|
```
|
|
|
|
|
2021-07-12 19:49:15 +02:00
|
|
|
### homebrew
|
2021-04-23 14:29:19 +02:00
|
|
|
|
|
|
|
```sh
|
|
|
|
brew install nfpm
|
2020-05-24 21:09:47 +02:00
|
|
|
```
|
|
|
|
|
2021-07-12 19:49:15 +02:00
|
|
|
!!! info
|
|
|
|
The [formula in homebrew-core](https://github.com/Homebrew/homebrew-core/blob/master/Formula/nfpm.rb) might be slightly outdated.
|
|
|
|
Use our homebrew tap to always get the latest updates.
|
|
|
|
|
2021-07-12 19:50:43 +02:00
|
|
|
### scoop
|
2020-05-24 21:09:47 +02:00
|
|
|
|
2021-04-23 14:29:19 +02:00
|
|
|
```sh
|
|
|
|
scoop bucket add goreleaser https://github.com/goreleaser/scoop-bucket.git
|
|
|
|
scoop install nfpm
|
2020-05-24 21:09:47 +02:00
|
|
|
```
|
|
|
|
|
2021-07-12 19:49:15 +02:00
|
|
|
### apt
|
|
|
|
|
|
|
|
```sh
|
|
|
|
echo 'deb [trusted=yes] https://apt.fury.io/goreleaser/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install nfpm
|
|
|
|
```
|
|
|
|
|
|
|
|
### yum
|
|
|
|
|
|
|
|
```sh
|
|
|
|
echo '[goreleaser]
|
|
|
|
name=GoReleaser
|
|
|
|
baseurl=https://yum.fury.io/goreleaser/
|
|
|
|
enabled=1
|
|
|
|
gpgcheck=0' | sudo tee /etc/yum.repos.d/goreleaser.repo
|
|
|
|
sudo yum install nfpm
|
|
|
|
```
|
|
|
|
|
2021-07-12 19:50:43 +02:00
|
|
|
### deb, apk and rpm packages
|
2021-04-23 14:29:19 +02:00
|
|
|
|
|
|
|
Download the `.deb`, `.rpm` or `.apk` from the [releases page][releases] and install them with the appropriate tools.
|
|
|
|
|
2021-07-12 19:49:15 +02:00
|
|
|
### shell script
|
2020-05-24 21:09:47 +02:00
|
|
|
|
2021-04-23 14:29:19 +02:00
|
|
|
```sh
|
|
|
|
curl -sfL https://install.goreleaser.com/github.com/goreleaser/nfpm.sh | sh
|
|
|
|
```
|
2020-05-24 21:09:47 +02:00
|
|
|
|
2021-07-12 19:49:15 +02:00
|
|
|
### go install
|
2020-05-24 21:09:47 +02:00
|
|
|
|
2021-04-23 14:29:19 +02:00
|
|
|
```sh
|
2021-06-09 20:19:14 +02:00
|
|
|
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
|
2020-05-24 21:09:47 +02:00
|
|
|
```
|
|
|
|
|
2021-07-12 19:49:15 +02:00
|
|
|
### Manually
|
2020-05-24 21:09:47 +02:00
|
|
|
|
2021-07-12 19:49:15 +02:00
|
|
|
Download the pre-compiled binaries from the [releases page][releases] and copy them to the desired location.
|
2020-05-24 21:09:47 +02:00
|
|
|
|
|
|
|
## Running with Docker
|
|
|
|
|
|
|
|
You can also use it within a Docker container. To do that, you'll need to
|
|
|
|
execute something more-or-less like the following:
|
|
|
|
|
2021-04-23 14:29:19 +02:00
|
|
|
```sh
|
|
|
|
docker run --rm -v $PWD:/tmp/pkg goreleaser/nfpm package \
|
|
|
|
--config /tmp/pkg/foo.yml \
|
|
|
|
--target /tmp \
|
|
|
|
--packager deb
|
2020-05-24 21:09:47 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
## Compiling from source
|
|
|
|
|
|
|
|
Here you have two options:
|
|
|
|
|
2021-07-12 19:49:15 +02:00
|
|
|
If you want to contribute to the project, please follow the steps on our [contributing guide](/contributing).
|
2020-05-24 21:09:47 +02:00
|
|
|
|
|
|
|
If you just want to build from source for whatever reason, follow these steps:
|
|
|
|
|
2021-04-23 14:29:19 +02:00
|
|
|
**clone:**
|
2020-05-24 21:09:47 +02:00
|
|
|
|
2021-04-23 14:29:19 +02:00
|
|
|
```sh
|
|
|
|
git clone https://github.com/goreleaser/nfpm
|
|
|
|
cd nfpm
|
2020-05-24 21:09:47 +02:00
|
|
|
```
|
|
|
|
|
2021-04-23 14:29:19 +02:00
|
|
|
**get the dependencies:**
|
2020-05-24 21:09:47 +02:00
|
|
|
|
2021-04-23 14:29:19 +02:00
|
|
|
```sh
|
|
|
|
go mod tidy
|
2020-05-24 21:09:47 +02:00
|
|
|
```
|
|
|
|
|
2021-04-23 14:29:19 +02:00
|
|
|
**build:**
|
2020-05-24 21:09:47 +02:00
|
|
|
|
2021-04-23 14:29:19 +02:00
|
|
|
```sh
|
|
|
|
go build -o nfpm ./cmd/nfpm
|
2020-05-24 21:09:47 +02:00
|
|
|
```
|
|
|
|
|
2021-04-23 14:29:19 +02:00
|
|
|
**verify it works:**
|
2020-05-24 21:09:47 +02:00
|
|
|
|
2021-04-23 14:29:19 +02:00
|
|
|
```sh
|
|
|
|
./nfpm --version
|
2020-05-24 21:09:47 +02:00
|
|
|
```
|
2021-04-23 14:29:19 +02:00
|
|
|
|
|
|
|
[releases]: https://github.com/goreleaser/nfpm/releases
|