Skip to content
Open
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
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
node_modules
npm-debug.log
Dockerfile*
docker-compose*
.dockerignore
.git
.gitignore
.gitattributes
.idea
README.md
LICENSE
.vscode
Makefile
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/gitlab-source-link-proxy*
.idea/
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

#build stage
FROM golang:stretch AS builder
ENV GO111MODULE=on
WORKDIR /go/src
COPY . .
RUN go get -v -d .
RUN go build -o gitlab-source-link-proxy .

#final stage
FROM ubuntu:latest
# RUN apk --no-cache add ca-certificates
COPY --from=builder /go/src /app
CMD ["/app/gitlab-source-link-proxy"]
LABEL Name=gitlab-source-link-proxy Version=0.0.1
EXPOSE 7000
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3.6'

services:
gitlab-source-link-proxy:
image: gitlab-source-link-proxy
environment:
- "GITLAB_BASE_URL=https://gitlab.example.com/"
- "LISTEN_ADDRESS=0.0.0.0:7000"
build: .
ports:
- 7000:7000
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ require (
github.com/jamiealquiza/bicache v2.0.0+incompatible
github.com/jamiealquiza/fnv v1.0.0 // indirect
github.com/jamiealquiza/tachymeter v1.1.2 // indirect
github.com/kouhin/envflag v0.0.0-20150818174321-0e9a86061649
golang.org/x/crypto v0.0.0-20180830192347-182538f80094
golang.org/x/sys v0.0.0-20180831094639-fa5fdf94c789 // indirect
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ github.com/jamiealquiza/fnv v1.0.0 h1:4NwlkaoZiLhqk008EY5+MTGVPRQZgRG/6B7+jN7ueT
github.com/jamiealquiza/fnv v1.0.0/go.mod h1:iJRnFlvFvZpWKZd+KljYXcyQLasMIKAVuQhx63P4DUk=
github.com/jamiealquiza/tachymeter v1.1.2 h1:cOgpMYFejxGSAe5f5JOb7uNPZ53kmEYwwpCrw1vDh2Q=
github.com/jamiealquiza/tachymeter v1.1.2/go.mod h1:Ayf6zPZKEnLsc3winWEXJRkTBhdHo58HODAu1oFJkYU=
github.com/kouhin/envflag v0.0.0-20150818174321-0e9a86061649 h1:l95EUBxc0iMtMeam3pHFb9jko9ntaLYe2Nc+2evKElM=
github.com/kouhin/envflag v0.0.0-20150818174321-0e9a86061649/go.mod h1:BT0PpXv8Y4EL/WUsQmYsQ2FSB9HwQXIuvY+pElZVdFg=
golang.org/x/crypto v0.0.0-20180830192347-182538f80094 h1:rVTAlhYa4+lCfNxmAIEOGQRoD23UqP72M3+rSWVGDTg=
golang.org/x/crypto v0.0.0-20180830192347-182538f80094/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/sys v0.0.0-20180831094639-fa5fdf94c789 h1:T8D7l6WB3tLu+VpKvw06ieD/OhBi1XpJmG1U/FtttZg=
Expand Down
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"strings"

"github.com/jamiealquiza/bicache"
"github.com/kouhin/envflag"
"golang.org/x/crypto/blake2b"
)

Expand Down Expand Up @@ -97,7 +98,9 @@ var (
)

func main() {
flag.Parse()
if err := envflag.Parse(); err != nil {
panic(err)
}

if *baseGitLabURLFlag == "" {
log.Printf("Usage of %s:\n", os.Args[0])
Expand Down