From 1f8ab78bef53891784934803042bb53e43f4bddf Mon Sep 17 00:00:00 2001 From: Miles Garnsey <11435896+Miles-Garnsey@users.noreply.github.com> Date: Wed, 15 Jun 2022 10:58:39 +1000 Subject: [PATCH] Build Automation (#6) * More work on build actions, refining push. * Remove docker buildx stuff for first iteration of this repo. --- .github/workflows/release.yml | 26 ++++---------------------- Dockerfile | 1 + pulsar-cdc-testutil/app/build.gradle | 2 +- pulsar-cdc-testutil/settings.gradle | 2 +- 4 files changed, 7 insertions(+), 24 deletions(-) create mode 100644 Dockerfile diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 88ce61e..513826f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,15 +20,6 @@ jobs: distribution: temurin java-version: 11 cache: 'gradle' - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - name: Setup and execute Gradle 'build' task uses: gradle/gradle-build-action@v2 with: @@ -51,16 +42,7 @@ jobs: echo ::set-output name=sha_short::$(git rev-parse --short=8 ${{ github.sha }}) echo ::set-output name=tag_name::${GITHUB_REF#refs/tags/} echo "TARGET_VERSION=$(echo ${GITHUB_REF#refs/tags/} | awk '{print substr($0,2)}')" >> $GITHUB_ENV - - name: Build and push testutils - id: docker_build_testutils - uses: docker/build-push-action@v2 - with: - file: Dockerfile - build-args: | - VERSION=${{ env.TARGET_VERSION }} - context: . - push: ${{ !env.ACT }} - tags: k8ssandra/testutils:${{ steps.vars.outputs.tag_name}} - platforms: linux/amd64 - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + - name: Push testutils + shell: bash + run: | + docker push k8ssandra/testutils:${{ steps.vars.outputs.tag_name }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ccce82d --- /dev/null +++ b/Dockerfile @@ -0,0 +1 @@ +FROM hub.docker.com/k8ssandra/testutils:0.0.1 \ No newline at end of file diff --git a/pulsar-cdc-testutil/app/build.gradle b/pulsar-cdc-testutil/app/build.gradle index 5861419..7bec253 100644 --- a/pulsar-cdc-testutil/app/build.gradle +++ b/pulsar-cdc-testutil/app/build.gradle @@ -73,7 +73,7 @@ distributions { docker { - name "hub.docker.com/k8ssandra/testutils:${version}" + name "k8ssandra/testutils:${gradle.version}" copySpec.from("build/install").into(".") // dockerfile file('Dockerfile') // files tasks.distTar.outputs, "Dockerfile" diff --git a/pulsar-cdc-testutil/settings.gradle b/pulsar-cdc-testutil/settings.gradle index b4ed297..33ef6a1 100644 --- a/pulsar-cdc-testutil/settings.gradle +++ b/pulsar-cdc-testutil/settings.gradle @@ -8,5 +8,5 @@ */ rootProject.name = 'io.k8ssandra.pulsarcdctestutil' -var version = "v0.1.0" +gradle.ext.version = "v0.0.1" include('app')