-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff0b7a8
commit 100bd16
Showing
19 changed files
with
768 additions
and
370 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
FROM golang:alpine AS builder | ||
|
||
ENV BINARY_FOLDER=bin | ||
ENV BINARY_NAME=gotcha | ||
ARG BINARY_FOLDER=bin | ||
ARG BINARY_NAME=gotcha | ||
ARG GOOS=linux | ||
ARG GOARCH=amd64 | ||
|
||
WORKDIR $GOPATH/gotcha | ||
COPY . $GOPATH/gotcha/ | ||
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/* | ||
RUN go fmt ./cmd/ ./pkg/config/ ./pkg/github/ | ||
RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -ldflags="-s -w" -o ${BINARY_FOLDER}/${BINARY_NAME} ./cmd/main.go | ||
FROM golang:1.18 AS builder | ||
|
||
ARG BINARY_FOLDER | ||
ARG BINARY_NAME | ||
ARG GOOS | ||
ARG GOARCH | ||
|
||
WORKDIR /app | ||
COPY . . | ||
RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -ldflags="-s -w" -o $BINARY_FOLDER/$BINARY_NAME . | ||
|
||
FROM gcr.io/distroless/base-debian10 | ||
|
||
ARG BINARY_FOLDER | ||
ARG BINARY_NAME | ||
|
||
WORKDIR / | ||
|
||
COPY --from=builder app/build/ build/ | ||
COPY --from=builder app/$BINARY_FOLDER/$BINARY_NAME gotcha | ||
|
||
EXPOSE 3000 | ||
ENTRYPOINT "${BINARY_FOLDER}/${BINARY_NAME}" | ||
ENTRYPOINT [ "/gotcha", "server"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,49 @@ | ||
module github.com/diegolnasc/gotcha | ||
|
||
go 1.17 | ||
go 1.18 | ||
|
||
require ( | ||
github.com/bradleyfalzon/ghinstallation/v2 v2.0.3 | ||
github.com/gin-gonic/gin v1.8.1 | ||
github.com/go-playground/webhooks/v6 v6.0.0-rc.1 | ||
github.com/google/go-github/v41 v41.0.0 | ||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c | ||
github.com/spf13/cobra v1.5.0 | ||
github.com/spf13/viper v1.13.0 | ||
) | ||
|
||
require ( | ||
github.com/fsnotify/fsnotify v1.5.4 // indirect | ||
github.com/gin-contrib/sse v0.1.0 // indirect | ||
github.com/go-playground/locales v0.14.0 // indirect | ||
github.com/go-playground/universal-translator v0.18.0 // indirect | ||
github.com/go-playground/validator/v10 v10.10.0 // indirect | ||
github.com/goccy/go-json v0.9.7 // indirect | ||
github.com/golang-jwt/jwt/v4 v4.0.0 // indirect | ||
github.com/google/go-github/v39 v39.0.0 // indirect | ||
github.com/google/go-querystring v1.1.0 // indirect | ||
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect | ||
github.com/hashicorp/hcl v1.0.0 // indirect | ||
github.com/inconshreveable/mousetrap v1.0.0 // indirect | ||
github.com/json-iterator/go v1.1.12 // indirect | ||
github.com/leodido/go-urn v1.2.1 // indirect | ||
github.com/magiconair/properties v1.8.6 // indirect | ||
github.com/mattn/go-isatty v0.0.14 // indirect | ||
github.com/mitchellh/mapstructure v1.5.0 // indirect | ||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
github.com/modern-go/reflect2 v1.0.2 // indirect | ||
github.com/pelletier/go-toml v1.9.5 // indirect | ||
github.com/pelletier/go-toml/v2 v2.0.5 // indirect | ||
github.com/spf13/afero v1.8.2 // indirect | ||
github.com/spf13/cast v1.5.0 // indirect | ||
github.com/spf13/jwalterweatherman v1.1.0 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
github.com/subosito/gotenv v1.4.1 // indirect | ||
github.com/ugorji/go/codec v1.2.7 // indirect | ||
golang.org/x/crypto v0.0.0-20221005025214-4161e89ecf1b // indirect | ||
golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect | ||
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec // indirect | ||
golang.org/x/text v0.3.7 // indirect | ||
google.golang.org/protobuf v1.28.0 // indirect | ||
gopkg.in/ini.v1 v1.67.0 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
Oops, something went wrong.