2020-05-24 21:09:47 +02:00
|
|
|
# Usage
|
|
|
|
|
2021-06-27 03:01:53 +02:00
|
|
|
nFPM can be used both as command line tool or as a library.
|
2021-04-23 14:29:19 +02:00
|
|
|
|
2020-07-10 07:06:39 +02:00
|
|
|
## Command Line
|
|
|
|
|
2023-01-03 02:26:17 +01:00
|
|
|
To create a sample configuration file, run:
|
2020-05-24 21:09:47 +02:00
|
|
|
|
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
|
|
|
|
2023-01-03 02:26:17 +01:00
|
|
|
You can learn about it in more detail in the
|
|
|
|
[command line reference section](/cmd/nfpm/).
|
2021-04-23 14:29:19 +02:00
|
|
|
|
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),
|
2021-11-12 21:18:34 +01:00
|
|
|
the [nFPM command line implementation](https://github.com/goreleaser/nfpm/blob/main/cmd/nfpm/main.go)
|
2021-11-12 21:21:09 +01:00
|
|
|
and [GoReleaser's usage](https://github.com/goreleaser/goreleaser/blob/main/internal/pipe/nfpm/nfpm.go).
|