Skip to content

Commit

Permalink
feat: add DockerHub builds [VAX-542] (#57)
Browse files Browse the repository at this point in the history
Publish tagged commits as images to docker hub

Co-authored-by: define-null <vasilii@electric-sql.com>
  • Loading branch information
icehaunter and define-null committed Feb 1, 2023
1 parent 7700ffb commit 20b50f7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 10 additions & 2 deletions .buildkite/build_vaxine.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
env:
DOCKER_REPO: europe-docker.pkg.dev/vaxine/vaxine-io
DOCKER_REPO: europe-docker.pkg.dev/vaxine/electric-sql
DOCKERHUB_REPO: electricsql
IMAGE_NAME: vaxine

agent:
Expand All @@ -9,4 +10,11 @@ agent:
steps:
- label: ":whale: Build & push the vaxine container"
command: make buildkite-build-and-push

- wait
- label: ":rocket: Publish the image to DockerHub"
if: build.tag =~ /^[0-9]+\.[0-9]+\.[0-9]+/
env:
DOCKER_REPO: electricsql
command:
- export ELECTRIC_IMAGE_NAME="${DOCKERHUB_REPO}/${IMAGE_NAME}"
- make buildkite-build-and-push
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,12 @@ docker-stop:
send-coverage:
${REBAR} as test coveralls send

ifdef BUILDKITE_COMMIT
IMAGE_TAG ?= $(shell git describe --abbrev=7 --tags --always --first-parent)
buildkite-build-and-push:
SHORTSHA=`echo "${BUILDKITE_COMMIT}" | head -c 7`; \
ARG=""; \
if [ "${BUILDKITE_BRANCH}" = "main" ]; then \
ARG="-t ${DOCKER_REPO}/${IMAGE_NAME}:latest"; \
fi; \
docker buildx build --platform linux/arm64/v8,linux/amd64 --push -f Dockerfile.vaxine $$ARG -t ${DOCKER_REPO}/${IMAGE_NAME}:$$SHORTSHA .
docker buildx build --platform linux/arm64/v8,linux/amd64 --push -f Dockerfile.vaxine $$ARG -t ${DOCKER_REPO}/${IMAGE_NAME}:${IMAGE_TAG} .
endif

0 comments on commit 20b50f7

Please sign in to comment.