forked from quic-go/quic-go
ci: also build the interop image on pull requests, but skip pushing (#5115)
* ci: also build the interop image on pull requests, but skip pushing * use checked out code for interop Docker build
This commit is contained in:
9
.github/workflows/build-interop-docker.yml
vendored
9
.github/workflows/build-interop-docker.yml
vendored
@@ -5,6 +5,7 @@ on:
|
|||||||
- master
|
- master
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
|
pull_request:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
@@ -23,6 +24,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
|
if: github.event_name == 'push'
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
@@ -41,9 +43,8 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
- uses: docker/build-push-action@v6
|
- uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: "{{defaultContext}}:interop"
|
context: "."
|
||||||
|
file: "interop/Dockerfile"
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: ${{ github.event_name == 'push' }}
|
||||||
build-args: |
|
|
||||||
GITREF=${{ steps.tag.outputs.gitref }}
|
|
||||||
tags: martenseemann/quic-go-interop:${{ steps.tag.outputs.tag }}
|
tags: martenseemann/quic-go-interop:${{ steps.tag.outputs.tag }}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ FROM martenseemann/quic-network-simulator-endpoint:latest AS builder
|
|||||||
ARG TARGETPLATFORM
|
ARG TARGETPLATFORM
|
||||||
RUN echo "TARGETPLATFORM: ${TARGETPLATFORM}"
|
RUN echo "TARGETPLATFORM: ${TARGETPLATFORM}"
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y wget tar git
|
RUN apt-get update && apt-get install -y wget tar git && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
ENV GOVERSION=1.24.0
|
ENV GOVERSION=1.24.0
|
||||||
|
|
||||||
@@ -18,13 +18,8 @@ ENV PATH="/go/bin:${PATH}"
|
|||||||
# build with --build-arg CACHEBUST=$(date +%s)
|
# build with --build-arg CACHEBUST=$(date +%s)
|
||||||
ARG CACHEBUST=1
|
ARG CACHEBUST=1
|
||||||
|
|
||||||
# build other branches / commits / tags using --build-arg GITREF="<git reference>"
|
COPY . /quic-go
|
||||||
ARG GITREF="master"
|
|
||||||
|
|
||||||
RUN git clone https://github.com/quic-go/quic-go
|
|
||||||
WORKDIR /quic-go
|
WORKDIR /quic-go
|
||||||
RUN git checkout ${GITREF}
|
|
||||||
RUN go get ./...
|
|
||||||
|
|
||||||
RUN git rev-parse HEAD | tee commit.txt
|
RUN git rev-parse HEAD | tee commit.txt
|
||||||
RUN go build -o server -ldflags="-X github.com/quic-go/quic-go/qlog.quicGoVersion=$(git describe --always --long --dirty)" interop/server/main.go
|
RUN go build -o server -ldflags="-X github.com/quic-go/quic-go/qlog.quicGoVersion=$(git describe --always --long --dirty)" interop/server/main.go
|
||||||
@@ -36,8 +31,8 @@ FROM martenseemann/quic-network-simulator-endpoint:latest
|
|||||||
WORKDIR /quic-go
|
WORKDIR /quic-go
|
||||||
|
|
||||||
COPY --from=builder /quic-go/commit.txt /quic-go/server /quic-go/client ./
|
COPY --from=builder /quic-go/commit.txt /quic-go/server /quic-go/client ./
|
||||||
|
COPY --from=builder /quic-go/interop/run_endpoint.sh ./
|
||||||
|
|
||||||
COPY run_endpoint.sh .
|
|
||||||
RUN chmod +x run_endpoint.sh
|
RUN chmod +x run_endpoint.sh
|
||||||
|
|
||||||
ENTRYPOINT [ "./run_endpoint.sh" ]
|
ENTRYPOINT [ "./run_endpoint.sh" ]
|
||||||
|
|||||||
Reference in New Issue
Block a user