2020-05-24 21:09:47 +02:00
|
|
|
# Usage
|
|
|
|
|
2021-04-23 14:29:19 +02:00
|
|
|
NFPM can be used both as command line tool or as a library.
|
|
|
|
|
2020-07-10 07:06:39 +02:00
|
|
|
## Command Line
|
|
|
|
|
2020-05-24 21:09:47 +02:00
|
|
|
To create a sample config file, run:
|
|
|
|
|
2021-04-23 14:29:19 +02:00
|
|
|
```sh
|
|
|
|
nfpm init
|
2020-05-24 21:09:47 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
You can then customize it and package to the formats you want:
|
|
|
|
|
2021-04-23 14:29:19 +02:00
|
|
|
```sh
|
|
|
|
nfpm pkg --packager deb --target /tmp/
|
|
|
|
nfpm pkg --packager rpm --target /tmp/
|
2020-07-10 07:06:39 +02:00
|
|
|
```
|
2020-05-24 21:09:47 +02:00
|
|
|
|
2021-04-23 14:29:19 +02:00
|
|
|
You can learn about it in more detail in the [command line reference section](/cmd/nfpm/).
|
|
|
|
|
2020-07-10 07:06:39 +02:00
|
|
|
## Go Library
|
2020-05-24 21:09:47 +02:00
|
|
|
|
2021-04-23 14:29:19 +02:00
|
|
|
Check out the [GoDocs page](https://pkg.go.dev/github.com/goreleaser/nfpm/v2?tab=doc),
|
|
|
|
the [NFPM command line implementation](https://github.com/goreleaser/nfpm/blob/master/cmd/nfpm/main.go)
|
2020-07-10 07:06:39 +02:00
|
|
|
and [GoReleaser's usage](https://github.com/goreleaser/goreleaser/blob/master/internal/pipe/nfpm/nfpm.go).
|