Skip to content

Commit

Permalink
Try Go CL 525455
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Sep 8, 2023
1 parent 9a74d63 commit d73ec2c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
run: |
docker run --platform=${{matrix.platform}} --rm \
$(jq -r '."builder-${{matrix.variant}}"."containerimage.config.digest"' <<< $METADATA) \
"sh -c 'frankenphp version && go test ${{matrix.race}} -v ./... && cd caddy && go test ${{matrix.race}} -v ./...'"
"sh -c 'frankenphp version && gotip test ${{matrix.race}} -v ./... && cd caddy && gotip test ${{matrix.race}} -v ./...'"
env:
METADATA: ${{steps.build.outputs.metadata}}

Expand Down
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,23 @@ RUN apt-get update && \
libssl-dev \
libxml2-dev \
zlib1g-dev \
# Needed by gotip
git \
&& \
apt-get clean

RUN GOBIN=/usr/local/go/bin go install golang.org/dl/gotip@latest && \
yes | gotip download 525455

WORKDIR /go/src/app

COPY go.mod go.sum ./
RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get
RUN gotip mod graph | awk '{if ($1 !~ "@") print $2}' | xargs gotip get

RUN mkdir caddy && cd caddy
COPY caddy/go.mod caddy/go.sum ./caddy/

RUN cd caddy && go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get
RUN cd caddy && gotip mod graph | awk '{if ($1 !~ "@") print $2}' | xargs gotip get

COPY *.* ./
COPY caddy caddy
Expand All @@ -44,7 +49,7 @@ COPY testdata testdata
ENV CGO_LDFLAGS="-lssl -lcrypto -lreadline -largon2 -lcurl -lonig -lz $PHP_LDFLAGS" CGO_CFLAGS=$PHP_CFLAGS CGO_CPPFLAGS=$PHP_CPPFLAGS

RUN cd caddy/frankenphp && \
go build -ldflags "-X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP $FRANKENPHP_VERSION Caddy'" && \
gotip build -ldflags "-X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP $FRANKENPHP_VERSION Caddy'" && \
cp frankenphp /usr/local/bin && \
cp /go/src/app/caddy/frankenphp/Caddyfile /etc/Caddyfile

Expand Down
14 changes: 10 additions & 4 deletions alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,23 @@ RUN apk add --no-cache --virtual .build-deps \
oniguruma-dev \
openssl-dev \
readline-dev \
sqlite-dev
sqlite-dev \
# Needed by gotip
git \
bash

RUN GOBIN=/usr/local/go/bin go install golang.org/dl/gotip@latest && \
yes | gotip download 525455

WORKDIR /go/src/app

COPY go.mod go.sum ./
RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get
RUN gotip mod graph | awk '{if ($1 !~ "@") print $2}' | xargs gotip get

RUN mkdir caddy && cd caddy
COPY caddy/go.mod caddy/go.sum ./caddy/

RUN cd caddy && go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get
RUN cd caddy && gotip mod graph | awk '{if ($1 !~ "@") print $2}' | xargs gotip get

COPY *.* ./
COPY caddy caddy
Expand All @@ -43,7 +49,7 @@ COPY testdata testdata
ENV CGO_LDFLAGS="-lssl -lcrypto -lreadline -largon2 -lcurl -lonig -lz $PHP_LDFLAGS" CGO_CFLAGS=$PHP_CFLAGS CGO_CPPFLAGS=$PHP_CPPFLAGS

RUN cd caddy/frankenphp && \
go build -ldflags "-X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP $FRANKENPHP_VERSION Caddy'" && \
gotip build -ldflags "-X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP $FRANKENPHP_VERSION Caddy'" && \
cp frankenphp /usr/local/bin && \
cp /go/src/app/caddy/frankenphp/Caddyfile /etc/Caddyfile

Expand Down

0 comments on commit d73ec2c

Please sign in to comment.