Skip to content

ValueLink API access #1133

ValueLink API access

ValueLink API access #1133

name: OnBoarding_Service
on:
workflow_call:
issues:
types:
- labeled
jobs:
Tenant-Onboarding-Process:
if: github.event.label.name == 'Onboard New Tenant'
runs-on: ubuntu-latest
steps:
- name: View issue information
run: |
echo "🎉 The job automatically triggered by a ${{ github.event_name }} event."
echo "Issue title: ${{ github.event.issue.title }}"
echo "Issue No: ${{ github.event.issue.number }}"
echo "Issue body: ${{ github.event.issue.body }}"
- name: Creating new Temp sub dir 'service'
run: |
mkdir -m 777 service
cd service
pwd
ls -la
- name: Checkout /Fiserv/tenant-onboarding Repo at ${{ github.workspace }}/service
uses: actions/checkout@v3
with:
repository: Fiserv/tenant-onboarding
ref: develop
path: ${{ github.workspace }}/service
- name: List files in the repository
run: |
cd ${{ github.workspace }}
pwd
ls -la
cd ${{ github.workspace }}/service
pwd
ls -la
- run: echo "💡 The Fiserv/tenant-onboarding repository has been cloned on root"
- run: echo "🖥️ The workflow is now ready to run Onboarding service on the runner."
- name: List files in the repository
run: |
pwd
ls -la
- name: Running Tenant Generator.....
id: build
env:
GITHUB_AUTH_TOKEN: ${{ secrets.ZIP_GENERATOR_ACTION }}
run: |
pwd
cd ${{github.workspace}}/service/scripts
ls -la
npmv=$(npm --version)
echo "NPM version installed : " $npmv
nodev=$(node --version)
echo "Node version installed : " $nodev
npm install
echo " Repo: ${{ github.repository }}"
echo " Space: ${{ github.workspace }}"
result=$(node service.js ${{ github.event.issue.number }})
echo "********** TENANT CONFIGURATION *********************"
echo "$result"
if [[ $result == *'FAILED'* ]] ;then
echo "Onboarding config writer failed and exiting the Job..."
exit 1
else
echo "TENANT="$result >> $GITHUB_OUTPUT
echo "Onboarding config writer Ran Successfully....🍏"
cd ${{ github.workspace }}/service
tenant=$(./startup.sh -f '-rthde')
echo "tenant"
fi
- run: |
echo "🍏 This job's status is ${{ job.status }}."
pwd
cd ${{ github.workspace }}/service
pwd
ls -la
- name: Pushing tenant file remotely
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.ZIP_GENERATOR_ACTION }}
with:
source_file: '${{github.workspace}}/service/tenant.json'
destination_repo: 'Fiserv/${{steps.build.outputs.TENANT}}'
destination_folder: 'config'
destination_branch: 'develop'
user_email: 'supriya.nirmale@fiserv.com'
user_name: 'sfiserv'
commit_message: 'pushing tenant json file remotely'
- name: Pushing DbScript file remotely
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.ZIP_GENERATOR_ACTION }}
with:
source_file: '${{github.workspace}}/service/dbscripts/'
destination_repo: 'Fiserv/tenants-data'
destination_folder: 'dbscripts/${{steps.build.outputs.TENANT}}'
destination_branch: 'main'
user_email: 'supriya.nirmale@fiserv.com'
user_name: 'sfiserv'
commit_message: 'pushing DbScript file remotely'
- name: Applying Branch Protection.....
if: '!cancelled()'
env:
GITHUB_AUTH_TOKEN: ${{ secrets.ZIP_GENERATOR_ACTION }}
run: |
cd ${{ github.workspace }}/service
tenant=$(./startup.sh -f '-be')
echo "tenant"