Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nrcid Deduplication changes #25

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .github/workflows/group_1_push_trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Registration Processor Group 1 Maven Package upon a push


on: workflow_dispatch

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 "<settings> <servers> <server> <id>ossrh</id> <username>${{secrets.ossrh_user}}</username> <password>${{secrets.ossrh_secret}}</password> </server> </servers> <profiles> <profile> <id>ossrh</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <gpg.executable>gpg2</gpg.executable> <gpg.passphrase>${{secrets.gpg_secret}}</gpg.passphrase> </properties> </profile> <profile> <id>allow-snapshots</id> <activation><activeByDefault>true</activeByDefault></activation> <repositories> <repository> <id>snapshots-repo</id> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases><enabled>false</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> <repository> <id>releases-repo</id> <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>false</enabled></snapshots> </repository> </repositories> </profile> <profile> <id>sonar</id> <properties> <sonar.sources>.</sonar.sources> <sonar.host.url>https://sonarcloud.io</sonar.host.url> </properties> <activation> <activeByDefault>false</activeByDefault> </activation> </profile> </profiles> </settings>" > $GITHUB_WORKSPACE/settings.xml

- name: Build with Maven
run: |
cd registration-processor
mvn -B package -s $GITHUB_WORKSPACE/settings.xml -DskipTests -Dgpg.skip=true --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

- name: Build registration-processor-stage-group-1 image
run: |
# The Mosip Stage Executor is not packaged as part of release.zip
cd "./$SERVICE_LOCATION"
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 $SERVICE_NAME
env:
SERVICE_NAME: registration-processor-stage-group-1
SERVICE_LOCATION: registration-processor/stage-groups/registration-processor-stage-group-1

- 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]')
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
env:
NAMESPACE: ${{ secrets.dev_namespace_docker_hub }}
SERVICE_NAME: registration-processor-stage-group-1
SERVICE_LOCATION: registration-processor/stage-groups/registration-processor-stage-group-1
88 changes: 88 additions & 0 deletions .github/workflows/group_2_push_trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Registration Processor Group 2 Maven Package upon a push


on: workflow_dispatch

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 "<settings> <servers> <server> <id>ossrh</id> <username>${{secrets.ossrh_user}}</username> <password>${{secrets.ossrh_secret}}</password> </server> </servers> <profiles> <profile> <id>ossrh</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <gpg.executable>gpg2</gpg.executable> <gpg.passphrase>${{secrets.gpg_secret}}</gpg.passphrase> </properties> </profile> <profile> <id>allow-snapshots</id> <activation><activeByDefault>true</activeByDefault></activation> <repositories> <repository> <id>snapshots-repo</id> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases><enabled>false</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> <repository> <id>releases-repo</id> <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>false</enabled></snapshots> </repository> </repositories> </profile> <profile> <id>sonar</id> <properties> <sonar.sources>.</sonar.sources> <sonar.host.url>https://sonarcloud.io</sonar.host.url> </properties> <activation> <activeByDefault>false</activeByDefault> </activation> </profile> </profiles> </settings>" > $GITHUB_WORKSPACE/settings.xml

- name: Build with Maven
run: |
cd registration-processor
mvn -B package -s $GITHUB_WORKSPACE/settings.xml -DskipTests -Dgpg.skip=true --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

- name: Build registration-processor-stage-group-2 image
run: |
# The Mosip Stage Executor is not packaged as part of release.zip
cd "./$SERVICE_LOCATION"
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 $SERVICE_NAME
env:
SERVICE_NAME: registration-processor-stage-group-2
SERVICE_LOCATION: registration-processor/stage-groups/registration-processor-stage-group-2

- 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]')
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
env:
NAMESPACE: ${{ secrets.dev_namespace_docker_hub }}
SERVICE_NAME: registration-processor-stage-group-2
SERVICE_LOCATION: registration-processor/stage-groups/registration-processor-stage-group-2
88 changes: 88 additions & 0 deletions .github/workflows/group_3_push_trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Registration Processor Group 3 Maven Package upon a push


