Skip to content

Commit

Permalink
Merge pull request #366 from sublime-security/cd.rework-mod
Browse files Browse the repository at this point in the history
Single Go Mod
  • Loading branch information
phutelmyer authored Apr 19, 2023
2 parents b14847f + b5c8ef1 commit 4b991d4
Show file tree
Hide file tree
Showing 16 changed files with 26 additions and 391 deletions.
5 changes: 3 additions & 2 deletions build/go/fileshot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ LABEL maintainer="Target Brands, Inc. [email protected]"

# Copy source files and set the working directory
COPY ./src/go/ /go/src/github.com/target/strelka/src/go/
WORKDIR /go/src/github.com/target/strelka/src/go/cmd/strelka-fileshot
WORKDIR /go/src/github.com/target/strelka/src/go/
COPY go.* /go/src/github.com/target/strelka

# Statically compile and output to tmp
RUN go mod download && \
CGO_ENABLED=0 go build -o /tmp/strelka-fileshot .
CGO_ENABLED=0 go build -o /tmp/strelka-fileshot cmd/strelka-fileshot/main.go

# Initialize runtime container
FROM alpine
Expand Down
5 changes: 3 additions & 2 deletions build/go/filestream/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ LABEL maintainer="Target Brands, Inc. [email protected]"

# Copy source files and set the working directory
COPY ./src/go/ /go/src/github.com/target/strelka/src/go/
WORKDIR /go/src/github.com/target/strelka/src/go/cmd/strelka-filestream
WORKDIR /go/src/github.com/target/strelka/src/go/
COPY go.* /go/src/github.com/target/strelka

# Statically compile and output to tmp
RUN go mod download && \
CGO_ENABLED=0 go build -o /tmp/strelka-filestream .
CGO_ENABLED=0 go build -o /tmp/strelka-filestream cmd/strelka-filestream/main.go

# Initialize runtime container
FROM alpine
Expand Down
5 changes: 3 additions & 2 deletions build/go/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ LABEL maintainer="Target Brands, Inc. [email protected]"

# Copy source files and set the working directory
COPY ./src/go/ /go/src/github.com/target/strelka/src/go/
WORKDIR /go/src/github.com/target/strelka/src/go/cmd/strelka-frontend
WORKDIR /go/src/github.com/target/strelka/src/go/
COPY go.* /go/src/github.com/target/strelka

# Statically compile and output to tmp
RUN go mod download && \
CGO_ENABLED=0 go build -o /tmp/strelka-frontend .
CGO_ENABLED=0 go build -o /tmp/strelka-frontend cmd/strelka-frontend/main.go

# Initialize runtime container
FROM alpine
Expand Down
5 changes: 3 additions & 2 deletions build/go/manager/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ LABEL maintainer="Target Brands, Inc. [email protected]"

# Copy source files and set the working directory
COPY ./src/go/ /go/src/github.com/target/strelka/src/go/
WORKDIR /go/src/github.com/target/strelka/src/go/cmd/strelka-manager
WORKDIR /go/src/github.com/target/strelka/src/go/
COPY go.* /go/src/github.com/target/strelka

# Statically compile and output to /tmp
RUN go mod download && \
CGO_ENABLED=0 go build -o /tmp/strelka-manager .
CGO_ENABLED=0 go build -o /tmp/strelka-manager cmd/strelka-manager/main.go

# Initialize runtime container with non-root user
FROM alpine
Expand Down
5 changes: 3 additions & 2 deletions build/go/oneshot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ LABEL maintainer="Target Brands, Inc. [email protected]"

# Copy source files and set the working directory
COPY ./src/go/ /go/src/github.com/target/strelka/src/go/
WORKDIR /go/src/github.com/target/strelka/src/go/cmd/strelka-oneshot
WORKDIR /go/src/github.com/target/strelka/src/go/
COPY go.* /go/src/github.com/target/strelka

# Statically compile and output to tmp
RUN go mod download && \
CGO_ENABLED=0 go build -o /tmp/strelka-oneshot .
CGO_ENABLED=0 go build -o /tmp/strelka-oneshot cmd/strelka-oneshot/main.go

# Initialize runtime container
FROM alpine
Expand Down
6 changes: 3 additions & 3 deletions src/go/cmd/strelka-frontend/go.mod → go.mod
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
module github.com/target/strelka/src/go/cmd/strelka-frontend
module github.com/target/strelka

go 1.19

require (
github.com/gabriel-vasile/mimetype v1.4.1
github.com/go-redis/redis/v8 v8.11.5
github.com/golang/protobuf v1.5.2
github.com/google/uuid v1.3.0
github.com/target/strelka v0.0.0-20221228161558-45c06949f7a9
google.golang.org/grpc v1.51.0
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/golang/protobuf v1.5.2 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
Expand Down
10 changes: 8 additions & 2 deletions src/go/cmd/strelka-frontend/go.sum → go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cu
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
github.com/gabriel-vasile/mimetype v1.4.1 h1:TRWk7se+TOjCYgRth7+1/OYLNiRNIotknkFtf/dnN7Q=
github.com/gabriel-vasile/mimetype v1.4.1/go.mod h1:05Vi0w3Y9c/lNvJOdmIwvrrAhX3rYhfQQCaf9VJcv7M=
github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=
github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
Expand Down Expand Up @@ -36,8 +38,6 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/target/strelka v0.0.0-20221228161558-45c06949f7a9 h1:g90FjdXpBYoO2Z9akyRhfysWvNqvUxgxcIF+ssP3PIQ=
github.com/target/strelka v0.0.0-20221228161558-45c06949f7a9/go.mod h1:TrUTi8JWPlUs67z/Wess97t6vyoCzvv3JyDOH1wd0Co=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
Expand All @@ -47,6 +47,7 @@ golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73r
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
Expand All @@ -55,11 +56,16 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
Expand Down
7 changes: 0 additions & 7 deletions go.work

This file was deleted.

19 changes: 0 additions & 19 deletions src/go/cmd/strelka-fileshot/go.mod

This file was deleted.

35 changes: 0 additions & 35 deletions src/go/cmd/strelka-fileshot/go.sum

This file was deleted.

18 changes: 0 additions & 18 deletions src/go/cmd/strelka-filestream/go.mod

This file was deleted.

Loading

0 comments on commit 4b991d4

Please sign in to comment.