Skip to content

Commit f6e6f5e

Browse files
authored
Run gothanks using docker (#10)
1 parent bf5ade3 commit f6e6f5e

5 files changed

Lines changed: 53 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,19 @@ jobs:
5353
- run: |
5454
go get -u github.com/mfridman/tparse
5555
go test -v -race -cover -json ./... | $(go env GOPATH)/bin/tparse -all
56+
docker:
57+
strategy:
58+
matrix:
59+
go-version: [1.14.x]
60+
platform: [ubuntu-latest]
61+
name: docker
62+
runs-on: ${{ matrix.platform }}
63+
steps:
64+
- uses: actions/checkout@v1
65+
with:
66+
fetch-depth: 1
67+
- uses: actions/setup-go@v1
68+
with:
69+
go-version: ${{ matrix.go-version }}
70+
- run: |
71+
docker build -t psampaz/gothanks .

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
gothanks
1+
.idea
2+
gothanks

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
55

6-
## [0.2.0] - 2019-11-18
6+
## [v0.3.0] - 2020-04-12
7+
### Added
8+
- Run gothanks using docker
9+
### Fixed
10+
- Allow github repos with . and _ in the url
11+
12+
## [v0.2.0] - 2019-11-18
713
### Added
814
- Run it on non-interactive environments using `-y` flag
915

10-
## [0.1.0] - 2019-11-12
16+
## [v0.1.0] - 2019-11-12
1117
### Added
1218
- Initial release

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM golang:1.14.2-alpine3.11
2+
RUN apk update
3+
RUN apk add --no-cache git
4+
RUN apk --update add ca-certificates
5+
WORKDIR /home
6+
COPY ./ .
7+
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w" -o gothanks .
8+
9+
FROM scratch
10+
WORKDIR /home/
11+
COPY --from=0 /home/gothanks /usr/bin/
12+
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
13+
ENTRYPOINT ["gothanks"]

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,20 @@ or
4545
$ export GITHUB_TOKEN=xxxxx
4646
$ ./gothanks
4747
```
48+
## Docker
49+
50+
Run
51+
52+
```
53+
docker run -it --rm -v $(pwd):/home psampaz/gothanks:latest -github-token=xxxxxx
54+
```
55+
56+
or
57+
58+
```
59+
docker run -it --rm -v $(pwd):/home --env GITHUB_TOKEN=xxxxxx psampaz/gothanks:latest
60+
```
61+
4862
# Example
4963

5064
```go

0 commit comments

Comments
 (0)