From 16967e310fa1a6e38a809959ee3787e71fe0e3b7 Mon Sep 17 00:00:00 2001 From: dhanendra06 Date: Mon, 3 Jul 2023 10:58:29 +0530 Subject: [PATCH 01/16] MOSIP-28177 --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 34fd999..6a959db 100644 --- a/pom.xml +++ b/pom.xml @@ -11,19 +11,19 @@ io.mosip.digitalcard digital-card-service - 1.2.1-SNAPSHOT + 1.2.0.1-SNAPSHOT digital-card-service 11 11 - 1.2.1-SNAPSHOT + 1.2.0.1-SNAPSHOT 2.0.2.RELEASE 2.0.7.RELEASE 5.0.5.RELEASE 2.0.4.RELEASE 2.9.2 - 1.2.1-SNAPSHOT + 1.2.0.1-SNAPSHOT 2.8.4 From f5f24b7652ec342bb0b1da158095132e45dcbb23 Mon Sep 17 00:00:00 2001 From: Rakshithb1 <79500257+Rakshithb1@users.noreply.github.com> Date: Tue, 18 Jul 2023 17:57:53 +0530 Subject: [PATCH 02/16] [MOSIP-28488] update push_trigger.yml (#41) * [MOSIP-28488] update README.md Signed-off-by: Rakshithb1 <79500257+Rakshithb1@users.noreply.github.com> * [MOSIP-28488] update push_trigger.yml Signed-off-by: Rakshithb1 <79500257+Rakshithb1@users.noreply.github.com> --------- Signed-off-by: Rakshithb1 <79500257+Rakshithb1@users.noreply.github.com> --- .github/workflows/push_trigger.yml | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push_trigger.yml b/.github/workflows/push_trigger.yml index c65e62e..6fb5591 100644 --- a/.github/workflows/push_trigger.yml +++ b/.github/workflows/push_trigger.yml @@ -7,6 +7,7 @@ on: - main - 1.1.5.6 - develop + - release-1.* jobs: build: runs-on: ubuntu-latest diff --git a/README.md b/README.md index cabd364..c26c681 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# digital-card-service +# digital-card-service Service resposible to auto generate digital card once the registration packet is processed by registration processor module From cabd76860969a216d2eb150419378711082c3cd4 Mon Sep 17 00:00:00 2001 From: Rakshitha650 <76676196+Rakshitha650@users.noreply.github.com> Date: Mon, 24 Jul 2023 11:30:13 +0530 Subject: [PATCH 03/16] [DSD-3113]increased the resouces allocation for Digitalcard (#44) --- helm/digitalcard/values.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helm/digitalcard/values.yaml b/helm/digitalcard/values.yaml index f408676..7543229 100644 --- a/helm/digitalcard/values.yaml +++ b/helm/digitalcard/values.yaml @@ -126,11 +126,11 @@ resources: # resources, such as Minikube. If you do want to specify resources, uncomment the following # lines, adjust them as necessary, and remove the curly braces after 'resources:'. limits: - cpu: 300m + cpu: 500m memory: 3000Mi requests: - cpu: 100m - memory: 1000Mi + cpu: 300m + memory: 2000Mi additionalResources: ## Specify any JAVA_OPTS string here. These typically will be specified in conjunction with above resources From cf0fd1d1807af0500ce4c13547998d8188fc28b7 Mon Sep 17 00:00:00 2001 From: Akila Lakshmanan <77330852+akilalakshmanan@users.noreply.github.com> Date: Tue, 22 Aug 2023 09:01:41 +0530 Subject: [PATCH 04/16] [MOSIP-28484] Added error handling for deploy.sh script (#46) Co-authored-by: akilalakshmanan --- db_scripts/mosip_digitalcard/deploy.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/db_scripts/mosip_digitalcard/deploy.sh b/db_scripts/mosip_digitalcard/deploy.sh index 8cafd84..18e54ba 100644 --- a/db_scripts/mosip_digitalcard/deploy.sh +++ b/db_scripts/mosip_digitalcard/deploy.sh @@ -17,28 +17,28 @@ fi ## Terminate existing connections echo "Terminating active connections" -CONN=$(PGPASSWORD=$SU_USER_PWD psql --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -t -c "SELECT count(pg_terminate_backend(pg_stat_activity.pid)) FROM pg_stat_activity WHERE datname = '$MOSIP_DB_NAME' AND pid <> pg_backend_pid()";exit;) +CONN=$(PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -t -c "SELECT count(pg_terminate_backend(pg_stat_activity.pid)) FROM pg_stat_activity WHERE datname = '$MOSIP_DB_NAME' AND pid <> pg_backend_pid()";exit;) echo "Terminated connections" ## Drop db and role -PGPASSWORD=$SU_USER_PWD psql --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -f drop_db.sql -PGPASSWORD=$SU_USER_PWD psql --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -f drop_role.sql +PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -f drop_db.sql +PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -f drop_role.sql ## Create users echo `date "+%m/%d/%Y %H:%M:%S"` ": Creating database users" | tee -PGPASSWORD=$SU_USER_PWD psql --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -f role_dbuser.sql -v dbuserpwd=\'$DBUSER_PWD\' +PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -f role_dbuser.sql -v dbuserpwd=\'$DBUSER_PWD\' ## Create DB -PGPASSWORD=$SU_USER_PWD psql --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -f db.sql -PGPASSWORD=$SU_USER_PWD psql --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -f ddl.sql +PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -f db.sql +PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -f ddl.sql ## Grants -PGPASSWORD=$SU_USER_PWD psql --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -f grants.sql +PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -f grants.sql ## Populate tables if [ ${DML_FLAG} == 1 ] then echo `date "+%m/%d/%Y %H:%M:%S"` ": Deploying DML for ${MOSIP_DB_NAME} database" - PGPASSWORD=$SU_USER_PWD psql --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -a -b -f dml.sql + PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -a -b -f dml.sql fi From 616b3f7f36e2aeb133266848ae414fea2b22aee3 Mon Sep 17 00:00:00 2001 From: VSIVAKALYAN <103260988+VSIVAKALYAN@users.noreply.github.com> Date: Thu, 21 Sep 2023 19:10:47 +0530 Subject: [PATCH 05/16] [MOSIP-29211] Added Reusable Workflow to release 1201 branch. (#51) --- .github/workflows/clear-artifacts.yml | 8 + .github/workflows/clear_artifacts.yml | 13 - .github/workflows/postgres-init_trigger.yml | 83 ---- .github/workflows/push-trigger.yml | 119 ++++++ .github/workflows/push_trigger.yml | 235 ----------- .github/workflows/release-changes.yml | 26 ++ .../{release_chart.yml => release-chart.yml} | 0 .github/workflows/release_changes.yml | 56 --- .github/workflows/release_trigger.yml | 379 ------------------ .github/workflows/tag.yml | 33 ++ 10 files changed, 186 insertions(+), 766 deletions(-) create mode 100644 .github/workflows/clear-artifacts.yml delete mode 100644 .github/workflows/clear_artifacts.yml delete mode 100644 .github/workflows/postgres-init_trigger.yml create mode 100644 .github/workflows/push-trigger.yml delete mode 100644 .github/workflows/push_trigger.yml create mode 100644 .github/workflows/release-changes.yml rename .github/workflows/{release_chart.yml => release-chart.yml} (100%) delete mode 100644 .github/workflows/release_changes.yml delete mode 100644 .github/workflows/release_trigger.yml create mode 100644 .github/workflows/tag.yml diff --git a/.github/workflows/clear-artifacts.yml b/.github/workflows/clear-artifacts.yml new file mode 100644 index 0000000..b98fd74 --- /dev/null +++ b/.github/workflows/clear-artifacts.yml @@ -0,0 +1,8 @@ +name: 'Delete old artifacts' +on: + schedule: + - cron: '0 * * * *' # every hour + +jobs: + delete-artifacts: + uses: mosip/kattu/.github/workflows/clear-artifacts.yml@master diff --git a/.github/workflows/clear_artifacts.yml b/.github/workflows/clear_artifacts.yml deleted file mode 100644 index ac3f207..0000000 --- a/.github/workflows/clear_artifacts.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Delete old artifacts' -on: - schedule: - - cron: '0 * * * *' # every hour - -jobs: - delete-artifacts: - runs-on: ubuntu-latest - steps: - - uses: kolpav/purge-artifacts-action@v1 - with: - token: ${{ secrets. access_token }} - expire-in: 2days # Setting this to 0 will delete all artifacts diff --git a/.github/workflows/postgres-init_trigger.yml b/.github/workflows/postgres-init_trigger.yml deleted file mode 100644 index 3de4c6f..0000000 --- a/.github/workflows/postgres-init_trigger.yml +++ /dev/null @@ -1,83 +0,0 @@ -name: Trigger postgres-init repo upon db scripts updates - -on: - push: - branches: - - master - - 1.* - - develop - - release* - paths: - - db_release_scripts/** - - db_scripts/** - -jobs: - paths-filter: - runs-on: ubuntu-latest - outputs: - db_release_scripts: ${{ steps.filter.outputs.db_release_scripts }} - db_scripts: ${{ steps.filter.outputs.db_scripts }} - steps: - - uses: actions/checkout@v2 - - uses: dorny/paths-filter@v2 - id: filter - with: - base: ${{ github.ref }} - filters: | - db_release_scripts: - - 'db_release_scripts/**' - db_scripts: - - 'db_scripts/**' - - # run only if 'db_release_scripts' files were changed - db_release_scripts_updates: - needs: paths-filter - if: needs.paths-filter.outputs.db_release_scripts == 'true' - runs-on: ubuntu-latest - steps: - - name: Check for updates - run: echo "Updates are present in db_release_scripts directory, Triggering postgres-init repo" - - uses: 8398a7/action-slack@v3 - with: - status: ${{ job.status }} - fields: repo,message,commit,author,job,took,ref # selectable (default: repo,message) - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_DEVOPS }} # required - if: success() # Pick up events when the job is successful. - - # run only if not 'db_release_scripts' files were changed - - name: Check for no updates - if: needs.paths-filter.outputs.db_release_scripts != 'true' - run: echo "Updates are not present in db_release_scripts directory" - - # run only if 'db_scripts' files were changed - db_scripts_updates: - needs: paths-filter - if: needs.paths-filter.outputs.db_scripts == 'true' - runs-on: ubuntu-latest - steps: - - name: Check for updates - run: echo "Updates are present in db_scripts directory, Triggering postgres-init repo" - - uses: 8398a7/action-slack@v3 - with: - status: ${{ job.status }} - fields: repo,message,commit,author,job,took,ref # selectable (default: repo,message) - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_DEVOPS }} # required - if: success() # Pick up events when the job is successful. - - # run only if not 'db_scripts' files were changed - - name: Check for no updates - if: needs.paths-filter.outputs.db_scripts != 'true' - run: echo "Updates are not present in db_scripts directory" - - # This job is to trigger postgres-init repo. - trigger-postgres_init_repo: - runs-on: ubuntu-latest - steps: - - uses: peter-evans/repository-dispatch@v2 - with: - token: ${{ secrets.ACTION_PAT }} - repository: mosip/postgres-init - base: ${{ github.ref }} - event-type: db-event diff --git a/.github/workflows/push-trigger.yml b/.github/workflows/push-trigger.yml new file mode 100644 index 0000000..bc506c1 --- /dev/null +++ b/.github/workflows/push-trigger.yml @@ -0,0 +1,119 @@ +name: Maven Package upon a push + +on: + release: + types: [published] + pull_request: + types: [opened] + workflow_dispatch: + inputs: + message: + description: 'Message for manually triggering' + required: false + default: 'Triggered for Updates' + type: string + push: + branches: + - '!release-branch' + - master + - 1.* + - develop + - MOSIP* + - release* + +jobs: + build-maven-digitalcard: + uses: mosip/kattu/.github/workflows/maven-build.yml@master + with: + SERVICE_LOCATION: ./ + BUILD_ARTIFACT: digital-card-service + 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 }} + + publish_to_nexus: + if: "${{ !contains(github.ref, 'master') && github.event_name != 'pull_request' }}" + needs: build-maven-digitalcard + uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master + with: + SERVICE_LOCATION: ./ + secrets: + 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 }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + + ## Recreate zips to provide support for docker unzip operation + recreate-zips: + needs: build-maven-digitalcard + runs-on: ubuntu-latest + env: + BUILD_ARTIFACT: digital-card-service + NEW_BUILD_ARTIFACT: digital-card + SERVICE_LOCATION: digital-card-service + 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: | + cd ../ + + echo "LS ./" + ls . + echo "unzip command" + unzip -uj "${{ env.BUILD_ARTIFACT }}.zip" "target/*" -d "${{ env.SERVICE_LOCATION }}/target/" + + echo "find command" + cd ${{ env.SERVICE_LOCATION }} + find ../${{ env.SERVICE_LOCATION }} -path '*/target/*' -name '*.jar' -type f -executable -exec zip ${{ env.NEW_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.NEW_BUILD_ARTIFACT }} + path: ${{ env.NEW_BUILD_ARTIFACT }}.zip + + build-dockers: + needs: recreate-zips + strategy: + matrix: + include: + - SERVICE_LOCATION: '../digital-card-service' + SERVICE_NAME: 'digital-card-service' + BUILD_ARTIFACT: 'digital-card' + 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 }} + 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-digitalcard + if: "${{ github.event_name != 'pull_request' }}" + uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master + with: + SERVICE_LOCATION: ./ + 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 6fb5591..0000000 --- a/.github/workflows/push_trigger.yml +++ /dev/null @@ -1,235 +0,0 @@ -name: Maven Package upon a push - -on: - push: - branches: - - '!release-branch' - - main - - 1.1.5.6 - - develop - - release-1.* -jobs: - build: - 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 - - - name: Setup branch and GPG public key - run: | - # Strip git ref prefix from version - echo ${{ env.BRANCH_NAME }} - echo ${{ env.GPG_TTY }} - sudo apt-get --yes install gnupg2 - gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg - gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg - - - 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 danubetech-maven-public https://repo.danubetech.com/repository/maven-public sonar . https://sonarcloud.io false " > $GITHUB_WORKSPACE/settings.xml - - - name: Build with Maven - run: | - mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml - - - name: Ready the springboot artifacts - run: find -name '*.jar' -executable -type f -exec zip release.zip {} + - - - name: Upload the springboot jars - uses: actions/upload-artifact@v1 - with: - name: release - path: ./release.zip - - - uses: 8398a7/action-slack@v3 - with: - status: ${{ job.status }} - fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # 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. - - publish_to_nexus: - if: "!contains(github.ref, 'master')" - 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 GPG public key - run: | - # Strip git ref prefix from version - echo ${{ env.BRANCH_NAME }} - echo ${{ env.GPG_TTY }} - sudo apt-get --yes install gnupg2 - gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg - gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg - - - 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 ${{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 danubetech-maven-public https://repo.danubetech.com/repository/maven-public sonar . https://sonarcloud.io false " > $GITHUB_WORKSPACE/settings.xml - - - name: Build with Maven - run: | - mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml - - - name: Publish the maven package - run: | - mvn deploy -DaltDeploymentRepository=ossrh::default::${{ secrets.OSSRH_SNAPSHOT_URL }} -s $GITHUB_WORKSPACE/settings.xml -f pom.xml - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} - GPG_TTY: $(tty) - - - uses: 8398a7/action-slack@v3 - with: - status: ${{ job.status }} - fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # 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. - - docker-digitalcard: - needs: build - runs-on: ubuntu-latest - env: - NAMESPACE: ${{ secrets.dev_namespace_docker_hub }} - SERVICE_NAME: digital-card-service - SERVICE_LOCATION: digital-card-service - steps: - - uses: actions/checkout@v2 - - uses: actions/download-artifact@v1 - with: - name: release - path: ./ - - - name: Setup branch name - run: | - # Strip git ref prefix from version - echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV - - - name: Get version info from pom - id: getPomVersion - uses: mavrosxristoforos/get-xml-info@1.0 - with: - xml-file: /pom.xml - xpath: /*[local-name()="project"]/*[local-name()="version"] - - - name: Unzip and extract the digital-card-service - run: unzip -uj "release.zip" "target/*" -d "target" - - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - - name: Build image - run: | - docker build . --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}} --file Dockerfile --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,author,action,eventName,ref,workflow,job,took # 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 danubetech-maven-public https://repo.danubetech.com/repository/maven-public sonar . https://sonarcloud.io false " > $GITHUB_WORKSPACE/settings.xml - - - name: Build with Maven - run: | - mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml - - - name: Analyze with SonarCloud - run: | - mvn -B -Dgpg.skip verify sonar:sonar -Dsonar.projectKey=mosip_${{ github.event.repository.name }} -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 0000000..440e2e2 --- /dev/null +++ b/.github/workflows/release-changes.yml @@ -0,0 +1,26 @@ +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 }} diff --git a/.github/workflows/release_chart.yml b/.github/workflows/release-chart.yml similarity index 100% rename from .github/workflows/release_chart.yml rename to .github/workflows/release-chart.yml diff --git a/.github/workflows/release_changes.yml b/.github/workflows/release_changes.yml deleted file mode 100644 index d6b2067..0000000 --- a/.github/workflows/release_changes.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Release/pre-release Preparation. - -on: - workflow_dispatch: - inputs: - message: - description: 'Triggered for release or pe-release' - required: false - default: 'Release Preparation' - releaseTags: - description: 'tag to update' - required: true - snapshotTags: - description: 'tag to be replaced' - required: true - base: - description: 'base branch for PR' - required: true -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - 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 - - - name: Mannualy changing the pom versions - run: find . -type f -name "*pom.xml" -digital-card-service | xargs -0 sed -i "s/${{ github.event.inputs.snapshotTags }}/${{ github.event.inputs.releaseTags }}/g" - - - name: Updating the Release URL in POM - run: | - cd .github/workflows - sed -i 's/OSSRH_SNAPSHOT_URL/RELEASE_URL/g' push_trigger.yml - - - name: Updating libs-snapshot-local to libs-release local for artifactory URL's. - run: find . -type f -name "*Dockerfile" -digital-card-service0 | xargs -0 sed -i "s/libs-snapshot-local/libs-release-local/g" - - - name: removing -DskipTests - run: find . -type f -name "*push_trigger.yml" -digital-card-service0 | xargs -0 sed -i "s/"-DskipTests"//g" - -# - name: removing --Dgpg.skip -# run: find . -type f -name "*push_trigger.yml" -digital-card-service0 | xargs -0 sed -i "s/"-Dgpg.skip"//g" - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.ACTION_PAT }} - commit-message: Updated Pom versions for release changes - title: Release changes - body: Automated PR for ${{ github.event.inputs.releaseTags }} release. - branch: release-branch - delete-branch: true - base: ${{ github.event.inputs.base }} diff --git a/.github/workflows/release_trigger.yml b/.github/workflows/release_trigger.yml deleted file mode 100644 index 9adf3a1..0000000 --- a/.github/workflows/release_trigger.yml +++ /dev/null @@ -1,379 +0,0 @@ -# This workflow will build and publish package using Maven, Docker when a release is published - -name: Release maven packages and docker upon a release - -on: - release: - types: [published] - - -jobs: - build: - - 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 GPG public key - run: | - # Strip git ref prefix from version - echo "::set-env name=BRANCH_NAME::$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" - echo ${{ env.BRANCH_NAME }} - echo "::set-env name=GPG_TTY::$(tty)" - echo ${{ env.GPG_TTY }} - sudo apt-get --yes install gnupg2 - gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg - gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg - - - 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 ${{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 with Maven - run: cd id-repository && mvn -B package --file pom.xml -s $GITHUB_WORKSPACE/settings.xml - - - name: Ready the springboot artifacts - run: find -name '*.jar' -executable -type f -exec zip release.zip {} + - - - name: Upload the springboot jars - uses: actions/upload-artifact@v1 - with: - name: release - path: ./release.zip - - publish_to_nexus: - 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 GPG public key - run: | - # Strip git ref prefix from version - echo "::set-env name=BRANCH_NAME::$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" - echo ${{ env.BRANCH_NAME }} - echo "::set-env name=GPG_TTY::$(tty)" - echo ${{ env.GPG_TTY }} - sudo apt-get --yes install gnupg2 - gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg - gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg - - - 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 ${{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 with Maven - run: cd id-repository && mvn -B package --file pom.xml -s $GITHUB_WORKSPACE/settings.xml - - - name: Publish the maven package - run: | - chmod +x ./deploy.sh - ./deploy.sh id-repository $GITHUB_WORKSPACE/settings.xml .* - env: - GPG_TTY: $(tty) - - name: Analyze with SonarCloud - run: cd id-repository && mvn -B verify sonar:sonar -Dsonar.projectKey=${{ secrets.PROJECT_KEY }} -Dsonar.organization=${{ secrets.ORG_KEY }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - docker-id-repository-vid-service: - needs: build - - runs-on: ubuntu-latest - env: - NAMESPACE: ${{ secrets. dev_namespace_docker_hub }} - SERVICE_NAME: id-repository-vid-service - SERVICE_LOCATION: id-repository/id-repository-vid-service - - steps: - - uses: actions/checkout@v2 - - uses: actions/download-artifact@v1 - with: - name: release - path: ./ - - - name: Setup branch and GPG public key - run: | - # Strip git ref prefix from version - echo "::set-env name=BRANCH_NAME::$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" - 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: Unzip and extract - run: unzip -uj "release.zip" "${{ env.SERVICE_LOCATION }}/target/*" -d "./${{ env.SERVICE_LOCATION }}/target" - - - name: Build image - run: | - cd "./${{env.SERVICE_LOCATION}}" - docker build . --file Dockerfile --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}}" - VERSION=$BRANCH_NAME - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $SERVICE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION - - docker-id-repository-identity-service: - needs: build - - runs-on: ubuntu-latest - env: - NAMESPACE: ${{ secrets. dev_namespace_docker_hub }} - SERVICE_NAME: id-repository-identity-service - SERVICE_LOCATION: id-repository/id-repository-identity-service - - steps: - - uses: actions/checkout@v2 - - uses: actions/download-artifact@v1 - with: - name: release - path: ./ - - - name: Setup branch name - run: | - # Strip git ref prefix from version - echo "::set-env name=BRANCH_NAME::$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" - 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: Unzip and extract - run: unzip -uj "release.zip" "${{ env.SERVICE_LOCATION }}/target/*" -d "./${{ env.SERVICE_LOCATION }}/target" - - - name: Build image - run: | - cd "./${{env.SERVICE_LOCATION}}" - docker build . --file Dockerfile --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}}" - VERSION=$BRANCH_NAME - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $SERVICE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION - - docker-bioextractor-service: - needs: build - - runs-on: ubuntu-latest - env: - NAMESPACE: ${{ secrets. dev_namespace_docker_hub }} - SERVICE_NAME: bioextractor-service - SERVICE_LOCATION: id-repository/bioextractor-service - - steps: - - uses: actions/checkout@v2 - - uses: actions/download-artifact@v1 - with: - name: release - path: ./ - - - name: Setup branch name - run: | - # Strip git ref prefix from version - echo "::set-env name=BRANCH_NAME::$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" - 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: Unzip and extract - run: unzip -uj "release.zip" "${{ env.SERVICE_LOCATION }}/target/*" -d "./${{ env.SERVICE_LOCATION }}/target" - - - name: Build image - run: | - cd "./${{env.SERVICE_LOCATION}}" - docker build . --file Dockerfile --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}}" - VERSION=$BRANCH_NAME - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $SERVICE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION - - docker-credential-request-generator: - needs: build - - runs-on: ubuntu-latest - env: - NAMESPACE: ${{ secrets. dev_namespace_docker_hub }} - SERVICE_NAME: credential-request-generator - SERVICE_LOCATION: id-repository/credential-request-generator - - steps: - - uses: actions/checkout@v2 - - uses: actions/download-artifact@v1 - with: - name: release - path: ./ - - - name: Setup branch name - run: | - # Strip git ref prefix from version - echo "::set-env name=BRANCH_NAME::$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" - 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: Unzip and extract - run: unzip -uj "release.zip" "${{ env.SERVICE_LOCATION }}/target/*" -d "./${{ env.SERVICE_LOCATION }}/target" - - - name: Build image - run: | - cd "./${{env.SERVICE_LOCATION}}" - docker build . --file Dockerfile --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}}" - VERSION=$BRANCH_NAME - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $SERVICE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION - - docker-credential-service: - needs: build - - runs-on: ubuntu-latest - env: - NAMESPACE: ${{ secrets. dev_namespace_docker_hub }} - SERVICE_NAME: credential-service - SERVICE_LOCATION: id-repository/credential-service - - steps: - - uses: actions/checkout@v2 - - uses: actions/download-artifact@v1 - with: - name: release - path: ./ - - - name: Setup branch name - run: | - # Strip git ref prefix from version - echo "::set-env name=BRANCH_NAME::$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" - 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: Unzip and extract - run: unzip -uj "release.zip" "${{ env.SERVICE_LOCATION }}/target/*" -d "./${{ env.SERVICE_LOCATION }}/target" - - - name: Build image - run: | - cd "./${{env.SERVICE_LOCATION}}" - docker build . --file Dockerfile --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}}" - VERSION=$BRANCH_NAME - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $SERVICE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml new file mode 100644 index 0000000..73c55b0 --- /dev/null +++ b/.github/workflows/tag.yml @@ -0,0 +1,33 @@ +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 }} \ No newline at end of file From dc334dd7fe34637b0f48e52f05e31c058a72470d Mon Sep 17 00:00:00 2001 From: VSIVAKALYAN <103260988+VSIVAKALYAN@users.noreply.github.com> Date: Sun, 24 Sep 2023 17:31:15 +0530 Subject: [PATCH 06/16] [MOSIP-29211] Added Secrets to release 1201 branch. (#54) * [MOSIP-29211] Added Secrets to release 1201 branch. Signed-off-by: VSIVAKALYAN <103260988+VSIVAKALYAN@users.noreply.github.com> * [MOSIP-29211] Added Secrets to release 1201 branch. Signed-off-by: VSIVAKALYAN <103260988+VSIVAKALYAN@users.noreply.github.com> --------- Signed-off-by: VSIVAKALYAN <103260988+VSIVAKALYAN@users.noreply.github.com> --- .github/workflows/release-changes.yml | 3 +++ .github/workflows/tag.yml | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-changes.yml b/.github/workflows/release-changes.yml index 440e2e2..c10da75 100644 --- a/.github/workflows/release-changes.yml +++ b/.github/workflows/release-changes.yml @@ -24,3 +24,6 @@ jobs: 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 }} diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 73c55b0..c131f5a 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -30,4 +30,6 @@ jobs: TAG: ${{ inputs.TAG }} BODY: ${{ inputs.BODY }} PRE_RELEASE: ${{ inputs.PRE_RELEASE }} - DRAFT: ${{ inputs.DRAFT }} \ No newline at end of file + DRAFT: ${{ inputs.DRAFT }} + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} From faafe186729ec4d7f76c03a6e6b5eedaa87469c3 Mon Sep 17 00:00:00 2001 From: VSIVAKALYAN <103260988+VSIVAKALYAN@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:15:56 +0530 Subject: [PATCH 07/16] [MOSIP-29211] Updated clear-artifacts.yml to release 1201 branch. (#56) Signed-off-by: VSIVAKALYAN <103260988+VSIVAKALYAN@users.noreply.github.com> --- .github/workflows/clear-artifacts.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/clear-artifacts.yml b/.github/workflows/clear-artifacts.yml index b98fd74..461fcad 100644 --- a/.github/workflows/clear-artifacts.yml +++ b/.github/workflows/clear-artifacts.yml @@ -2,7 +2,16 @@ name: 'Delete old artifacts' on: schedule: - cron: '0 * * * *' # every hour - + workflow_dispatch: + inputs: + message: + description: 'Message for manually triggering' + required: false + default: 'Triggered for Updates' + type: string jobs: delete-artifacts: uses: mosip/kattu/.github/workflows/clear-artifacts.yml@master + secrets: + ACCESS_TOKEN: ${{ secrets.access_token }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} From 1b6cd76e889fab03786ab53f61d6c54b16ed682a Mon Sep 17 00:00:00 2001 From: syed salman <72004356+syedsalman3753@users.noreply.github.com> Date: Thu, 19 Oct 2023 23:29:25 +0530 Subject: [PATCH 08/16] [MOSIP-29245] Added chart-lint-publish.yml (#57) [MOSIP-25631] Signed-off-by: syed salman --- .github/workflows/chart-lint-publish.yml | 62 ++++++++++++++++++++++++ .github/workflows/push-trigger.yml | 2 +- .github/workflows/release-chart.yml | 24 --------- .gitignore | 3 ++ 4 files changed, 66 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/chart-lint-publish.yml delete mode 100644 .github/workflows/release-chart.yml create mode 100644 .gitignore diff --git a/.github/workflows/chart-lint-publish.yml b/.github/workflows/chart-lint-publish.yml new file mode 100644 index 0000000..b8d6c89 --- /dev/null +++ b/.github/workflows/chart-lint-publish.yml @@ -0,0 +1,62 @@ +name: Validate / Publish helm charts + +on: + release: + types: [published] + pull_request: + types: [opened, reopened, synchronize] + paths: + - 'charts/**' + workflow_dispatch: + inputs: + IGNORE_CHARTS: + description: 'Provide list of charts to be ignored separated by pipe(|)' + required: false + default: '' + type: string + CHART_PUBLISH: + description: 'Chart publishing to gh-pages branch' + required: false + default: 'NO' + type: string + options: + - YES + - NO + INCLUDE_ALL_CHARTS: + description: 'Include all charts for Linting/Publishing (YES/NO)' + required: false + default: 'NO' + type: string + options: + - YES + - NO + push: + branches: + - '!release-branch' + - master + - 1.* + - 0.* + - develop + - MOSIP* + - release* + paths: + - 'charts/**' + +jobs: + chart-lint-publish: + uses: mosip/kattu/.github/workflows/chart-lint-publish.yml@master + with: + CHARTS_DIR: ./helm + CHARTS_URL: https://mosip.github.io/mosip-helm + REPOSITORY: mosip-helm + BRANCH: gh-pages + INCLUDE_ALL_CHARTS: "${{ inputs.INCLUDE_ALL_CHARTS || 'NO' }}" + IGNORE_CHARTS: "${{ inputs.IGNORE_CHARTS ||'redis' }}" + CHART_PUBLISH: "${{ inputs.CHART_PUBLISH || 'YES' }}" + LINTING_CHART_SCHEMA_YAML_URL: "https://raw.githubusercontent.com/mosip/kattu/master/.github/helm-lint-configs/chart-schema.yaml" + LINTING_LINTCONF_YAML_URL: "https://raw.githubusercontent.com/mosip/kattu/master/.github/helm-lint-configs/lintconf.yaml" + LINTING_CHART_TESTING_CONFIG_YAML_URL: "https://raw.githubusercontent.com/mosip/kattu/master/.github/helm-lint-configs/chart-testing-config.yaml" + LINTING_HEALTH_CHECK_SCHEMA_YAML_URL: "https://raw.githubusercontent.com/mosip/kattu/master/.github/helm-lint-configs/health-check-schema.yaml" + secrets: + TOKEN: ${{ secrets.ACTION_PAT }} + 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 index bc506c1..2e4d6fb 100644 --- a/.github/workflows/push-trigger.yml +++ b/.github/workflows/push-trigger.yml @@ -4,7 +4,7 @@ on: release: types: [published] pull_request: - types: [opened] + types: [opened, reopened, synchronize] workflow_dispatch: inputs: message: diff --git a/.github/workflows/release-chart.yml b/.github/workflows/release-chart.yml deleted file mode 100644 index 4028b41..0000000 --- a/.github/workflows/release-chart.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: release-chart -on: - push: - branches: - - master - - 1.* - - 0.* - - develop - paths: - - 'helm/**' - -jobs: - release-chart: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Publish Helm chart - uses: stefanprodan/helm-gh-pages@v1.7.0 - with: - token: ${{ secrets.ACTION_PAT }} - charts_dir: ./helm - charts_url: https://mosip.github.io/mosip-helm - repository: mosip-helm - branch: gh-pages \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..239b3db --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea +helm/*/charts +helm/*/Chart.lock \ No newline at end of file From 4f720e6435ecf271cb16aefba606047084644867 Mon Sep 17 00:00:00 2001 From: techno-467 Date: Thu, 26 Oct 2023 11:44:37 +0530 Subject: [PATCH 09/16] [DSD-3708] updated resources in values.yml Signed-off-by: techno-467 --- helm/digitalcard/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helm/digitalcard/values.yaml b/helm/digitalcard/values.yaml index 7543229..d3fab2f 100644 --- a/helm/digitalcard/values.yaml +++ b/helm/digitalcard/values.yaml @@ -126,10 +126,10 @@ resources: # resources, such as Minikube. If you do want to specify resources, uncomment the following # lines, adjust them as necessary, and remove the curly braces after 'resources:'. limits: - cpu: 500m + cpu: 1000m memory: 3000Mi requests: - cpu: 300m + cpu: 700m memory: 2000Mi additionalResources: From 116848a159d66dada47f1794127e697017c448d1 Mon Sep 17 00:00:00 2001 From: dhanendra06 <60607841+dhanendra06@users.noreply.github.com> Date: Thu, 23 Nov 2023 15:41:38 +0530 Subject: [PATCH 10/16] Updated vc-verifier dependency Signed-off-by: dhanendra06 <60607841+dhanendra06@users.noreply.github.com> --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 6a959db..fd8d65b 100644 --- a/pom.xml +++ b/pom.xml @@ -151,7 +151,7 @@ io.mosip.vercred vcverifier - 1.0-SNAPSHOT + 1.0.0 org.springframework.cloud @@ -359,4 +359,4 @@ https://github.com/mosip/commons - \ No newline at end of file + From 2f54e14e5d58b04973c9c25fd2ad1d4db259cf77 Mon Sep 17 00:00:00 2001 From: Rakshithb1 <79500257+Rakshithb1@users.noreply.github.com> Date: Fri, 24 Nov 2023 16:48:46 +0530 Subject: [PATCH 11/16] [MOSIP-29918] added db-test.yml and updated grants.sql (#66) * [MOSIP-29918] added db-test.yml (#64) Signed-off-by: Rakshithb1 * [MOSIP-29918] added db-test.yml and updated grants.sql Signed-off-by: Rakshithb1 * [MOSIP-29918] updated grants.sql Signed-off-by: Rakshithb1 --------- Signed-off-by: Rakshithb1 --- .github/workflows/db-test.yml | 39 +++++++++++++++++++++++++ db_scripts/mosip_digitalcard/grants.sql | 3 ++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/db-test.yml diff --git a/.github/workflows/db-test.yml b/.github/workflows/db-test.yml new file mode 100644 index 0000000..e999af3 --- /dev/null +++ b/.github/workflows/db-test.yml @@ -0,0 +1,39 @@ +name: PostgreSQL Test + +on: + release: + types: [published] + pull_request: + types: [opened, reopened, synchronize] + paths: + - 'db_scripts/**' + 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* + paths: + - 'db_scripts/**' + +jobs: + build-db-test: + strategy: + matrix: + include: + - DB_LOCATION: 'db_scripts/mosip_digitalcard' + DB_NAME: 'mosip_digitalcard' + fail-fast: false + name: ${{ matrix.DB_NAME }} + uses: mosip/kattu/.github/workflows/db-test.yml@master + with: + DB_LOCATION: ${{ matrix.DB_LOCATION}} diff --git a/db_scripts/mosip_digitalcard/grants.sql b/db_scripts/mosip_digitalcard/grants.sql index d7bb8ac..b4e74cd 100644 --- a/db_scripts/mosip_digitalcard/grants.sql +++ b/db_scripts/mosip_digitalcard/grants.sql @@ -1,3 +1,6 @@ +\c mosip_digitalcard + + GRANT CONNECT ON DATABASE mosip_digitalcard TO digitalcarduser; From bb9f823a8ab16dffbd42530a9017d2524d72db5e Mon Sep 17 00:00:00 2001 From: VSIVAKALYAN <103260988+VSIVAKALYAN@users.noreply.github.com> Date: Thu, 30 Nov 2023 05:18:57 +0530 Subject: [PATCH 12/16] [DSD-3919] Updated chart-lint-publish.yml (#71) Signed-off-by: VSIVAKALYAN <103260988+VSIVAKALYAN@users.noreply.github.com> --- .github/workflows/chart-lint-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/chart-lint-publish.yml b/.github/workflows/chart-lint-publish.yml index b8d6c89..80f2b96 100644 --- a/.github/workflows/chart-lint-publish.yml +++ b/.github/workflows/chart-lint-publish.yml @@ -40,7 +40,7 @@ on: - MOSIP* - release* paths: - - 'charts/**' + - './helm/**' jobs: chart-lint-publish: @@ -59,4 +59,4 @@ jobs: LINTING_HEALTH_CHECK_SCHEMA_YAML_URL: "https://raw.githubusercontent.com/mosip/kattu/master/.github/helm-lint-configs/health-check-schema.yaml" secrets: TOKEN: ${{ secrets.ACTION_PAT }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} \ No newline at end of file + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} From 55a1dec40ff633db994f70d897a1e26d72c16ab6 Mon Sep 17 00:00:00 2001 From: Rakshith B <79500257+Rakshithb1@users.noreply.github.com> Date: Fri, 15 Dec 2023 13:32:48 +0530 Subject: [PATCH 13/16] [MOSIP-29961] removed paths from db-test.yml (#79) Signed-off-by: Rakshith B <79500257+Rakshithb1@users.noreply.github.com> --- .github/workflows/db-test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/db-test.yml b/.github/workflows/db-test.yml index e999af3..c8f3a89 100644 --- a/.github/workflows/db-test.yml +++ b/.github/workflows/db-test.yml @@ -5,8 +5,6 @@ on: types: [published] pull_request: types: [opened, reopened, synchronize] - paths: - - 'db_scripts/**' workflow_dispatch: inputs: message: From a8d9d1043df9aee72f849671d63e27bfb0b390b0 Mon Sep 17 00:00:00 2001 From: Chandra Keshav Mishra Date: Wed, 6 Mar 2024 18:03:19 +0530 Subject: [PATCH 14/16] Release changes (#87) * Updated Pom versions for release changes Signed-off-by: GitHub * Update Chart.yaml Signed-off-by: Praful Rakhade <99539100+Prafulrakhade@users.noreply.github.com> * Update install.sh Signed-off-by: Praful Rakhade <99539100+Prafulrakhade@users.noreply.github.com> * Update values.yaml Signed-off-by: Praful Rakhade <99539100+Prafulrakhade@users.noreply.github.com> * Update install.sh Signed-off-by: Praful Rakhade <99539100+Prafulrakhade@users.noreply.github.com> --------- Signed-off-by: GitHub Signed-off-by: Praful Rakhade <99539100+Prafulrakhade@users.noreply.github.com> Co-authored-by: Prafulrakhade Co-authored-by: Praful Rakhade <99539100+Prafulrakhade@users.noreply.github.com> --- .github/workflows/push-trigger.yml | 2 +- helm/digitalcard/Chart.yaml | 2 +- helm/digitalcard/install.sh | 4 ++-- helm/digitalcard/values.yaml | 4 ++-- partner-onboarder/install.sh | 2 +- pom.xml | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/push-trigger.yml b/.github/workflows/push-trigger.yml index 2e4d6fb..2c49848 100644 --- a/.github/workflows/push-trigger.yml +++ b/.github/workflows/push-trigger.yml @@ -43,7 +43,7 @@ jobs: secrets: OSSRH_USER: ${{ secrets.OSSRH_USER }} OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }} - OSSRH_URL: ${{ secrets.OSSRH_SNAPSHOT_URL }} + OSSRH_URL: ${{ secrets.RELEASE_URL }} OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} GPG_SECRET: ${{ secrets.GPG_SECRET }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} diff --git a/helm/digitalcard/Chart.yaml b/helm/digitalcard/Chart.yaml index 360954f..2caed5e 100644 --- a/helm/digitalcard/Chart.yaml +++ b/helm/digitalcard/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: digitalcard description: A Helm chart for Digital Card Service type: application -version: 12.0.2 +version: 12.0.1 appVersion: "" dependencies: - name: common diff --git a/helm/digitalcard/install.sh b/helm/digitalcard/install.sh index bbc0c91..af20a10 100755 --- a/helm/digitalcard/install.sh +++ b/helm/digitalcard/install.sh @@ -8,7 +8,7 @@ fi NS=digitalcard -CHART_VERSION=12.0.2 +CHART_VERSION=12.0.1 echo Create $NS namespace kubectl create ns $NS @@ -33,4 +33,4 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true set -o nounset ## set -u : exit the script if you try to use an uninitialised variable set -o errtrace # trace ERR through 'time command' and other functions set -o pipefail # trace ERR through pipes -installing_digitalcard # calling function \ No newline at end of file +installing_digitalcard # calling function diff --git a/helm/digitalcard/values.yaml b/helm/digitalcard/values.yaml index d3fab2f..496e3a5 100644 --- a/helm/digitalcard/values.yaml +++ b/helm/digitalcard/values.yaml @@ -52,8 +52,8 @@ service: image: registry: docker.io - repository: mosipdev/digital-card-service - tag: develop + repository: mosipid/digital-card-service + tag: 1.2.0.1 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images diff --git a/partner-onboarder/install.sh b/partner-onboarder/install.sh index 5115438..1f53dbe 100755 --- a/partner-onboarder/install.sh +++ b/partner-onboarder/install.sh @@ -21,7 +21,7 @@ if [ "$flag" = "n" ]; then fi NS=digitalcard -CHART_VERSION=12.0.2 +CHART_VERSION=12.0.1 echo Create $NS namespace kubectl create ns $NS diff --git a/pom.xml b/pom.xml index fd8d65b..ebebf67 100644 --- a/pom.xml +++ b/pom.xml @@ -11,19 +11,19 @@ io.mosip.digitalcard digital-card-service - 1.2.0.1-SNAPSHOT + 1.2.0.1 digital-card-service 11 11 - 1.2.0.1-SNAPSHOT + 1.2.0.1 2.0.2.RELEASE 2.0.7.RELEASE 5.0.5.RELEASE 2.0.4.RELEASE 2.9.2 - 1.2.0.1-SNAPSHOT + 1.2.0.1 2.8.4 From c169eaf69bdb51b0eaaaaa69e7d24e8f4a2a674b Mon Sep 17 00:00:00 2001 From: ckm007 Date: Wed, 6 Mar 2024 17:25:24 +0000 Subject: [PATCH 15/16] [DSD-4772] PLA 1.2.0.1 release changes code to master --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c26c681..ad3dffc 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # digital-card-service Service resposible to auto generate digital card once the registration packet is processed by registration processor module + From 6f2358843127a32872b5146a3febc8a6bd7cbbab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 17:27:48 +0000 Subject: [PATCH 16/16] Bump com.google.code.gson:gson from 2.8.4 to 2.8.9 Bumps [com.google.code.gson:gson](https://github.com/google/gson) from 2.8.4 to 2.8.9. - [Release notes](https://github.com/google/gson/releases) - [Changelog](https://github.com/google/gson/blob/main/CHANGELOG.md) - [Commits](https://github.com/google/gson/compare/gson-parent-2.8.4...gson-parent-2.8.9) --- updated-dependencies: - dependency-name: com.google.code.gson:gson dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ebebf67..ee97d98 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ 2.0.4.RELEASE 2.9.2 1.2.0.1 - 2.8.4 + 2.8.9