From 8723842057b7293c23aa5c4b3094b7e2cccc98ec Mon Sep 17 00:00:00 2001 From: VSIVAKALYAN Date: Thu, 9 May 2024 11:08:45 +0530 Subject: [PATCH] [DSD-5071] Setup for apitest-auth Signed-off-by: VSIVAKALYAN --- .github/workflows/push-trigger.yml | 52 ++++++++++++++++++++++++++++-- apitest/Dockerfile | 2 +- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/.github/workflows/push-trigger.yml b/.github/workflows/push-trigger.yml index b52d57c0ba6..60dffdcf184 100644 --- a/.github/workflows/push-trigger.yml +++ b/.github/workflows/push-trigger.yml @@ -116,14 +116,61 @@ jobs: GPG_SECRET: ${{ secrets.GPG_SECRET }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - build-dockers_apitest_auth: + build-apitest-auth-local: needs: build-maven-apitest-auth + runs-on: ubuntu-latest + env: + NAMESPACE: ${{ secrets.dev_namespace_docker_hub }} + SERVICE_NAME: apitest-auth + SERVICE_LOCATION: apitest + BUILD_ARTIFACT: apitest-auth-local + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + 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 " ossrh ${{secrets.ossrh_user}} ${{secrets.ossrh_secret}} ossrh true gpg2 ${{secrets.gpg_secret}} allow-snapshots true snapshots-repo https://oss.sonatype.org/content/repositories/snapshots false true releases-repo https://oss.sonatype.org/service/local/staging/deploy/maven2 true false sonar . https://sonarcloud.io false " > $GITHUB_WORKSPACE/settings.xml + - name: Build Automationtests with Maven + run: | + cd ${{ env.SERVICE_LOCATION}} + mvn clean package -s $GITHUB_WORKSPACE/settings.xml + - name: Copy configuration files to target directory. + run: | + cp -r ${{ env.SERVICE_LOCATION}}/target/classes/config ${{ env.SERVICE_LOCATION}}/target/config + cp -r ${{ env.SERVICE_LOCATION}}/testNgXmlFiles ${{ env.SERVICE_LOCATION}}/target/testNgXmlFiles + - name: Ready the springboot artifacts + if: ${{ !contains(github.ref, 'master') || !contains(github.ref, 'main') }} + run: | + ## FIND JARS & COPY ONLY EXECUTABLE JARs STORED UNDER TARGET DIRECTORY + find ${{ env.SERVICE_LOCATION }} -path '*/target/*' -exec zip ${{ env.BUILD_ARTIFACT }}.zip {} + + - name: Upload the springboot jars + if: ${{ !contains(github.ref, 'master') || !contains(github.ref, 'main') }} + uses: actions/upload-artifact@v3 + with: + name: ${{ env.BUILD_ARTIFACT }} + path: ${{ env.BUILD_ARTIFACT }}.zip + - uses: 8398a7/action-slack@v3 + with: + status: ${{ job.status }} + fields: repo,message,author,commit,workflow,job # selectable (default: repo,message) + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required + if: failure() # Pick up events even if the job fails or is canceled. + + build-dockers_apitest_auth: + needs: build-apitest-auth-local strategy: matrix: include: - SERVICE_LOCATION: 'apitest' SERVICE_NAME: 'apitest-auth' - BUILD_ARTIFACT: '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 @@ -131,6 +178,7 @@ jobs: SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }} SERVICE_NAME: ${{ matrix.SERVICE_NAME }} BUILD_ARTIFACT: ${{ matrix.BUILD_ARTIFACT }} + ONLY_DOCKER: ${{ matrix.ONLY_DOCKER }} secrets: DEV_NAMESPACE_DOCKER_HUB: ${{ secrets.DEV_NAMESPACE_DOCKER_HUB }} ACTOR_DOCKER_HUB: ${{ secrets.ACTOR_DOCKER_HUB }} diff --git a/apitest/Dockerfile b/apitest/Dockerfile index bc00e75899f..287c09bd25c 100644 --- a/apitest/Dockerfile +++ b/apitest/Dockerfile @@ -37,7 +37,7 @@ WORKDIR /home/${container_user} ENV work_dir=/home/${container_user} -ADD ./target/ $work_dir +ADD ./apitest/target/ $work_dir ADD entrypoint.sh $work_dir/entrypoint.sh