Skip to content

Commit c02ba5d

Browse files
committed
feat: add Athens Go proxy configuration for docker, GitHub actions
1 parent 15c2bc7 commit c02ba5d

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

.github/workflows/go-checks.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ jobs:
1313
- name: Checkout code
1414
uses: actions/checkout@v4
1515

16+
- name: Configure Go environment with access to private modules
17+
uses: cultureamp/go-private-modules@v1
18+
with:
19+
github-token: "${{ secrets.GO_PRIVATE_MODULES_TOKEN }}"
20+
1621
- uses: actions/setup-go@v5
1722
with:
1823
go-version-file: src/go.mod
@@ -27,6 +32,11 @@ jobs:
2732
- name: Checkout code
2833
uses: actions/checkout@v4
2934

35+
- name: Configure Go environment with access to private modules
36+
uses: cultureamp/go-private-modules@v1
37+
with:
38+
github-token: "${{ secrets.GO_PRIVATE_MODULES_TOKEN }}"
39+
3040
- uses: actions/setup-go@v5
3141
with:
3242
go-version-file: src/go.mod
@@ -45,6 +55,11 @@ jobs:
4555
- name: Checkout code
4656
uses: actions/checkout@v4
4757

58+
- name: Configure Go environment with access to private modules
59+
uses: cultureamp/go-private-modules@v1
60+
with:
61+
github-token: "${{ secrets.GO_PRIVATE_MODULES_TOKEN }}"
62+
4863
- uses: actions/setup-go@v5
4964
with:
5065
go-version-file: src/go.mod

docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,11 @@ services:
99
image: buildkite/plugin-tester:v4.0.0
1010
volumes:
1111
- ".:/plugin"
12+
build:
13+
build:
14+
context: src
15+
dockerfile: Dockerfile
16+
args:
17+
- GONOPROXY
18+
- GOPRIVATE
19+
- GOPROXY

src/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ ARG DISTROLESS_IMAGE=gcr.io/distroless/static
33

44
FROM ${BUILDER_IMAGE} as builder
55

6+
ARG NETSKOPE_CERT
7+
RUN if [ "${NETSKOPE_CERT}z" != "z" ]; then \
8+
echo "Installing Netskope MitM certificates" && \
9+
mkdir -p /usr/local/share/ca-certificates || true && \
10+
echo "${NETSKOPE_CERT}" >> /etc/ssl/certs/ca-certificates.crt && \
11+
echo "${NETSKOPE_CERT}" >> /usr/local/share/ca-certificates/netskope.crt && \
12+
apk --no-cache add ca-certificates && \
13+
update-ca-certificates; \
14+
fi
15+
616
# Ensure ca-certficates are up to date
717
RUN update-ca-certificates
818

@@ -15,6 +25,10 @@ RUN go mod verify
1525

1626
COPY . ./
1727

28+
ARG GONOPROXY
29+
ARG GOPRIVATE
30+
ARG GOPROXY
31+
1832
# build as a static binary without debug symbols
1933
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
2034
-ldflags='-w -s -extldflags "-static"' -a \

0 commit comments

Comments
 (0)