From 6554eb933c7dff70a7e38bc796e231dc5831f895 Mon Sep 17 00:00:00 2001 From: Mohanachandran S Date: Wed, 11 Sep 2024 14:48:59 +0530 Subject: [PATCH] MOSIP-35671 - Merging java21 with develop Signed-off-by: Mohanachandran S --- .github/workflows/push-trigger.yml | 20 ++++++++--------- apitest/Dockerfile | 36 +++++++++++++----------------- apitest/pom.xml | 6 ++--- 3 files changed, 28 insertions(+), 34 deletions(-) diff --git a/.github/workflows/push-trigger.yml b/.github/workflows/push-trigger.yml index cfa3c20290..ae1272139f 100644 --- a/.github/workflows/push-trigger.yml +++ b/.github/workflows/push-trigger.yml @@ -94,7 +94,7 @@ jobs: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} build-maven-apitest-prereg: - uses: mosip/kattu/.github/workflows/maven-build.yml@master + uses: mosip/kattu/.github/workflows/maven-build.yml@master-java21 with: SERVICE_LOCATION: ./apitest BUILD_ARTIFACT: apitest-prereg @@ -108,7 +108,7 @@ jobs: publish_to_nexus_apitest_prereg: if: "${{ !contains(github.ref, 'master') && github.event_name != 'pull_request' && github.event_name != 'release' && github.event_name != 'prerelease' && github.event_name != 'publish' }}" needs: build-maven-apitest-prereg - uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master + uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master-java21 with: SERVICE_LOCATION: ./apitest secrets: @@ -128,12 +128,12 @@ jobs: SERVICE_LOCATION: apitest BUILD_ARTIFACT: apitest-prereg-local steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v1 + - uses: actions/checkout@v3 + - name: Set up JDK 21 + uses: actions/setup-java@v3 with: - ref: ${{ github.ref }} - java-version: 11 + distribution: 'temurin' + java-version: 21 server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml settings-path: ${{ github.workspace }} # location for the settings.xml file - name: Setup the settings file for ossrh server @@ -176,7 +176,7 @@ jobs: ONLY_DOCKER: true fail-fast: false name: ${{ matrix.SERVICE_NAME }} - uses: mosip/kattu/.github/workflows/docker-build.yml@master + uses: mosip/kattu/.github/workflows/docker-build.yml@master-java21 with: SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }} SERVICE_NAME: ${{ matrix.SERVICE_NAME }} @@ -191,7 +191,7 @@ jobs: sonar_analysis_apitest_prereg: needs: build-maven-apitest-prereg if: "${{ github.event_name != 'pull_request' }}" - uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master + uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master-java21 with: SERVICE_LOCATION: ./apitest secrets: @@ -201,4 +201,4 @@ jobs: OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }} OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} GPG_SECRET: ${{ secrets.GPG_SECRET }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} \ No newline at end of file diff --git a/apitest/Dockerfile b/apitest/Dockerfile index 70a5d4db26..30d50f0415 100644 --- a/apitest/Dockerfile +++ b/apitest/Dockerfile @@ -1,4 +1,4 @@ -FROM openjdk:11 +FROM mosipdev/openjdk-21-jre:latest ARG SOURCE ARG COMMIT_HASH @@ -23,32 +23,26 @@ ARG container_user_gid=1001 ARG KUBECTL_VERSION=1.22.9 -# install packages and create user -RUN apt-get -y update \ -&& apt-get install -y unzip jq \ -&& groupadd -g ${container_user_gid} ${container_user_group} \ -&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user} \ -&& curl -LO "https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl" \ -&& chmod +x kubectl \ -&& mv kubectl /usr/local/bin/ - # set working directory for the user WORKDIR /home/${container_user} ENV work_dir=/home/${container_user} -ADD ./apitest/target/ $work_dir - -ADD entrypoint.sh $work_dir/entrypoint.sh - -RUN chmod +x $work_dir/entrypoint.sh +# Combine all necessary files into a single COPY command +COPY ./apitest/target $work_dir/ +COPY entrypoint.sh $work_dir -#ADD ./testNgXmlFiles/ $work_dir/testNgXmlFiles/ - -# change permissions of file inside working dir -RUN chown -R ${container_user}:${container_user} /home/${container_user} /usr/local/openjdk-11/lib/security/cacerts - -RUN chmod 644 /usr/local/openjdk-11/lib/security/cacerts +# install packages and create user +RUN apt-get -y update \ +&& apt-get install -y unzip jq curl \ +&& groupadd -g ${container_user_gid} ${container_user_group} \ +&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/bash -m ${container_user} \ +&& curl -LO "https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl" \ +&& mkdir -p /home/${container_user} \ +&& chmod +x kubectl $work_dir/entrypoint.sh \ +&& mv kubectl /usr/local/bin/ \ +&& chown -R ${container_user}:${container_user} /home/${container_user} /etc/ssl/certs/java/cacerts \ +&& chmod 644 /etc/ssl/certs/java/cacerts # select container user for all tasks USER ${container_user_uid}:${container_user_gid} diff --git a/apitest/pom.xml b/apitest/pom.xml index d664950441..2e5aa737c5 100644 --- a/apitest/pom.xml +++ b/apitest/pom.xml @@ -37,8 +37,8 @@ UTF-8 - 11 - 11 + 21 + 21 3.8.0 3.0.2 3.1.0 @@ -265,4 +265,4 @@ - + \ No newline at end of file