forked from Deuxfleurs/guichet
improve readme and nix file
This commit is contained in:
parent
6a399249b5
commit
917c10737d
3 changed files with 26 additions and 22 deletions
19
Makefile
19
Makefile
|
@ -1,19 +0,0 @@
|
||||||
BIN=guichet
|
|
||||||
SRC=main.go ssha.go profile.go admin.go invite.go directory.go picture.go
|
|
||||||
DOCKER=lxpz/guichet_amd64
|
|
||||||
|
|
||||||
all: $(BIN)
|
|
||||||
|
|
||||||
$(BIN): $(SRC)
|
|
||||||
go get -d -v
|
|
||||||
go build -v -o $(BIN)
|
|
||||||
|
|
||||||
$(BIN).static: $(SRC)
|
|
||||||
go get -d -v
|
|
||||||
CGO_ENABLED=0 GOOS=linux go build -a -v -o $(BIN).static
|
|
||||||
|
|
||||||
docker: $(BIN).static
|
|
||||||
docker build -t $(DOCKER):$(TAG) .
|
|
||||||
docker push $(DOCKER):$(TAG)
|
|
||||||
docker tag $(DOCKER):$(TAG) $(DOCKER):latest
|
|
||||||
docker push $(DOCKER):latest
|
|
18
README.md
18
README.md
|
@ -27,9 +27,23 @@ Guichet is licensed under the terms of the GPLv3.
|
||||||
|
|
||||||
Guichet requires go 1.13 or later.
|
Guichet requires go 1.13 or later.
|
||||||
|
|
||||||
To build Guichet, clone this repository outside of your `$GOPATH`.
|
Development build:
|
||||||
Then, run `make` in the root of the repo.
|
|
||||||
|
|
||||||
|
```
|
||||||
|
go build
|
||||||
|
```
|
||||||
|
|
||||||
|
Production build:
|
||||||
|
|
||||||
|
```
|
||||||
|
nix build
|
||||||
|
```
|
||||||
|
|
||||||
|
Production container:
|
||||||
|
|
||||||
|
```
|
||||||
|
docker run .#docker
|
||||||
|
```
|
||||||
|
|
||||||
## Configuration of Guichet
|
## Configuration of Guichet
|
||||||
|
|
||||||
|
|
11
flake.nix
11
flake.nix
|
@ -47,11 +47,20 @@
|
||||||
Entrypoint = "/bin/guichet";
|
Entrypoint = "/bin/guichet";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
docker = pkgs.writeScriptBin "guichet-docker" ''
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euxo pipefail
|
||||||
|
docker load <$(nix build --print-out-paths .#container)
|
||||||
|
'';
|
||||||
|
|
||||||
in {
|
in {
|
||||||
packages.x86_64-linux.guichet = guichet;
|
packages.x86_64-linux.guichet = guichet;
|
||||||
packages.x86_64-linux.container = container;
|
packages.x86_64-linux.container = container;
|
||||||
|
packages.x86_64-linux.docker = docker;
|
||||||
packages.x86_64-linux.default = guichet;
|
packages.x86_64-linux.default = guichet;
|
||||||
|
|
||||||
devShell.x86_64-linux = pkgs.mkShell { nativeBuildInputs = [ pkgs.go pkgs.gomod2nix ]; };
|
devShell.x86_64-linux = pkgs.mkShell { nativeBuildInputs = [ pkgs.go pkgs.gomod2nix ]; };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue