Skip to content

Commit

Permalink
MOSIP-34482 - Revert java21 (#1285)
Browse files Browse the repository at this point in the history
* MOSIP-34482 - Revert java21

Signed-off-by: Mohanachandran S <[email protected]>

* MOSIP-34482 - Revert java21

Signed-off-by: Mohanachandran S <[email protected]>

* MOSIP-34482 - Revert java21

Signed-off-by: Mohanachandran S <[email protected]>

* MOSIP-34482 - Revert java21

Signed-off-by: Mohanachandran S <[email protected]>

---------

Signed-off-by: Mohanachandran S <[email protected]>
  • Loading branch information
mohanachandran-s authored Jul 16, 2024
1 parent 772b2a4 commit b61b6aa
Show file tree
Hide file tree
Showing 3 changed files with 334 additions and 201 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/push-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

build-maven-apitest-resident:
uses: mosip/kattu/.github/workflows/maven-build.yml@master-java21
uses: mosip/kattu/.github/workflows/maven-build.yml@master
with:
SERVICE_LOCATION: ./apitest
BUILD_ARTIFACT: apitest-resident
Expand All @@ -99,12 +99,12 @@ jobs:
publish_to_nexus_apitest:
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-resident
uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master-java21
uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master
with:
SERVICE_LOCATION: ./apitest
secrets:
OSSRH_USER: ${{ secrets.OSSRH_USER1 }}
OSSRH_SECRET: ${{ secrets.OSSRH_SECRET1 }}
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }}
OSSRH_URL: ${{ secrets.OSSRH_SNAPSHOT_URL }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
Expand All @@ -119,15 +119,14 @@ jobs:
SERVICE_LOCATION: apitest
BUILD_ARTIFACT: apitest-resident-local
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
distribution: 'temurin'
java-version: '21'
ref: ${{ github.ref }}
java-version: 11
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
run: echo "<settings> <servers> <server> <id>ossrh</id> <username>${{secrets.ossrh_user}}</username> <password>${{secrets.ossrh_secret}}</password> </server> </servers> <profiles> <profile> <id>ossrh</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <gpg.executable>gpg2</gpg.executable> <gpg.passphrase>${{secrets.gpg_secret}}</gpg.passphrase> </properties> </profile> <profile> <id>allow-snapshots</id> <activation><activeByDefault>true</activeByDefault></activation> <repositories> <repository> <id>snapshots-repo</id> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases><enabled>false</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> <repository> <id>releases-repo</id> <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>false</enabled></snapshots> </repository> </repositories> </profile> <profile> <id>sonar</id> <properties> <sonar.sources>.</sonar.sources> <sonar.host.url>https://sonarcloud.io</sonar.host.url> </properties> <activation> <activeByDefault>false</activeByDefault> </activation> </profile> </profiles> </settings>" > $GITHUB_WORKSPACE/settings.xml
- name: Build Automationtests with Maven
Expand Down Expand Up @@ -168,7 +167,7 @@ jobs:
ONLY_DOCKER: true
fail-fast: false
name: ${{ matrix.SERVICE_NAME }}
uses: mosip/kattu/.github/workflows/docker-build.yml@master-java21
uses: mosip/kattu/.github/workflows/docker-build.yml@master
with:
SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }}
SERVICE_NAME: ${{ matrix.SERVICE_NAME }}
Expand All @@ -183,7 +182,7 @@ jobs:
sonar_analysis_apitest_resident:
needs: build-maven-apitest-resident
if: "${{ github.event_name != 'pull_request' }}"
uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master-java21
uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master
with:
SERVICE_LOCATION: ./apitest
secrets:
Expand Down
30 changes: 18 additions & 12 deletions apitest/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mosipdev/openjdk-21-jre:latest
FROM openjdk:11

ARG SOURCE
ARG COMMIT_HASH
Expand All @@ -23,6 +23,15 @@ 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}

Expand All @@ -32,17 +41,14 @@ ADD ./apitest/target/ $work_dir

ADD entrypoint.sh $work_dir/entrypoint.sh

# 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
RUN chmod +x $work_dir/entrypoint.sh

#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

# select container user for all tasks
USER ${container_user_uid}:${container_user_gid}
Expand Down
Loading

0 comments on commit b61b6aa

Please sign in to comment.