Skip to content

docs: added docs website, removed bindir #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: docs

on:
push:
branches:
- 'master'
paths:
- '.github/workflows/htmltest.yml'
- 'www/*'
pull_request: {}

jobs:
htmltest:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: build
run: |
docker run --rm -v ${PWD}/www:/docs squidfunk/mkdocs-material build
-
name: htmltest
run: |
cd www
curl https://htmltest.wjdp.uk | bash
./bin/htmltest -c htmltest.yml site
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ nfpm.yaml
bin
coverage.out
/nfpm
www/site
7 changes: 7 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,10 @@ nfpms:
formats:
- deb
- rpm
scoop:
bucket:
owner: goreleaser
name: scoop-bucket
homepage: https://goreleaser.com
description: Deliver Go binaries as fast and easily as possible
license: MIT
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ deps:
go mod verify
.PHONY: deps

imgs:
wget -O www/docs/static/logo.png https://github.com/goreleaser/artwork/raw/master/goreleaserfundo.png
wget -O www/docs/static/card.png "https://og.caarlos0.dev/**NFPM**%20|%20A%20simple%20Deb%20and%20RPM%20packager%20written%20in%20Go.png?theme=light&md=1&fontSize=80px&images=https://github.com/goreleaser.png"
wget -O www/docs/static/avatar.png https://github.com/goreleaser.png
convert www/docs/static/avatar.png -define icon:auto-resize=64,48,32,16 www/docs/static/favicon.ico
convert www/docs/static/avatar.png -resize x120 www/docs/static/apple-touch-icon.png
.PHONY: imgs

serve:
@docker run --rm -it -p 8000:8000 -v ${PWD}/www:/docs squidfunk/mkdocs-material
.PHONY: serve

todo:
@grep \
--exclude-dir=vendor \
Expand Down
1 change: 0 additions & 1 deletion cmd/nfpm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ description: |
vendor: "FooBarCorp"
homepage: "http://example.com"
license: "MIT"
bindir: "/usr/local/bin"
files:
./foo: "/usr/local/bin/foo"
./bar: "/usr/local/bin/bar"
Expand Down
4 changes: 0 additions & 4 deletions nfpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ type Info struct {
Vendor string `yaml:"vendor,omitempty"`
Homepage string `yaml:"homepage,omitempty"`
License string `yaml:"license,omitempty"`
Bindir string `yaml:"bindir,omitempty"`
Target string `yaml:"-"`
}

Expand Down Expand Up @@ -208,9 +207,6 @@ func Validate(info *Info) error {

// WithDefaults set some sane defaults into the given Info.
func WithDefaults(info *Info) *Info {
if info.Bindir == "" {
info.Bindir = "/usr/local/bin"
}
if info.Platform == "" {
info.Platform = "linux"
}
Expand Down
5 changes: 2 additions & 3 deletions nfpm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ func TestDefaultsVersion(t *testing.T) {
Version: "v1.0.0",
}
info = WithDefaults(info)
assert.NotEmpty(t, info.Bindir)
assert.NotEmpty(t, info.Platform)
assert.Equal(t, "1.0.0", info.Version)
assert.Equal(t, "", info.Release)
Expand Down Expand Up @@ -71,19 +70,19 @@ func TestDefaultsVersion(t *testing.T) {
assert.Equal(t, "beta1", info.Prerelease)

info = &Info{
Version: "v1.0.0-1",
Version: "v1.0.0-1+xdg2",
Release: "2",
Prerelease: "beta1",
}
info = WithDefaults(info)
assert.Equal(t, "1.0.0", info.Version)
assert.Equal(t, "2", info.Release)
assert.Equal(t, "beta1", info.Prerelease)
assert.Equal(t, "xdg2", info.Deb.VersionMetadata)
}

func TestDefaults(t *testing.T) {
info := &Info{
Bindir: "/usr/bin",
Platform: "darwin",
Version: "2.4.1",
Description: "no description given",
Expand Down
1 change: 0 additions & 1 deletion rpm/rpm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ func exampleInfo() *nfpm.Info {
Homepage: "http://carlosbecker.com",
Vendor: "nope",
License: "MIT",
Bindir: "/usr/local/bin",
Overridables: nfpm.Overridables{
Depends: []string{
"bash",
Expand Down
7 changes: 7 additions & 0 deletions www/docs/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Contributing

This page will eventually have information for those who want to contribute
to the project.

Also check the [CONTRIBUTING.md](https://github.com/goreleaser/nfpm/blob/master/CONTRIBUTING.md)
file on the root of our repository.
15 changes: 15 additions & 0 deletions www/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Home

NFPM is a simple Deb and RPM packager without external dependencies.

![](https://user-images.githubusercontent.com/245435/36346100-eaaf24c0-141e-11e8-8345-100f4d3ed02d.png)

## Why

While [fpm][] is great, for me it is a bummer that it depends on `ruby`, `tar`
and other softwares.

I wanted something that could be used as a binary and/or as a library, so
I hacked this together - it works!

[fpm]: https://github.com/jordansissel/fpm
84 changes: 84 additions & 0 deletions www/docs/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Install

You can install the pre-compiled binary (in several different ways),
use Docker or compile from source.

Here are the steps for each of them:

## Install the pre-compiled binary

**homebrew tap** (only on macOS for now):

```console
$ brew install goreleaser/tap/nfpm
```

**scoop**:

```console
$ scoop bucket add goreleaser https://github.com/goreleaser/scoop-bucket.git
$ scoop install nfpm
```

**deb/rpm**:

Download the `.deb` or `.rpm` from the [releases page][releases] and
install with `dpkg -i` and `rpm -i` respectively.

**Shell script**:

```console
$ curl -sfL https://install.goreleaser.com/github.com/goreleaser/nfpm.sh | sh
```

**manually**:

Download the pre-compiled binaries from the [releases page][releases] and
copy to the desired location.

## 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:

```console
$ docker run --rm \
-v $PWD:/tmp/pkg \
goreleaser/nfpm pkg --config /tmp/pkg/foo.yml --target /tmp/pkg/foo.rpm
```

[releases]: https://github.com/goreleaser/nfpm/releases

## Compiling from source

Here you have two options:

If you want to contribute to the project, please follow the
steps on our [contributing guide](/contributing).

If you just want to build from source for whatever reason, follow these steps:

**Clone:**

```console
$ git clone https://github.com/goreleaser/nfpm
$ cd nfpm
```

**Get the dependencies:**

```console
$ go get ./...
```

**Build:**

```console
$ go build -o nfpm .
```

**Verify it works:**

```console
$ ./nfpm --version
```
46 changes: 46 additions & 0 deletions www/docs/sponsors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: Sponsors
---

Does your company use goreleaser? Help keep the project bug-free and feature rich by [sponsoring the project](https://opencollective.com/goreleaser#sponsor).

<a href="https://opencollective.com/goreleaser/sponsors/0/website" target="_blank"><img src="https://opencollective.com/goreleaser/sponsors/0/avatar"></a>
<a href="https://opencollective.com/goreleaser/sponsors/1/website" target="_blank"><img src="https://opencollective.com/goreleaser/sponsors/1/avatar"></a>
<a href="https://opencollective.com/goreleaser/sponsors/2/website" target="_blank"><img src="https://opencollective.com/goreleaser/sponsors/2/avatar"></a>
<a href="https://opencollective.com/goreleaser/sponsors/3/website" target="_blank"><img src="https://opencollective.com/goreleaser/sponsors/3/avatar"></a>
<a href="https://opencollective.com/goreleaser/sponsors/4/website" target="_blank"><img src="https://opencollective.com/goreleaser/sponsors/4/avatar"></a>

## Backers

Love our work and community? [Become a backer](https://opencollective.com/goreleaser).

<a href="https://opencollective.com/goreleaser/backers/0/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/0/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/1/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/1/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/2/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/2/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/3/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/3/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/4/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/4/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/5/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/5/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/6/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/6/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/7/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/7/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/8/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/8/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/9/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/9/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/10/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/10/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/11/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/11/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/12/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/12/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/13/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/13/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/14/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/14/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/15/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/15/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/16/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/16/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/17/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/17/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/18/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/18/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/19/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/19/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/20/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/20/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/21/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/21/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/22/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/22/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/23/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/23/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/24/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/24/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/25/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/25/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/26/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/26/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/27/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/27/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/28/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/28/avatar"></a>
<a href="https://opencollective.com/goreleaser/backers/29/website" target="_blank"><img src="https://opencollective.com/goreleaser/backers/29/avatar"></a>
Binary file added www/docs/static/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/docs/static/avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/docs/static/card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/docs/static/favicon.ico
Binary file not shown.
Binary file added www/docs/static/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading