Skip to content

Commit 936823a

Browse files
committed
improving doc and build
1 parent 17eba88 commit 936823a

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212
*.out
1313

1414
sync-ssh-keys
15+
sync-ssh-keys_*

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM golang:1.12-stretch AS builder
22

33
ENV GO111MODULE=on
4+
ENV CGO_ENABLED=0
45

56
# Download tools
67
RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.17.1
@@ -14,6 +15,7 @@ RUN make deps
1415
COPY . .
1516

1617
RUN make build
18+
1719
# Copy binary to alpine
1820
FROM alpine:3.10
1921
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ LDFLAGS=-ldflags "-X=main.Version=$(VERSION) -X=main.Build=$(BUILD_ID)"
1010
all: build
1111

1212
build:
13-
GO111MODULE=on go build -v $(LDFLAGS) -o $(BIN) $(SRC)
13+
CGO_ENABLED=0 GO111MODULE=on go build -v $(LDFLAGS) -o $(BIN) $(SRC)
1414

1515
docker-build:
1616
docker build -t $(DOCKER_IMAGE):${VERSION} .
1717

18-
release:
19-
GOOS=linux GOARCH=arm64 GO111MODULE=on go build $(LDFLAGS) -o $(BIN)_$(VERSION)_linux-amd64 $(SRC)
20-
GOOS=linux GOARCH=arm GO111MODULE=on go build $(LDFLAGS) -o $(BIN)_$(VERSION)_linux-arm $(SRC)
21-
GOOS=freebsd GOARCH=386 GO111MODULE=on go build $(LDFLAGS) -o $(BIN)_$(VERSION)_freebsd-386 $(SRC)
18+
release: deps
19+
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GO111MODULE=on go build $(LDFLAGS) -o $(BIN)_$(VERSION)_linux-amd64 $(SRC)
20+
CGO_ENABLED=0 GOOS=linux GOARCH=arm GO111MODULE=on go build $(LDFLAGS) -o $(BIN)_$(VERSION)_linux-arm $(SRC)
21+
CGO_ENABLED=0 GOOS=freebsd GOARCH=386 GO111MODULE=on go build $(LDFLAGS) -o $(BIN)_$(VERSION)_freebsd-386 $(SRC)
2222

2323
docker-release: docker-build
2424
docker push $(DOCKER_IMAGE):${VERSION}

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ $ curl -o /usr/local/bin/sync-ssh-keys \
1616
$ chmod +x /usr/local/bin/sync-ssh-keys
1717
```
1818

19+
or
20+
21+
```bash
22+
$ docker pull samber/sync-ssh-keys:0.3.0
23+
$ docker run --rm samber/sync-ssh-keys:0.3.0 --github-username samber
24+
```
25+
1926
### Sync using a crontask
2027

2128
```bash
@@ -38,11 +45,14 @@ usage: sync-ssh-keys [<flags>]
3845
Flags:
3946
--help Show context-sensitive help (also try --help-long and --help-man).
4047

48+
4149
-o, --output=OUTPUT Write output to <file>. Default to stdout
4250
--Werror=WERROR Treat warning as errors. Fatal error if organization, team or user does not exist.
4351

52+
4453
--local-path=LOCAL-PATH Path to a local authorized_keys file. It can be useful in case of network failure ;)
4554

55+
4656
--github-endpoint=GITHUB-ENDPOINT
4757
Github Enterprise endpoint.
4858
--github-token=GITHUB-TOKEN
@@ -55,6 +65,7 @@ Flags:
5565
--exclude-github-username=EXCLUDE-GITHUB-USERNAME ...
5666
Username(s) to explicitly exclude.
5767

68+
5869
--gitlab-endpoint=GITLAB-ENDPOINT
5970
Gitlab endpoint.
6071
--gitlab-token=GITLAB-TOKEN
@@ -66,8 +77,8 @@ Flags:
6677
--exclude-gitlab-username=EXCLUDE-GITLAB-USERNAME ...
6778
Username(s) to explicitly exclude.
6879

69-
--version Show application version.
7080

81+
--version Show application version.
7182
```
7283
7384
### Simple user

0 commit comments

Comments
 (0)