49: Use a Personal Access Token to access private modulees.
Some checks failed
Test / Run unit tests (pull_request) Failing after 47s
Test / Run integration tests (pull_request) Failing after 21s

This commit is contained in:
Thomas E Lackey 2023-07-06 14:52:36 -05:00
parent 4b916f6848
commit 252a4015c4

View File

@ -3,23 +3,21 @@ FROM golang:1.20-alpine as builder
RUN apk add --no-cache gcc musl-dev binutils-gold linux-headers git
# Configure creds for gitea
ARG GITEA_TOKEN
RUN echo $GITEA_TOKEN > ~/.token
RUN git config --global credential.username _ # ignored, but prevents prompt
RUN git config --global credential.helper \
'!f() { test "$1" = get && echo "password=$(cat $HOME/.token)"; }; f'
WORKDIR /plugeth-statediff/
ARG gitea_access_token
ENV GITEA_ACCESS_TOKEN=$gitea_access_token
# Get and cache deps
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY go.mod /plugeth-statediff/
COPY go.sum /plugeth-statediff/
RUN if [ -n "$GITEA_ACCESS_TOKEN" ]; then git config --global url."https://$GITEA_ACCESS_TOKEN:@git.vdb.to/".insteadOf "https://git.vdb.to/"; fi && \
cd /plugeth-statediff && \
go mod download && \
rm -f ~/.gitconfig
ADD . .
RUN go build --tags linkgeth --buildmode=plugin --trimpath -o statediff.so ./main
ADD . /plugeth-statediff
RUN cd /plugeth-statediff && \
go build --tags linkgeth --buildmode=plugin --trimpath -o statediff.so ./main
FROM alpine:latest
FROM alpine:3.18
COPY --from=builder /plugeth-statediff/statediff.so /usr/local/lib/