From 6b9d595284d5376e415aa744b11fb7f1b9d91e53 Mon Sep 17 00:00:00 2001 From: Ljupcho Palashevski Date: Mon, 22 May 2023 13:06:01 +0200 Subject: [PATCH 1/3] Adjusting the docker and workflow actions. Signed-off-by: Ljupcho Palashevski --- .github/workflows/merge.yml | 12 ++++++------ .github/workflows/release.yml | 6 +++--- Dockerfile | 23 +++++++++++++---------- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 615252c..02d0152 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -73,9 +73,9 @@ jobs: tags: odpi/egeria-connector-jdbc:${{ env.CONNECTOR_VERSION }}, odpi/egeria-connector-jdbc:latest, quay.io/odpi/egeria-connector-jdbc:${{ env.CONNECTOR_VERSION }}, quay.io/odpi/egeria-connector-jdbc:latest platforms: linux/amd64,linux/arm64 build-args: | - EGERIA_BASE_IMAGE=${{ env.EGERIA_BASE_IMAGE }} - CONNECTOR_VERSION=${{ env.CONNECTOR_VERSION }} - EGERIA_VERSION=${{ env.EGERIA_VERSION }} + egeria_base_image=${{ env.EGERIA_BASE_IMAGE }} + connector_version=${{ env.CONNECTOR_VERSION }} + egeria_version=${{ env.EGERIA_VERSION }} - name: Build and push( to quay.io and docker.io (no tag latest) if: ${{ github.ref != 'refs/heads/main'}} uses: docker/build-push-action@v4 @@ -85,9 +85,9 @@ jobs: tags: odpi/egeria-connector-jdbc:${{ env.CONNECTOR_VERSION }}, quay.io/odpi/egeria-connector-jdbc:${{ env.CONNECTOR_VERSION }} platforms: linux/amd64,linux/arm64 build-args: | - EGERIA_BASE_IMAGE=${{ env.EGERIA_BASE_IMAGE }} - CONNECTOR_VERSION=${{ env.CONNECTOR_VERSION }} - EGERIA_VERSION=${{ env.EGERIA_VERSION }} + egeria_base_image=${{ env.EGERIA_BASE_IMAGE }} + connector_version=${{ env.CONNECTOR_VERSION }} + egeria_version=${{ env.EGERIA_VERSION }} # -- - name: Upload Connector uses: actions/upload-artifact@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 87c7cbe..5b0415b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,9 +69,9 @@ jobs: tags: odpi/egeria-connector-jdbc::${{ env.CONNECTOR_VERSION }}, quay.io/odpi/egeria-connector-jdbc:${{ env.CONNECTOR_VERSION }} platforms: linux/amd64,linux/arm64 build-args: | - EGERIA_BASE_IMAGE=${{ env.EGERIA_BASE_IMAGE }} - CONNECTOR_VERSION=${{ env.CONNECTOR_VERSION }} - EGERIA_VERSION=${{ env.EGERIA_VERSION }} + egeria_base_image=${{ env.EGERIA_BASE_IMAGE }} + connector_version=${{ env.CONNECTOR_VERSION }} + egeria_version=${{ env.EGERIA_VERSION }} # Upload the library so that build results can be viewed - name: Upload Connector uses: actions/upload-artifact@v3 diff --git a/Dockerfile b/Dockerfile index 4d770c4..6bdb440 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,16 @@ # SPDX-License-Identifier: Apache-2.0 # Copyright Contributors to the Egeria project -# This is the EGERIA version - typically passed from the ci/cd pipeline -ARG EGERIA_BASE_IMAGE=quay.io/odpi/egeria:latest -ARG EGERIA_VERSION=latest +# Image base default for building the connector image +ARG egeria_base_image=quay.io/odpi/egeria +# Egeria base image version to extend +ARG egeria_version=4.0 # Must be set to help get the right files for the connextors - -FROM ${EGERIA_BASE_IMAGE}:${EGERIA_VERSION} -ARG CONNECTOR_VERSION=0.1-SNAPSHOT +FROM ${egeria_base_image}:${egeria_version} +# Egeria connector default version, arg passed from ci/cd will overwrite this value +ARG connector_version=1.1 +# Default app user defined in the base redhat docker image ubi9/openjdk-17-runtime +ARG app_user=185 # Labels from https://github.com/opencontainers/image-spec/blob/master/annotations.md#pre-defined-annotation-keys (with additions prefixed ext) # We should inherit all the base labels from the egeria image and only overwrite what is necessary. @@ -17,10 +20,10 @@ LABEL org.opencontainers.image.description = "Egeria with JDBC connector" \ # This assumes we only have one uber jar (ensure old versions cleaned out beforehand). Avoids having to pass connector version # Note that we currently only build a simple jar. If additional dependencies are needed, a jar with dependencies will be needed, or the libraries will need to be added here -ENV CONNECTOR_VERSION ${CONNECTOR_VERSION} +ENV CONNECTOR_VERSION $connector_version -COPY jdbc-resource-connector/build/libs/egeria-connector-resource-jdbc-${CONNECTOR_VERSION}.jar /deployments/server/lib -COPY jdbc-integration-connector/build/libs/egeria-connector-integration-jdbc-${CONNECTOR_VERSION}.jar /deployments/server/lib +COPY jdbc-resource-connector/build/libs/egeria-connector-resource-jdbc-$connector_version.jar /deployments/server/lib +COPY jdbc-integration-connector/build/libs/egeria-connector-integration-jdbc-$connector_version.jar /deployments/server/lib # Add any additional, openly-licensable, connectors here - ensure licenses are added to the LICENSE-Docker.txt COPY LICENSE-Docker.txt /deployments/server/LICENSE-JDBC-3RD-PARTY.txt @@ -30,4 +33,4 @@ USER root RUN (cd /deployments/server/lib && curl -O -J https://jdbc.postgresql.org/download/postgresql-42.5.2.jar) # Restore the standard id for container execution -USER jboss +USER $app_user From b084df20deeb57c9545f21f66479d0e4a9114c1e Mon Sep 17 00:00:00 2001 From: Ljupcho Palashevski Date: Tue, 23 May 2023 20:20:14 +0200 Subject: [PATCH 2/3] release workdlow, fix docker tag name Signed-off-by: Ljupcho Palashevski --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5b0415b..981b574 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,7 +66,7 @@ jobs: with: context: . push: true - tags: odpi/egeria-connector-jdbc::${{ env.CONNECTOR_VERSION }}, quay.io/odpi/egeria-connector-jdbc:${{ env.CONNECTOR_VERSION }} + tags: odpi/egeria-connector-jdbc:${{ env.CONNECTOR_VERSION }}, quay.io/odpi/egeria-connector-jdbc:${{ env.CONNECTOR_VERSION }} platforms: linux/amd64,linux/arm64 build-args: | egeria_base_image=${{ env.EGERIA_BASE_IMAGE }} From 5609961a64a59e3ef18183269c9d038fbdbea68e Mon Sep 17 00:00:00 2001 From: Ljupcho Palashevski Date: Fri, 26 May 2023 14:09:02 +0200 Subject: [PATCH 3/3] Set correct snapshot versions Signed-off-by: Ljupcho Palashevski --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6bdb440..02311de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,11 +4,11 @@ # Image base default for building the connector image ARG egeria_base_image=quay.io/odpi/egeria # Egeria base image version to extend -ARG egeria_version=4.0 +ARG egeria_version=4.1-SNAPSHOT # Must be set to help get the right files for the connextors FROM ${egeria_base_image}:${egeria_version} # Egeria connector default version, arg passed from ci/cd will overwrite this value -ARG connector_version=1.1 +ARG connector_version=1.2-SNAPSHOT # Default app user defined in the base redhat docker image ubi9/openjdk-17-runtime ARG app_user=185