From b045fc557db50a0843d5b30f99c807115b2c313f Mon Sep 17 00:00:00 2001 From: bhumi46 Date: Wed, 25 Oct 2023 16:45:53 +0530 Subject: [PATCH] [MOSIP-29256] updated reusable worklows Signed-off-by: bhumi46 --- .github/keys/mosipgpgkey_pub.gpg | Bin 0 -> 1270 bytes .github/keys/mosipgpgkey_sec.gpg | Bin 0 -> 2663 bytes .github/workflows/push-trigger.yml | 185 ++++++++++ .github/workflows/push_trigger.yml | 347 ------------------ .github/workflows/release-changes.yml | 29 ++ .github/workflows/tag.yml | 35 ++ mosip-acceptance-tests/ivv-core/pom.xml | 39 +- mosip-acceptance-tests/ivv-dg/pom.xml | 10 +- .../ivv-orchestrator/pom.xml | 228 ++++++------ mosip-acceptance-tests/ivv-parser/pom.xml | 6 +- mosip-acceptance-tests/pom.xml | 96 ++++- mosip-packet-creator/pom.xml | 268 +++++++++----- mosipTestDataProvider/pom.xml | 96 +++-- pom.xml | 20 + 14 files changed, 757 insertions(+), 602 deletions(-) create mode 100644 .github/keys/mosipgpgkey_pub.gpg create mode 100644 .github/keys/mosipgpgkey_sec.gpg create mode 100644 .github/workflows/push-trigger.yml delete mode 100644 .github/workflows/push_trigger.yml create mode 100644 .github/workflows/release-changes.yml create mode 100644 .github/workflows/tag.yml diff --git a/.github/keys/mosipgpgkey_pub.gpg b/.github/keys/mosipgpgkey_pub.gpg new file mode 100644 index 0000000000000000000000000000000000000000..4bdb1a947beaa877a93b56a2074580cdd9bf0578 GIT binary patch literal 1270 zcmbQq$jcHZy2y@^gW*i(B_ZoOO}xok8QrJ7Cf&}qetdqLrPuP}`P;)T-Y(VI_HkO_ z1{{w_f#RHj!qd-^bJoQmWM7;XW@lbzf|A4J(W)_uZi-T`J_?5k8I!A{8+V6Y2-?iCh1xP-B zIq6E*9lP}7Ro)kBJiO-Q-t)Wj;Fy-k3!e44+^24G7$(eOmrP(w-?^yl?-s_Lj~{U? z|Iz2Tvh0=vd*g}qnQnX5u8!QgWqQ&|20=y!#w{MX`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E>^;uadQ#c9W8g|zMh*3bK#`K#(s)v|$Zi0qYoEh$$vgd(`ZQsW8>qe*C+)iVx)hWwg)zdwrEa{_G%_ z68Tp`giRFXQ_-f#h=?wT!d?kWbu-nR(edIm3M}h0=65#1d;N)74v&nWsbc$;;htvro%w;%G@v${ z*xxkDfW&$JAAsQh1+d5t!cvf!{3_=ofw(Xpom#0t9iu(hPFsH83m4iS5Xy;ra{iP~ z?1`I{(IE{)wYI0 zp?Lro`tclyiF&K_MBTH9kbUsg=yu-maA!*_U*}`HPj-_Wbh&ke5YP9M2PwKR~+0n z`yU!zDyk)lFb4N<72OjB)L)J#F`fE*5><~{u0AZpb_3h}4U&GS>wU*FJ#yt)=4Y@a SkkiE(Bh1Lh;14qU=Klc8TJt&p literal 0 HcmV?d00001 diff --git a/.github/workflows/push-trigger.yml b/.github/workflows/push-trigger.yml new file mode 100644 index 000000000..f038cd1cd --- /dev/null +++ b/.github/workflows/push-trigger.yml @@ -0,0 +1,185 @@ +name: Maven Package upon a push + +on: + release: + types: [published] + pull_request: + types: [opened, reopened, synchronize] + workflow_dispatch: + inputs: + message: + description: 'Message for manually triggering' + required: false + default: 'Triggered for Updates' + type: string + push: + branches: + - '!release-branch' + - release* + - master + - 1.* + - develop + - MOSIP* +jobs: + build-maven-automationtest: + uses: mosip/kattu/.github/workflows/maven-build.yml@master + with: + SERVICE_LOCATION: ./ + BUILD_ARTIFACT: automationtest + secrets: + 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 }} + build-automationtests-local: + needs: build-maven-automationtest + runs-on: ubuntu-latest + env: + NAMESPACE: ${{ secrets.dev_namespace_docker_hub }} + SERVICE_NAME: mosip-acceptance-tests + SERVICE_LOCATION: mosip-acceptance-tests + BUILD_ARTIFACT: mosip-acceptance-tests + 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: | + cd ./${{env.SERVICE_LOCATION}} + mkdir build_files + cp $( find -name 'dslrig-ivv-orchestrator-*-dependencies.jar' -type f ) build_files + cp -r ./ivv-orchestrator/target/classes/config build_files/ + cp -r ./ivv-orchestrator/target/classes/local build_files/ + cp -r ./ivv-orchestrator/src/main/resources/local/scenarios scenarios + zip -r ${{env.BUILD_ARTIFACT}}.zip build_files/* scenarios/ + - 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 + cd ${{ env.SERVICE_LOCATION }} && find ./ -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.SERVICE_LOCATION }}/${{ 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-dsl-orchestrator-docker: + needs: build-automationtests-local + strategy: + matrix: + include: + - SERVICE_LOCATION: 'mosip-acceptance-tests/ivv-orchestrator' + SERVICE_NAME: 'dsl-orchestrator' + BUILD_ARTIFACT: 'mosip-acceptance-tests' + ONLY_DOCKER: true + fail-fast: false + name: ${{ matrix.SERVICE_NAME }} + uses: mosip/kattu/.github/workflows/docker-build.yml@master + with: + 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 }} + RELEASE_DOCKER_HUB: ${{ secrets.RELEASE_DOCKER_HUB }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + ## Recreate zips to provide support for docker unzip operation + recreate-packet-creator-zips: + needs: build-maven-automationtest + runs-on: ubuntu-latest + env: + BUILD_ARTIFACT: automationtest + NEW_BUILD_ARTIFACT: mosip-packet-creator + ZIP_FILE_NAME: mosippacketcreator + SERVICE_LOCATION: mosip-packet-creator + CONFIG_LOCATION: 'src/main/resources/dockersupport/centralized/mosip-packet-creator' + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + if: ${{ ( env.BUILD_ARTIFACT != 'false' ) }} + with: + name: ${{ env.BUILD_ARTIFACT }} + path: ./ + - name: recreate zip + run: | + unzip -uj "${{ env.BUILD_ARTIFACT }}.zip" -d "${{ env.SERVICE_LOCATION }}/" + + cd ./${{env.SERVICE_LOCATION}} + mkdir -p build_files/config + cp $( find -name 'dslrig-packetcreator-*.jar' -type f ) build_files + cp -r ${{env.CONFIG_LOCATION}}/Biometric\ Devices build_files/Biometric\ Devices + #cp -r ${{env.CONFIG_LOCATION}}/config build_files/config + cp -r src/main/resources/application.properties build_files/config/ + cp -r ${{env.CONFIG_LOCATION}}/resource build_files/resource + cp -r ${{env.CONFIG_LOCATION}}/application.properties build_files/application.properties + cp -r ./src/main/resources/dockersupport/centralized/mountvolume/profile_resource ./profile_resource + zip -r ${{ env.NEW_BUILD_ARTIFACT }}.zip build_files/* profile_resource + - name: Upload the springboot jars + uses: actions/upload-artifact@v1 + with: + name: ${{ env.NEW_BUILD_ARTIFACT }} + path: ./${{env.SERVICE_LOCATION}}/${{ env.NEW_BUILD_ARTIFACT }}.zip + + build-mosip-packet-creator-dockers: + needs: recreate-packet-creator-zips + strategy: + matrix: + include: + - SERVICE_LOCATION: 'mosip-packet-creator' + SERVICE_NAME: 'dsl-packetcreator' + BUILD_ARTIFACT: 'mosip-packet-creator' + ONLY_DOCKER: true + fail-fast: false + name: ${{ matrix.SERVICE_NAME }} + uses: mosip/kattu/.github/workflows/docker-build.yml@master + with: + 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 }} + RELEASE_DOCKER_HUB: ${{ secrets.RELEASE_DOCKER_HUB }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + + sonar_analysis: + needs: build-maven-automationtest + if: "${{ github.event_name != 'pull_request' }}" + uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master + with: + SERVICE_LOCATION: ./ + PROJECT_KEY: mosip_mosip-dsl-test-rig + 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 }} \ No newline at end of file diff --git a/.github/workflows/push_trigger.yml b/.github/workflows/push_trigger.yml deleted file mode 100644 index c0f10ec1d..000000000 --- a/.github/workflows/push_trigger.yml +++ /dev/null @@ -1,347 +0,0 @@ -name: Maven Package upon a push - -on: - push: - branches: - - '!release-branch' - - release-1* - - '!master' - - 1.* - - develop - - MOSIP* - -jobs: - maven-build-dsl-packetcreator: - runs-on: ubuntu-latest - env: - SERVICE_LOCATION: mosip-packet-creator - CONFIG_LOCATION: 'src/main/resources/dockersupport/centralized/mosip-packet-creator' - 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 branch and env - run: | - # Strip git ref prefix from version - echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV - echo "GPG_TTY=$(tty)" >> $GITHUB_ENV - - - uses: actions/cache@v1 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven-${{ env.BRANCH_NAME }} - - - name: Install xmllint - run: | - sudo apt-get update - sudo apt-get install libxml2-utils - - - name: Setup the settings file for ossrh server - run: echo " ossrh ossrh true 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 false false " > $GITHUB_WORKSPACE/settings.xml - - - - name: Build mosipTestDataProvider with Maven - run: | - cd mosipTestDataProvider - mvn clean install -s $GITHUB_WORKSPACE/settings.xml - - - name: Build mosip-packet-creator with Maven - run: | - cd ./${{env.SERVICE_LOCATION}} - mvn clean install -s $GITHUB_WORKSPACE/settings.xml - - - name: Ready the springboot artifacts - run: | - cd ./${{env.SERVICE_LOCATION}} - mkdir -p build_files/config - cp $( find -name 'dslrig-packetcreator-*.jar' -type f ) build_files - cp -r ${{env.CONFIG_LOCATION}}/Biometric\ Devices build_files/Biometric\ Devices - #cp -r ${{env.CONFIG_LOCATION}}/config build_files/config - cp -r src/main/resources/application.properties build_files/config/ - cp -r ${{env.CONFIG_LOCATION}}/resource build_files/resource - cp -r ${{env.CONFIG_LOCATION}}/application.properties build_files/application.properties - cp -r ./src/main/resources/dockersupport/centralized/mountvolume/profile_resource ./profile_resource - zip -r release.zip build_files/* profile_resource - - - name: Upload the springboot jars - uses: actions/upload-artifact@v1 - with: - name: release - path: ./${{env.SERVICE_LOCATION}}/release.zip - - - uses: 8398a7/action-slack@v3 - with: - status: ${{ job.status }} - fields: repo,message,commit,workflow,job # selectable (default: repo,message) - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required - if: failure() # Pick up events even if the job fails or is canceled. - - docker-build-dsl-packetcreator: - needs: maven-build-dsl-packetcreator - runs-on: ubuntu-latest - env: - NAMESPACE: ${{ secrets.dev_namespace_docker_hub }} - SERVICE_NAME: dsl-packetcreator - SERVICE_LOCATION: mosip-packet-creator - DOCKER_BUILDKIT: 1 - - steps: - - uses: actions/checkout@v2 - - uses: actions/download-artifact@v1 - with: - name: release - path: ./${{env.SERVICE_LOCATION}} - - - name: Setup branch name - run: | - # Strip git ref prefix from version - echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV - echo ${{ env.BRANCH_NAME }} - - - name: Get version info from pom - id: getPomVersion - uses: mavrosxristoforos/get-xml-info@1.0 - with: - xml-file: ./${{ env.SERVICE_LOCATION }}/pom.xml - xpath: /*[local-name()="project"]/*[local-name()="version"] - - - name: Extract the mosip-packet-creator jar and its dependency configs - run: | - cd ./${{env.SERVICE_LOCATION}} - unzip "release.zip" - - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - - name: Build image - run: | - cd ./${{env.SERVICE_LOCATION}} - mkdir docker-image-build - cp -r ./build_files ./docker-image-build/build_files - cp -r ./entrypoint.sh ./docker-image-build/entrypoint.sh - cp -r ./profile_resource ./docker-image-build/profile_resource - cp ./Dockerfile ./docker-image-build/Dockerfile - - cd docker-image-build - docker build . --file Dockerfile --build-arg SOURCE=mosip --build-arg COMMIT_HASH=$(git rev-parse HEAD) --build-arg COMMIT_ID=$(git rev-parse --short HEAD) --build-arg BUILD_TIME=${{steps.date.outputs.date}} --tag ${{ env.SERVICE_NAME }} - - - name: Log into registry - run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin - - - name: Push image - run: | - IMAGE_ID=$NAMESPACE/$SERVICE_NAME - - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - echo "push version ${{steps.getPomVersion.outputs.info}}" - if [[ $BRANCH_NAME == master ]]; then - VERSION=latest - else - VERSION=$BRANCH_NAME - fi - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $SERVICE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION - - - uses: 8398a7/action-slack@v3 - with: - status: ${{ job.status }} - fields: repo,message,commit,workflow,job # selectable (default: repo,message) - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEVOPS_WEBHOOK }} # required - if: failure() # Pick up events even if the job fails or is canceled. - - maven-build-dsl-orchestrator: - runs-on: ubuntu-latest - env: - SERVICE_LOCATION: mosip-acceptance-tests - ZIP_FILE_NAME: release-orchestrator - 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 branch and env - run: | - # Strip git ref prefix from version - echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV - echo "GPG_TTY=$(tty)" >> $GITHUB_ENV - - - uses: actions/cache@v1 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven-${{ env.BRANCH_NAME }} - - - name: Install xmllint - run: | - sudo apt-get update - sudo apt-get install libxml2-utils - - - name: Setup the settings file for ossrh server - run: echo " ossrh ossrh true 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 false false " > $GITHUB_WORKSPACE/settings.xml - - - name: Build mosip-packet-creator with Maven - run: | - cd ./${{env.SERVICE_LOCATION}} - mvn clean install -s $GITHUB_WORKSPACE/settings.xml - - - name: Ready the springboot artifacts - run: | - cd ./${{env.SERVICE_LOCATION}} - mkdir build_files - cp $( find -name 'dslrig-ivv-orchestrator-*-dependencies.jar' -type f ) build_files - cp -r ./ivv-orchestrator/target/classes/config build_files/ - cp -r ./ivv-orchestrator/target/classes/local build_files/ - cp -r ./ivv-orchestrator/src/main/resources/local/scenarios scenarios - zip -r ${{env.ZIP_FILE_NAME}}.zip build_files/* scenarios/* - - - name: Upload the springboot jars - uses: actions/upload-artifact@v1 - with: - name: ${{env.ZIP_FILE_NAME}} - path: ./${{env.SERVICE_LOCATION}}/${{env.ZIP_FILE_NAME}}.zip - - - uses: 8398a7/action-slack@v3 - with: - status: ${{ job.status }} - fields: repo,message,commit,workflow,job # selectable (default: repo,message) - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required - if: failure() # Pick up events even if the job fails or is canceled. - - docker-build-dsl-orchestrator: - needs: maven-build-dsl-orchestrator - runs-on: ubuntu-latest - env: - NAMESPACE: ${{ secrets.dev_namespace_docker_hub }} - SERVICE_NAME: dsl-orchestrator - SERVICE_LOCATION: mosip-acceptance-tests/ivv-orchestrator - ZIP_FILE_NAME: release-orchestrator - DOCKER_BUILDKIT: 1 - steps: - - uses: actions/checkout@v2 - - uses: actions/download-artifact@v1 - with: - name: ${{env.ZIP_FILE_NAME}} - path: ./${{env.SERVICE_LOCATION}} - - - name: Setup branch name - run: | - # Strip git ref prefix from version - echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV - echo ${{ env.BRANCH_NAME }} - - - name: Get version info from pom - id: getPomVersion - uses: mavrosxristoforos/get-xml-info@1.0 - with: - xml-file: ./mosip-acceptance-tests/pom.xml - xpath: /*[local-name()="project"]/*[local-name()="version"] - - - name: Extract the dsl-orchestrator jar and its dependency configs - run: | - cd ./${{env.SERVICE_LOCATION}} - unzip "${{env.ZIP_FILE_NAME}}.zip" - - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - - name: Build image - run: | - cd ./${{env.SERVICE_LOCATION}} - mkdir docker-image-build - cp -r ./build_files ./docker-image-build/build_files - cp -r ./entrypoint.sh ./docker-image-build/entrypoint.sh - cp -r ./scenarios ./docker-image-build/scenarios - cp ./Dockerfile ./docker-image-build/Dockerfile - - cd docker-image-build - docker build . --file Dockerfile --build-arg SOURCE=mosip --build-arg COMMIT_HASH=$(git rev-parse HEAD) --build-arg COMMIT_ID=$(git rev-parse --short HEAD) --build-arg BUILD_TIME=${{steps.date.outputs.date}} --tag ${{ env.SERVICE_NAME }} - - - name: Log into registry - run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin - - - name: Push image - run: | - IMAGE_ID=$NAMESPACE/$SERVICE_NAME - - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - echo "push version ${{steps.getPomVersion.outputs.info}}" - if [[ $BRANCH_NAME == master ]]; then - VERSION=latest - else - VERSION=$BRANCH_NAME - fi - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $SERVICE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION - - - uses: 8398a7/action-slack@v3 - with: - status: ${{ job.status }} - fields: repo,message,commit,workflow,job # selectable (default: repo,message) - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEVOPS_WEBHOOK }} # required - if: failure() # Pick up events even if the job fails or is canceled. - - sonar_analysis: - runs-on: ubuntu-latest - 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 branch and env - run: | - # Strip git ref prefix from version - echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV - echo "GPG_TTY=$(tty)" >> $GITHUB_ENV - - - uses: actions/cache@v1 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven-${{ env.BRANCH_NAME }} - - 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: Analyze mosip-automation-tests with SonarCloud - run: mvn -B -Dgpg.skip verify sonar:sonar -Dsonar.projectKey=mosip_mosip-dsl-test-rig -Dsonar.organization=${{ secrets.ORG_KEY }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} -s $GITHUB_WORKSPACE/settings.xml - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - - uses: 8398a7/action-slack@v3 - with: - status: ${{ job.status }} - fields: repo,message,commit,workflow,job # selectable (default: repo,message) - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEVOPS_WEBHOOK }} # required - if: failure() # Pick up events even if the job fails or is canceled. diff --git a/.github/workflows/release-changes.yml b/.github/workflows/release-changes.yml new file mode 100644 index 000000000..783d4896a --- /dev/null +++ b/.github/workflows/release-changes.yml @@ -0,0 +1,29 @@ +name: Release/pre-release Preparation. + +on: + workflow_dispatch: + inputs: + MESSAGE: + description: 'Triggered for release or pe-release' + required: false + default: 'Release Preparation' + RELEASE_TAG: + description: 'tag to update' + required: true + SNAPSHOT_TAG: + description: 'tag to be replaced' + required: true + BASE: + description: 'base branch for PR' + required: true +jobs: + maven-release-preparation: + uses: mosip/kattu/.github/workflows/release-changes.yml@master + with: + MESSAGE: ${{ inputs.MESSAGE }} + RELEASE_TAG: ${{ inputs.RELEASE_TAG }} + SNAPSHOT_TAG: ${{ inputs.SNAPSHOT_TAG }} + BASE: ${{ inputs.BASE }} + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + ACTION_PAT: ${{ secrets.ACTION_PAT }} \ No newline at end of file diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml new file mode 100644 index 000000000..c131f5aa9 --- /dev/null +++ b/.github/workflows/tag.yml @@ -0,0 +1,35 @@ +name: Tagging of repos + +on: + workflow_dispatch: + inputs: + TAG: + description: 'Tag to be published' + required: true + type: string + BODY: + description: 'Release body message' + required: true + default: 'Changes in this Release' + type: string + PRE_RELEASE: + description: 'Pre-release? True/False' + required: true + default: False + type: string + DRAFT: + description: 'Draft? True/False' + required: false + default: False + type: string + +jobs: + tag-branch: + uses: mosip/kattu/.github/workflows/tag.yml@master + with: + TAG: ${{ inputs.TAG }} + BODY: ${{ inputs.BODY }} + PRE_RELEASE: ${{ inputs.PRE_RELEASE }} + DRAFT: ${{ inputs.DRAFT }} + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} diff --git a/mosip-acceptance-tests/ivv-core/pom.xml b/mosip-acceptance-tests/ivv-core/pom.xml index e249c2454..2213c2c04 100644 --- a/mosip-acceptance-tests/ivv-core/pom.xml +++ b/mosip-acceptance-tests/ivv-core/pom.xml @@ -3,15 +3,16 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.mosip.testrig.dslrig.ivv - dslrig-ivv-parent + io.mosip.testrig.dslrig.ivv + dslrig-ivv-parent 1.2.1-SNAPSHOT 4.0.0 io.mosip.testrig.dslrig.ivv.core dslrig-ivv-core - + 1.2.1-SNAPSHOT + 3.7.0.1746 @@ -26,16 +27,16 @@ 2.1.9.RELEASE test - + - org.apache.logging.log4j - log4j-api - 2.11.1 - + org.apache.logging.log4j + log4j-api + 2.11.1 + - + sonar @@ -62,6 +63,26 @@ + + org.apache.maven.plugins + maven-antrun-plugin + 3.0.0 + + + make-jar-executable + package + + run + + + + + + + + + + diff --git a/mosip-acceptance-tests/ivv-dg/pom.xml b/mosip-acceptance-tests/ivv-dg/pom.xml index 319ac8e31..586a5a4ed 100644 --- a/mosip-acceptance-tests/ivv-dg/pom.xml +++ b/mosip-acceptance-tests/ivv-dg/pom.xml @@ -3,15 +3,15 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.mosip.testrig.dslrig.ivv - dslrig-ivv-parent + io.mosip.testrig.dslrig.ivv + dslrig-ivv-parent 1.2.1-SNAPSHOT 4.0.0 - + 1.2.1-SNAPSHOT io.mosip.testrig.dslrig.ivv.dg dslrig-ivv-dg - + 3.7.0.1746 @@ -26,7 +26,7 @@ 1.2.1-SNAPSHOT - + sonar diff --git a/mosip-acceptance-tests/ivv-orchestrator/pom.xml b/mosip-acceptance-tests/ivv-orchestrator/pom.xml index 3b1ffd88a..64d094e53 100644 --- a/mosip-acceptance-tests/ivv-orchestrator/pom.xml +++ b/mosip-acceptance-tests/ivv-orchestrator/pom.xml @@ -1,86 +1,106 @@ - 4.0.0 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - io.mosip.testrig.dslrig.ivv - dslrig-ivv-parent + io.mosip.testrig.dslrig.ivv + dslrig-ivv-parent 1.2.1-SNAPSHOT - + io.mosip.testrig.dslrig.ivv.orchestrator dslrig-ivv-orchestrator mosip-dsl-test + 1.2.1-SNAPSHOT testng.xml 3.7.0.1746 - - + + + org.apache.maven.plugins + maven-antrun-plugin + 3.0.0 + + + make-jar-executable + package + + run + + + + + + + + + + + + maven-compiler-plugin + 3.8.0 + + 11 + 11 + -Dfile.encoding=UTF-8 + + + + + + + - maven-compiler-plugin - 3.8.0 - - 11 - 11 - -Dfile.encoding=UTF-8 - - - - - - - - - org.apache.maven.plugins - maven-shade-plugin - 3.2.4 - - - - shade - - - dslrig-ivv-orchestrator-1.2.1-SNAPSHOT-jar-with-dependencies - - - - - - io.mosip.testrig.dslrig.ivv.orchestrator.TestRunner - - - - - - *:* - - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - - - - - - - - + org.apache.maven.plugins + maven-shade-plugin + 3.2.4 + + + + shade + + + dslrig-ivv-orchestrator-1.2.1-SNAPSHOT-jar-with-dependencies + + + + + + io.mosip.testrig.dslrig.ivv.orchestrator.TestRunner + + + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + + - - - - - org.apache.commons - commons-lang3 - 3.11 - - + + + + + org.apache.commons + commons-lang3 + 3.11 + + io.mosip.testrig.dslrig.ivv.core @@ -98,45 +118,45 @@ 3.0.7 compile - - io.mosip.testrig.apirig.automationtests - automationtests - 1.2.1-SNAPSHOT - - - com.sun.jersey - jersey-client - - - - - - com.slack.api - slack-api-client - 1.6.1-RC1 - - - - io.mosip.kernel - kernel-biometrics-api - 1.2.1-SNAPSHOT - - - - com.fasterxml.jackson.core - jackson-databind - 2.10.5 - - - com.fasterxml.jackson.core - jackson-core - 2.10.1 - - + + io.mosip.testrig.apirig.automationtests + automationtests + 1.2.1-SNAPSHOT + + + com.sun.jersey + jersey-client + + + + + + com.slack.api + slack-api-client + 1.6.1-RC1 + + + + io.mosip.kernel + kernel-biometrics-api + 1.2.1-SNAPSHOT + + + + com.fasterxml.jackson.core + jackson-databind + 2.10.5 + + + com.fasterxml.jackson.core + jackson-core + 2.10.1 + + - - + + sonar diff --git a/mosip-acceptance-tests/ivv-parser/pom.xml b/mosip-acceptance-tests/ivv-parser/pom.xml index 10d959750..1f0b77861 100644 --- a/mosip-acceptance-tests/ivv-parser/pom.xml +++ b/mosip-acceptance-tests/ivv-parser/pom.xml @@ -3,15 +3,15 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.mosip.testrig.dslrig.ivv - dslrig-ivv-parent + io.mosip.testrig.dslrig.ivv + dslrig-ivv-parent 1.2.1-SNAPSHOT 4.0.0 io.mosip.testrig.dslrig.ivv.parser dslrig-ivv-parser - + 1.2.1-SNAPSHOT io.mosip.testrig.dslrig.ivv.core diff --git a/mosip-acceptance-tests/pom.xml b/mosip-acceptance-tests/pom.xml index bac832d01..12654a4af 100644 --- a/mosip-acceptance-tests/pom.xml +++ b/mosip-acceptance-tests/pom.xml @@ -1,21 +1,107 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 io.mosip.testrig.dslrig.ivv dslrig-ivv-parent pom 1.2.1-SNAPSHOT + + + MPL 2.0 + https://www.mozilla.org/en-US/MPL/2.0/ + + + + + scm:git:git://github.com/mosip/mosip-ref-impl.git + scm:git:ssh://github.com:mosip/mosip-ref-impl.git + https://github.com/mosip/mosip-ref-impl + HEAD + + + + Mosip + mosip.emailnotifier@gmail.com + io.mosip + https://github.com/mosip/mosip-ref-impl + + - ivv-core + ivv-core ivv-parser ivv-dg ivv-orchestrator - - + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + + + pl.project13.maven + git-commit-id-plugin + 3.0.1 + + + get-the-git-infos + + revision + + validate + + + + true + ${project.build.outputDirectory}/git.properties + + ^git.build.(time|version)$ + ^git.commit.id.(abbrev|full)$ + + full + ${project.basedir}/.git + + + + + org.apache.maven.plugins + maven-antrun-plugin + 3.0.0 + + + make-jar-executable + package + + run + + + + + + + + + + maven-compiler-plugin 3.8.0 diff --git a/mosip-packet-creator/pom.xml b/mosip-packet-creator/pom.xml index a425343d3..c0e008186 100644 --- a/mosip-packet-creator/pom.xml +++ b/mosip-packet-creator/pom.xml @@ -1,7 +1,28 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + + + MPL 2.0 + https://www.mozilla.org/en-US/MPL/2.0/ + + + + + scm:git:git://github.com/mosip/mosip-ref-impl.git + scm:git:ssh://github.com:mosip/mosip-ref-impl.git + https://github.com/mosip/mosip-ref-impl + HEAD + + + + Mosip + mosip.emailnotifier@gmail.com + io.mosip + https://github.com/mosip/mosip-ref-impl + + org.springframework.boot spring-boot-starter-parent @@ -16,19 +37,19 @@ 11 - 3.7.0.1746 + 3.7.0.1746 2020.0.0 - - - + + + org.springframework.boot spring-boot-starter-batch @@ -48,7 +69,7 @@ org.bouncycastle bcpkix-jdk15on - + @@ -77,13 +98,13 @@ spring-batch-test test - + org.json json 20201115 - + com.h2database @@ -96,7 +117,7 @@ TSS.Java 0.3.0 - + org.bouncycastle bcprov-jdk15on @@ -119,54 +140,54 @@ jobrunr-spring-boot-starter 1.2.2 - - io.mosip.testrig.dslrig.dataprovider - dslrig-dataprovider - 1.2.1-SNAPSHOT + + io.mosip.testrig.dslrig.dataprovider + dslrig-dataprovider + 1.2.1-SNAPSHOT - commons-configuration - commons-configuration - 1.10 + commons-configuration + commons-configuration + 1.10 - + - io.rest-assured - rest-assured - 4.2.0 + io.rest-assured + rest-assured + 4.2.0 - io.rest-assured - rest-assured-all - 4.2.0 - - - - - - io.mosip.kernel - kernel-websubclient-api - 1.2.0.1-B1 - - - org.bouncycastle - bcprov-jdk15on - - - - - - org.springframework.cloud - spring-cloud-starter-bootstrap - - - + io.rest-assured + rest-assured-all + 4.2.0 + + + + + + io.mosip.kernel + kernel-websubclient-api + 1.2.0.1-B1 + + + org.bouncycastle + bcprov-jdk15on + + + + + + org.springframework.cloud + spring-cloud-starter-bootstrap + + + @@ -179,12 +200,12 @@ import - - org.apache.commons - commons-lang3 - 3.4 - - + + org.apache.commons + commons-lang3 + 3.4 + + @@ -194,6 +215,71 @@ org.springframework.boot spring-boot-maven-plugin + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + + + pl.project13.maven + git-commit-id-plugin + 3.0.1 + + + get-the-git-infos + + revision + + validate + + + + true + ${project.build.outputDirectory}/git.properties + + ^git.build.(time|version)$ + ^git.commit.id.(abbrev|full)$ + + full + ${project.basedir}/.git + + + + + org.apache.maven.plugins + maven-antrun-plugin + 3.0.0 + + + make-jar-executable + package + + run + + + + + + + + + + @@ -212,37 +298,37 @@ https://repo.spring.io/milestone - + - - sonar - - . - src/main/java/**,src/main/resources/** - ${sonar.coverage.exclusions} - https://sonarcloud.io - - - false - - - - - org.sonarsource.scanner.maven - sonar-maven-plugin - ${maven.sonar.plugin.version} - - - verify - - sonar - - - - - - - - + + sonar + + . + src/main/java/**,src/main/resources/** + ${sonar.coverage.exclusions} + https://sonarcloud.io + + + false + + + + + org.sonarsource.scanner.maven + sonar-maven-plugin + ${maven.sonar.plugin.version} + + + verify + + sonar + + + + + + + + diff --git a/mosipTestDataProvider/pom.xml b/mosipTestDataProvider/pom.xml index 3900385ae..e79a9f8ff 100644 --- a/mosipTestDataProvider/pom.xml +++ b/mosipTestDataProvider/pom.xml @@ -1,13 +1,13 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 io.mosip.testrig.dslrig.dataprovider dslrig-dataprovider 1.2.1-SNAPSHOT - 3.7.0.1746 - + 3.7.0.1746 + src @@ -19,6 +19,26 @@ 11 + + org.apache.maven.plugins + maven-antrun-plugin + 3.0.0 + + + make-jar-executable + package + + run + + + + + + + + + + @@ -213,7 +233,7 @@ 1.6.1-RC1 - @@ -222,12 +242,12 @@ biometrics-util 1.2.0.1-B2-SNAPSHOT - + org.openpnp opencv 4.5.3-4 - + @@ -296,36 +316,36 @@ https://oss.sonatype.org/service/local/staging/deploy/maven2/ - + - - sonar - - . - src/main/java/**,src/main/resources/** - ${sonar.coverage.exclusions} - https://sonarcloud.io - - - false - - - - - org.sonarsource.scanner.maven - sonar-maven-plugin - ${maven.sonar.plugin.version} - - - verify - - sonar - - - - - - - - + + sonar + + . + src/main/java/**,src/main/resources/** + ${sonar.coverage.exclusions} + https://sonarcloud.io + + + false + + + + + org.sonarsource.scanner.maven + sonar-maven-plugin + ${maven.sonar.plugin.version} + + + verify + + sonar + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 30b2ae83d..26a5bb815 100644 --- a/pom.xml +++ b/pom.xml @@ -227,6 +227,26 @@ + + org.apache.maven.plugins + maven-antrun-plugin + 3.0.0 + + + make-jar-executable + package + + run + + + + + + + + + +