Skip to content

Commit

Permalink
MOSIP-36198
Browse files Browse the repository at this point in the history
Signed-off-by: Sohan Kumar Dey <[email protected]>
  • Loading branch information
Sohandey committed Oct 1, 2024
2 parents 2a9315d + 041aac1 commit 41cbabb
Show file tree
Hide file tree
Showing 398 changed files with 1,902 additions and 1,630 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/push-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ jobs:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

build-maven-apitest-auth:
uses: mosip/kattu/.github/workflows/maven-build.yml@master
uses: mosip/kattu/.github/workflows/maven-build.yml@master-java21
with:
SERVICE_LOCATION: ./apitest
SERVICE_LOCATION: ./api-test
BUILD_ARTIFACT: apitest-auth
secrets:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
Expand All @@ -105,9 +105,9 @@ jobs:
publish_to_nexus_apitest_auth:
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-auth
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
SERVICE_LOCATION: ./api-test
secrets:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }}
Expand All @@ -122,15 +122,15 @@ jobs:
env:
NAMESPACE: ${{ secrets.dev_namespace_docker_hub }}
SERVICE_NAME: apitest-auth
SERVICE_LOCATION: apitest
SERVICE_LOCATION: api-test
BUILD_ARTIFACT: apitest-auth-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
Expand Down Expand Up @@ -167,13 +167,13 @@ jobs:
strategy:
matrix:
include:
- SERVICE_LOCATION: 'apitest'
- SERVICE_LOCATION: 'api-test'
SERVICE_NAME: 'apitest-auth'
BUILD_ARTIFACT: 'apitest-auth-local'
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 }}
Expand All @@ -188,14 +188,14 @@ jobs:
sonar_analysis_apitest_auth:
needs: build-maven-apitest-auth
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
SERVICE_LOCATION: ./api-test
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
ORG_KEY: ${{ secrets.ORG_KEY }}
OSSRH_USER: ${{ secrets.OSSRH_USER }}
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 }}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 14 additions & 14 deletions apitest/Dockerfile → api-test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openjdk:11
FROM mosipdev/openjdk-21-jre:latest

ARG SOURCE
ARG COMMIT_HASH
Expand Down Expand Up @@ -29,23 +29,23 @@ WORKDIR /home/${container_user}
ENV work_dir=/home/${container_user}

# Combine all necessary files into a single COPY command
COPY ./apitest/target $work_dir/
COPY ./api-test/target $work_dir/
COPY application.properties $work_dir
COPY ["Biometric Devices", "$work_dir/Biometric Devices"]
COPY ["resource", "$work_dir/resource"]
COPY entrypoint.sh $work_dir

# Combine all RUN commands into a single layer
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/ && \
chown -R ${container_user}:${container_user} /home/${container_user} /usr/local/openjdk-11/lib/security/cacerts && \
chmod 644 /usr/local/openjdk-11/lib/security/cacerts && \
chmod +x $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


#select container user for all tasks
Expand All @@ -60,4 +60,4 @@ ENV ENV_USER=
ENV ENV_ENDPOINT=
ENV ENV_TESTLEVEL=smokeAndRegression

ENTRYPOINT ["./entrypoint.sh"]
ENTRYPOINT ["./entrypoint.sh"]
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions api-test/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

## Run automationtests
java -Dmodules="$MODULES" -Denv.user="$ENV_USER" -Denv.endpoint="$ENV_ENDPOINT" -Denv.testLevel="$ENV_TESTLEVEL" -jar apitest-auth-*-jar-with-dependencies.jar;
Loading

0 comments on commit 41cbabb

Please sign in to comment.