Skip to content

Commit

Permalink
Change submodule rather than whole new checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
Sushisource committed Dec 6, 2022
1 parent 9f4e454 commit 239c603
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/docker-build-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ jobs:
submodules: "true"

- name: Checkout temporal server repository
uses: actions/checkout@v3
with:
repository: ${{ inputs.temporal-server-repo-path }}
path: temporal-server-checkedout
ref: ${{ inputs.temporal-server-repo-ref }}
run: |
git submodule set-url temporal ${{ format('https://github.com/{0}', inputs.temporal-server-repo-path) }}
cd temporal
git fetch
git checkout ${{ inputs.temporal-server-repo-ref }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -53,9 +53,6 @@ jobs:
with:
context: .
file: server.Dockerfile
build-args: |
TEMPORAL_REPO_PATH=temporal-server-checkedout
GOFLAGS=-buildvcs=false
tags: localhost:5000/temporal-server:latest
push: true

Expand All @@ -65,9 +62,7 @@ jobs:
context: .
file: admin-tools.Dockerfile
build-args: |
TEMPORAL_REPO_PATH=temporal-server-checkedout
SERVER_IMAGE=localhost:5000/temporal-server:latest
GOFLAGS=-buildvcs=false
tags: localhost:5000/temporal-admin-tools:latest
push: true

Expand Down
10 changes: 5 additions & 5 deletions admin-tools.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ ARG GOPROXY

##### Temporal Admin Tools builder #####
FROM ${BASE_BUILDER_IMAGE} AS admin-tools-builder
ARG TEMPORAL_REPO_PATH=temporal
ARG GOFLAGS
ENV GOFLAGS ${GOFLAGS}

WORKDIR /home/builder

# cache Temporal packages as a docker layer
COPY ./${TEMPORAL_REPO_PATH}/go.mod ./${TEMPORAL_REPO_PATH}/go.sum ./temporal/
COPY ./temporal/go.mod ./temporal/go.sum ./temporal/
RUN (cd ./temporal && go mod download all)

# build
COPY ./${TEMPORAL_REPO_PATH} ./temporal
COPY ./temporal ./temporal
# Git info is needed for Go build to attach VCS information properly
COPY ./.git ./.git
COPY ./.gitmodules ./.gitmodules
RUN (cd ./temporal && make temporal-cassandra-tool temporal-sql-tool tdbg)


Expand Down
10 changes: 5 additions & 5 deletions server.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ ARG BASE_SERVER_IMAGE=temporalio/base-server:1.12.0

##### Builder #####
FROM ${BASE_BUILDER_IMAGE} AS temporal-builder
ARG TEMPORAL_REPO_PATH=temporal
ARG GOFLAGS
ENV GOFLAGS ${GOFLAGS}

WORKDIR /home/builder

# cache Temporal packages as a docker layer
COPY ./${TEMPORAL_REPO_PATH}/go.mod ./${TEMPORAL_REPO_PATH}/go.sum ./temporal/
COPY ./temporal/go.mod ./temporal/go.sum ./temporal/
RUN (cd ./temporal && go mod download all)

# cache tctl packages as a docker layer
Expand All @@ -19,7 +16,10 @@ RUN (cd ./tctl && go mod download all)

# build
COPY ./tctl ./tctl
COPY ./${TEMPORAL_REPO_PATH} ./temporal
COPY ./temporal ./temporal
# Git info is needed for Go build to attach VCS information properly
COPY ./.git ./.git
COPY ./.gitmodules ./.gitmodules
RUN (cd ./temporal && make temporal-server)
RUN (cd ./tctl && make build)

Expand Down

0 comments on commit 239c603

Please sign in to comment.