Skip to content

Adding SEED_PORT to have a port override alongside the existing SEED_… #200

Adding SEED_PORT to have a port override alongside the existing SEED_…

Adding SEED_PORT to have a port override alongside the existing SEED_… #200

name: build-publish-docker-image
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v2
with:
go-version: 1.21
id: go
- name: Set up Go for root
run: |
sudo ln -sf `which go` `sudo which go` || true
sudo go version
- uses: actions/checkout@v2
- name: get go version
run: go version
- name: Gofmt and License checks
run: make check
- name: unit tests
run: make test
- name: Get tag name
id: vars
run: |
ref=${GITHUB_REF:10}
ref="${ref////-}"
echo $ref
echo ::set-output name=tag::$ref
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push zookeeper Apache image
uses: docker/build-push-action@v5
if: ${{ startsWith(github.ref, 'refs/tags/zk') }}
with:
context: docker/zookeeper-image
platforms: linux/amd64,linux/arm64
tags: adobe/zookeeper:3.8.3-apache-${{ steps.vars.outputs.tag }}
push: ${{ startsWith(github.ref, 'refs/tags/zk') }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Build and push zookeeper image
if: ${{ !startsWith(github.ref, 'refs/tags/zk') }}
uses: docker/build-push-action@v5
with:
context: docker
platforms: linux/amd64,linux/arm64
tags: adobe/zookeeper:3.8.3-${{ steps.vars.outputs.tag }}
push: ${{ startsWith(github.ref, 'refs/tags/') && !startsWith(github.ref, 'refs/tags/zk') }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Build and push zookeeper-operator image
if: ${{ !startsWith(github.ref, 'refs/tags/zk') }}
uses: docker/build-push-action@v5
with:
context: .
tags: adobe/zookeeper-operator:${{ steps.vars.outputs.tag }}
push: ${{ startsWith(github.ref, 'refs/tags/') && !startsWith(github.ref, 'refs/tags/zk') }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}