on: workflow_dispatch

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 "<settings> <servers> <server> <id>ossrh</id> <username>${{secrets.ossrh_user}}</username> <password>${{secrets.ossrh_secret}}</password> </server> </servers> <profiles> <profile> <id>ossrh</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <gpg.executable>gpg2</gpg.executable> <gpg.passphrase>${{secrets.gpg_secret}}</gpg.passphrase> </properties> </profile> <profile> <id>allow-snapshots</id> <activation><activeByDefault>true</activeByDefault></activation> <repositories> <repository> <id>snapshots-repo</id> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases><enabled>false</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> <repository> <id>releases-repo</id> <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>false</enabled></snapshots> </repository> </repositories> </profile> <profile> <id>sonar</id> <properties> <sonar.sources>.</sonar.sources> <sonar.host.url>https://sonarcloud.io</sonar.host.url> </properties> <activation> <activeByDefault>false</activeByDefault> </activation> </profile> </profiles> </settings>" > $GITHUB_WORKSPACE/settings.xml

- name: Build with Maven
run: |
cd registration-processor
mvn -B package -s $GITHUB_WORKSPACE/settings.xml -DskipTests -Dgpg.skip=true --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

- name: Build registration-processor-stage-group-3 image
run: |
# The Mosip Stage Executor is not packaged as part of release.zip
cd "./$SERVICE_LOCATION"
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 $SERVICE_NAME
env:
SERVICE_NAME: registration-processor-stage-group-3
SERVICE_LOCATION: registration-processor/stage-groups/registration-processor-stage-group-3

- 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]')
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
env:
NAMESPACE: ${{ secrets.dev_namespace_docker_hub }}
SERVICE_NAME: registration-processor-stage-group-3
SERVICE_LOCATION: registration-processor/stage-groups/registration-processor-stage-group-3
88 changes: 88 additions & 0 deletions .github/workflows/group_4_push_trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Registration Processor Group 4 Maven Package upon a push


on: workflow_dispatch

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 "<settings> <servers> <server> <id>ossrh</id> <username>${{secrets.ossrh_user}}</username> <password>${{secrets.ossrh_secret}}</password> </server> </servers> <profiles> <profile> <id>ossrh</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <gpg.executable>gpg2</gpg.executable> <gpg.passphrase>${{secrets.gpg_secret}}</gpg.passphrase> </properties> </profile> <profile> <id>allow-snapshots</id> <activation><activeByDefault>true</activeByDefault></activation> <repositories> <repository> <id>snapshots-repo</id> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases><enabled>false</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> <repository> <id>releases-repo</id> <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>false</enabled></snapshots> </repository> </repositories> </profile> <profile> <id>sonar</id> <properties> <sonar.sources>.</sonar.sources> <sonar.host.url>https://sonarcloud.io</sonar.host.url> </properties> <activation> <activeByDefault>false</activeByDefault> </activation> </profile> </profiles> </settings>" > $GITHUB_WORKSPACE/settings.xml

- name: Build with Maven
run: |
cd registration-processor
mvn -B package -s $GITHUB_WORKSPACE/settings.xml -DskipTests -Dgpg.skip=true --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

- name: Build registration-processor-stage-group-4 image
run: |
# The Mosip Stage Executor is not packaged as part of release.zip
cd "./$SERVICE_LOCATION"
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 $SERVICE_NAME
env:
SERVICE_NAME: registration-processor-stage-group-4
SERVICE_LOCATION: registration-processor/stage-groups/registration-processor-stage-group-4

- 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]')
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
env:
NAMESPACE: ${{ secrets.dev_namespace_docker_hub }}
SERVICE_NAME: registration-processor-stage-group-4
SERVICE_LOCATION: registration-processor/stage-groups/registration-processor-stage-group-4
Loading
Loading