From d068cb31b5fc315ac5a659276b79622ee0a5c98a Mon Sep 17 00:00:00 2001 From: sunil Date: Tue, 7 Jul 2026 13:25:59 +0530 Subject: [PATCH 1/2] chore: remove obsolete SonarCloud integrations Co-authored-by: Cursor --- .copilotignore | 1 - .gitignore | 1 - package-lock.json | 24 ------------------------ package.json | 2 -- sonar-project.properties | 13 ------------- 5 files changed, 41 deletions(-) delete mode 100644 sonar-project.properties diff --git a/.copilotignore b/.copilotignore index 1bc42925b7..b5321ca95f 100644 --- a/.copilotignore +++ b/.copilotignore @@ -23,7 +23,6 @@ appspec*.yml serverless*.yml docker-compose*.yml *.sh -sonar-project.properties # ignore temporary and log files tmp/ diff --git a/.gitignore b/.gitignore index 56add165af..db622daa3b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ .sourcemaps/ .sass-cache/ .tmp/ -.sonarlint .vscode/ assets/newrelic.js diff --git a/package-lock.json b/package-lock.json index cb15075709..cda7cd6efa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -91,7 +91,6 @@ "karma-jasmine-html-reporter": "~2.1.0", "karma-junit-reporter": "~2.0.1", "karma-ng-html2js-preprocessor": "^1.0.0", - "karma-sonarqube-unit-reporter": "0.0.23", "ng-packagr": "20.3.2", "serverless": "^3.38.0", "serverless-certificate-creator": "^1.6.0", @@ -18980,29 +18979,6 @@ "karma": ">=0.9" } }, - "node_modules/karma-sonarqube-unit-reporter": { - "version": "0.0.23", - "resolved": "https://registry.npmjs.org/karma-sonarqube-unit-reporter/-/karma-sonarqube-unit-reporter-0.0.23.tgz", - "integrity": "sha512-Mp1b8pkZzFxRWS2eeEDzkrPXIlotRckLJ0C2fXUiUoilAVYJ5AiAyYN14cJzxGbRx65DdXBpu5LI+lt+MHigWA==", - "dev": true, - "license": "MIT", - "dependencies": { - "xmlbuilder": "^13.0.2" - }, - "peerDependencies": { - "karma": ">=0.9" - } - }, - "node_modules/karma-sonarqube-unit-reporter/node_modules/xmlbuilder": { - "version": "13.0.2", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-13.0.2.tgz", - "integrity": "sha512-Eux0i2QdDYKbdbA6AM6xE4m6ZTZr4G4xF9kahI2ukSEMCzwce2eX9WlTI5J3s+NU7hpasFsr8hWIONae7LluAQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.0" - } - }, "node_modules/karma-source-map-support": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/karma-source-map-support/-/karma-source-map-support-1.4.0.tgz", diff --git a/package.json b/package.json index de6a419a77..b46fe242d9 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "deploy": "ng build --base-href '/practera-app-v2/' && git commit -am 'Build to Github Page' && git subtree push --prefix www origin gh-pages", "postdeploy": "npm run generate-version", "test": "ng test v3 --no-watch", - "sonar-test": "ng test --no-watch --code-coverage --browsers ChromeHeadless --karmaConfig=src/karma.conf.sonarci.js", "lint": "ng lint v3", "lint-fix": "ng lint --fix", "lintv3": "ng lint v3", @@ -124,7 +123,6 @@ "karma-jasmine-html-reporter": "~2.1.0", "karma-junit-reporter": "~2.0.1", "karma-ng-html2js-preprocessor": "^1.0.0", - "karma-sonarqube-unit-reporter": "0.0.23", "ng-packagr": "20.3.2", "serverless": "^3.38.0", "serverless-certificate-creator": "^1.6.0", diff --git a/sonar-project.properties b/sonar-project.properties deleted file mode 100644 index 9f2c303813..0000000000 --- a/sonar-project.properties +++ /dev/null @@ -1,13 +0,0 @@ -sonar.projectKey=intersective_practera-app-v2 -sonar.organization=intersective -sonar.projectName=practera-app-v2 -sonar.projectVersion=1.0 -sonar.sources=src -sonar.tests=src -sonar.test.inclusions=**/*.spec.ts -sonar.coverage.exclusions=**/testing/**,**/*.spec.ts,.git/**,www/**,scripts/**,node_modules/**,e2e/**,electron/**,src/assets/*,src/scripts/*,src/environments/**,src/karma.*.js,.github/**,hooks/**,src/*.ts -sonar.exclusions=node_modules/**,coverage/**,.scannerwork/**,.nyc_output/** -sonar.javascript.lcov.reportPaths=tests/coverage/lcov.info -sonar.testExecutionReportPaths=tests/ut_report.xml -sonar.dynamicAnalysis=reuseReports -sonar.sourceEncoding=UTF-8 \ No newline at end of file From ce342dcc174dc5fce86946f681897b5da12b57a5 Mon Sep 17 00:00:00 2001 From: sunil Date: Tue, 7 Jul 2026 13:39:07 +0530 Subject: [PATCH 2/2] chore: remove obsolete GitHub workflows Co-authored-by: Cursor --- .github/workflows/p2-aus.yml | 321 ------------------------- .github/workflows/p2-euk.yml | 320 ------------------------- .github/workflows/p2-prerelease.yml | 356 ---------------------------- .github/workflows/p2-sandbox.yml | 317 ------------------------- .github/workflows/p2-stage.yml | 346 --------------------------- .github/workflows/p2-usa.yml | 322 ------------------------- .github/workflows/pull-req.yml | 202 ---------------- 7 files changed, 2184 deletions(-) delete mode 100644 .github/workflows/p2-aus.yml delete mode 100644 .github/workflows/p2-euk.yml delete mode 100644 .github/workflows/p2-prerelease.yml delete mode 100644 .github/workflows/p2-sandbox.yml delete mode 100644 .github/workflows/p2-stage.yml delete mode 100644 .github/workflows/p2-usa.yml delete mode 100644 .github/workflows/pull-req.yml diff --git a/.github/workflows/p2-aus.yml b/.github/workflows/p2-aus.yml deleted file mode 100644 index 6296d27363..0000000000 --- a/.github/workflows/p2-aus.yml +++ /dev/null @@ -1,321 +0,0 @@ -################################################ -# GITHUB ACTION WORKFLOW NAME -################################################ -name: Deploy to p2-aus live environment - - -################################################ -# GITHUB ACTION EVENT TRIGGER -################################################ -on: - workflow_dispatch: - inputs: - BRANCH_TAG_NAME: - description: 'New tag version based on create-release-tag workflow' - required: true - default: '' - -################################################ -# GITHUB ACTION JOBS -################################################ -jobs: - deploy-p2-aus-live: - name: deploy-p2-aus-live - runs-on: ubuntu-latest - environment: p2-aus - permissions: write-all - timeout-minutes: 15 - - -################################################ -# GITHUB ACTIONS GLOBAL ENV VARIABLES -################################################ - env: - REGION : ap-southeast-2 - ENV : live # Valid values are dev,test,live only - STACK_NAME: p2-aus # Valid values are au,us,uk,p2,lf,nu,p1-sandbox,p1-stage,p2-sandbox,shared only - ROOTSTACK: app-v2 - CFNS3BucketName: devops-cfn-templates - PRIVATES3BucketName: devops-shared-private - PUBLICZONENAME: aus.practera.com - APPPUBLICZONENAME: aus.practera.app - BUILD_CONFIG: custom - STATUSREPORTS3Bucket: deployment-status.practera.com - STATUS: DEPLOYED - REQUESTOR: ${{ github.event.inputs.REQUESTOR }} - REASON: ${{ github.event.inputs.REASON }} - ENDPOINT: app-old.aus.practera.com - BRANCH_TAG_NAME: ${{ github.event.inputs.BRANCH_TAG_NAME }} - AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} - -################################################ -# GITHUB REPO CHECKOUT -################################################ - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - ref: ${{ github.event.inputs.BRANCH_TAG_NAME }} - - - -################################################ -# NODE ENV -################################################ - - name: Setup Node.js environment - uses: actions/setup-node@v4 - with: - node-version: 20.20.2 - - -################################################ -# NODE MODULES CACHE -################################################ - - name: Cache node modules - uses: actions/cache@v4 - id: cache-node-modules - env: - cache-name: cache - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: | - ~/.npm - node_modules - */*/node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - -################################################ -# NODE MODULES INSTALL -################################################ - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: npm ci --ignore-scripts - -################################################ -# GET P2 AUS AWS ORGANIZATION NUMBER -################################################ - - name: Get AWS Organization Number - id: AWS_ORG - run: | - P2AUS=$(echo $AWS_ACCOUNT_ID | jq -r .P2AUS) - CENTRALIZED=$(echo $AWS_ACCOUNT_ID | jq -r .CENTRALIZED) - - echo "::add-mask::$P2AUS" - echo "::add-mask::$CENTRALIZED" - - echo "P2AUS=$P2AUS" >> $GITHUB_OUTPUT - echo "CENTRALIZED=$CENTRALIZED" >> $GITHUB_OUTPUT - -################################################ -# AWS CLI CONFIGURATION - CENTRALIZED ACCOUNT -################################################ - - name: Configure AWS Credentials from P1 Centralized account - uses: ./.github/actions/aws-oidc - with: - role-to-assume: arn:aws:iam::${{ steps.AWS_ORG.outputs.CENTRALIZED }}:role/github-restricted-role-to-assume - region: ${{ env.REGION }} - -############################################################### -# SERVERLESS DEPLOYMENT VARIABLES FROM SHARED ACCOUNT -############################################################## - - name: Serverless deployment variables created from shared account - run: | - cat >> .env <> $GITHUB_ENV - - env: - CUSTOM_PATH_IMAGE: /appv2/live/images/ - CUSTOM_PATH_VIDEO: /appv2/live/videos/ - CUSTOM_GRAPH_QL: https://core-graphql-api.${{ env.PUBLICZONENAME }} - CUSTOM_API_ENDPOINT: https://${{ env.PUBLICZONENAME }}/ - CUSTOM_S3_BUCKET: files.${{ env.PUBLICZONENAME }} - CUSTOM_ENVIRONMENT: ${{ env.ENV }} - CUSTOM_CHAT_GRAPH_QL: https://chat-api.${{ env.PUBLICZONENAME }} - CUSTOM_GLOBAL_LOGIN_URL: https://login.practera.com - CUSTOM_COUNTRY: AUS #TODO CHECK - CUSTOMPLAIN_SKIPGLOBALLOGINFLAG: false - CUSTOM_PATH_ANY: /appv2/live/any/ - CUSTOM_AWS_REGION: ${{ env.REGION }} - CUSTOM_JS_ENVIRONEMENT: dev #TODO CHECK - CUSTOM_LOGIN_API_URL: https://login-api.practera.com - CUSTOM_NEWRELIC: false - CUSTOM_APPV3_URL: https://appv3.${{ env.PUBLICZONENAME }} - CUSTOM_SWITCH_APP3: true - - -############################################################### -# BUILD WEB PACKAGES -############################################################## - - name: Build Web Packages - run: | - test -f src/environments/environment.ts && echo "environment here" || cp src/environments/environment.local.ts src/environments/environment.ts - node_modules/.bin/ng build --configuration=${{ env.BUILD_CONFIG }} - npm run generate-version - - -########################################################## -# AWS S3 SYNC - SERVERLESS TEMPLATES -########################################################## - - name: AWS S3 Sync operation - run: | - - aws s3 cp serverless.yml s3://$CFNS3BucketName/$STACK_NAME/$REGION/$ROOTSTACK/sls-templates/serverless.yml - - -########################################################## -# CLOUDFORMATION EXPORT VARIABLES -########################################################## - - name: Cloudformation Export variables - run: | - cat >> .env <> $GITHUB_ENV - -# ################################################ -# # DEVOPS-DEPLOYMENT REPORT -# ################################################ - - name: DevOps Deployment Reporting - if: always() - run: | - pip install --upgrade pip - pip install --upgrade csvtotable - export REASON=$(git log -2 --format=%s | sed -n 2p) - export REQUESTOR=${{ github.actor }} - - aws s3 cp s3://$STATUSREPORTS3Bucket/deploy-reporting.sh deploy-reporting.sh - chmod +x deploy-reporting.sh && ./deploy-reporting.sh - echo "LINK="${GITHUB_REPOSITORY##*/}.html >> $GITHUB_ENV - echo $REASON - echo $REQUESTOR - diff --git a/.github/workflows/p2-euk.yml b/.github/workflows/p2-euk.yml deleted file mode 100644 index 31ae88f773..0000000000 --- a/.github/workflows/p2-euk.yml +++ /dev/null @@ -1,320 +0,0 @@ -################################################ -# GITHUB ACTION WORKFLOW NAME -################################################ -name: Deploy to p2-euk live environment - - -################################################ -# GITHUB ACTION EVENT TRIGGER -################################################ -on: - workflow_dispatch: - inputs: - BRANCH_TAG_NAME: - description: 'New tag version based on create-release-tag workflow' - required: true - default: '' - -################################################ -# GITHUB ACTION JOBS -################################################ -jobs: - deploy-p2-euk-live: - name: deploy-p2-euk-live - runs-on: ubuntu-latest - environment: p2-euk - permissions: write-all - timeout-minutes: 15 - - -################################################ -# GITHUB ACTIONS GLOBAL ENV VARIABLES -################################################ - env: - REGION : eu-west-2 - ENV : live # Valid values are dev,test,live only - STACK_NAME: p2-euk # Valid values are au,us,uk,p2,lf,nu,p1-sandbox,p1-stage,p2-sandbox,shared only - ROOTSTACK: app-v2 - CFNS3BucketName: devops-cfn-templates - PRIVATES3BucketName: devops-shared-private - PUBLICZONENAME: euk.practera.com - APPPUBLICZONENAME: euk.practera.app - BUILD_CONFIG: custom - STATUSREPORTS3Bucket: deployment-status.practera.com - STATUS: DEPLOYED - REQUESTOR: ${{ github.event.inputs.REQUESTOR }} - REASON: ${{ github.event.inputs.REASON }} - ENDPOINT: app-old.euk.practera.com - BRANCH_TAG_NAME: ${{ github.event.inputs.BRANCH_TAG_NAME }} - AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} - -################################################ -# GITHUB REPO CHECKOUT -################################################ - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - ref: ${{ github.event.inputs.BRANCH_TAG_NAME }} - - - -################################################ -# NODE ENV -################################################ - - name: Setup Node.js environment - uses: actions/setup-node@v4 - with: - node-version: 20.20.2 - - -################################################ -# NODE MODULES CACHE -################################################ - - name: Cache node modules - uses: actions/cache@v4 - id: cache-node-modules - env: - cache-name: cache - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: | - ~/.npm - node_modules - */*/node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - -################################################ -# NODE MODULES INSTALL -################################################ - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: npm ci --ignore-scripts - -################################################ -# GET P2 P2EUK AWS ORGANIZATION NUMBER -################################################ - - name: Get AWS Organization Number - id: AWS_ORG - run: | - P2EUK=$(echo $AWS_ACCOUNT_ID | jq -r .P2EUK) - CENTRALIZED=$(echo $AWS_ACCOUNT_ID | jq -r .CENTRALIZED) - - echo "::add-mask::$P2EUK" - echo "::add-mask::$CENTRALIZED" - - echo "P2EUK=$P2EUK" >> $GITHUB_OUTPUT - echo "CENTRALIZED=$CENTRALIZED" >> $GITHUB_OUTPUT - -################################################ -# AWS CLI CONFIGURATION - CENTRALIZED ACCOUNT -################################################ - - name: Configure AWS Credentials from P1 Centralized account - uses: ./.github/actions/aws-oidc - with: - role-to-assume: arn:aws:iam::${{ steps.AWS_ORG.outputs.CENTRALIZED }}:role/github-restricted-role-to-assume - region: ap-southeast-2 - -############################################################### -# SERVERLESS DEPLOYMENT VARIABLES FROM SHARED ACCOUNT -############################################################## - - name: Serverless deployment variables created from shared account - run: | - cat >> .env <> $GITHUB_ENV - - env: - CUSTOM_PATH_IMAGE: /appv2/live/images/ - CUSTOM_PATH_VIDEO: /appv2/live/videos/ - CUSTOM_GRAPH_QL: https://core-graphql-api.${{ env.PUBLICZONENAME }} - CUSTOM_API_ENDPOINT: https://${{ env.PUBLICZONENAME }}/ - CUSTOM_S3_BUCKET: files.${{ env.PUBLICZONENAME }} - CUSTOM_ENVIRONMENT: ${{ env.ENV }} - CUSTOM_CHAT_GRAPH_QL: https://chat-api.${{ env.PUBLICZONENAME }} - CUSTOM_GLOBAL_LOGIN_URL: https://login.practera.com - CUSTOM_COUNTRY: AUS #TODO CHECK - CUSTOMPLAIN_SKIPGLOBALLOGINFLAG: false - CUSTOM_PATH_ANY: /appv2/live/any/ - CUSTOM_AWS_REGION: ${{ env.REGION }} - CUSTOM_JS_ENVIRONEMENT: dev #TODO CHECK - CUSTOM_LOGIN_API_URL: https://login-api.practera.com - CUSTOM_NEWRELIC: false - CUSTOM_APPV3_URL: https://appv3.${{ env.PUBLICZONENAME }} - CUSTOM_SWITCH_APP3: true - -############################################################### -# BUILD WEB PACKAGES -############################################################## - - name: Build Web Packages - run: | - test -f src/environments/environment.ts && echo "environment here" || cp src/environments/environment.local.ts src/environments/environment.ts - node_modules/.bin/ng build --configuration=${{ env.BUILD_CONFIG }} - npm run generate-version - - -########################################################## -# AWS S3 SYNC - SERVERLESS TEMPLATES -########################################################## - - name: AWS S3 Sync operation - run: | - - aws s3 cp serverless.yml s3://$CFNS3BucketName/$STACK_NAME/$REGION/$ROOTSTACK/sls-templates/serverless.yml - - -########################################################## -# CLOUDFORMATION EXPORT VARIABLES -########################################################## - - name: Cloudformation Export variables - run: | - cat >> .env <> $GITHUB_ENV - -# ################################################ -# # DEVOPS-DEPLOYMENT REPORT -# ################################################ - - name: DevOps Deployment Reporting - if: always() - run: | - pip install --upgrade pip - pip install --upgrade csvtotable - export REASON=$(git log -2 --format=%s | sed -n 2p) - export REQUESTOR=${{ github.actor }} - - aws s3 cp s3://$STATUSREPORTS3Bucket/deploy-reporting.sh deploy-reporting.sh - chmod +x deploy-reporting.sh && ./deploy-reporting.sh - echo "LINK="${GITHUB_REPOSITORY##*/}.html >> $GITHUB_ENV - echo $REASON - echo $REQUESTOR - diff --git a/.github/workflows/p2-prerelease.yml b/.github/workflows/p2-prerelease.yml deleted file mode 100644 index 8a783def53..0000000000 --- a/.github/workflows/p2-prerelease.yml +++ /dev/null @@ -1,356 +0,0 @@ -################################################ -# GITHUB ACTION WORKFLOW NAME -################################################ -name: Deploy to p2-prerelease environment - - -################################################ -# GITHUB ACTION EVENT TRIGGER -################################################ -on: - workflow_dispatch: - push: - branches: - - 'prerelease-legacy' - - -################################################ -# GITHUB ACTION JOBS -################################################ -jobs: - deploy-p2-prerelease: - name: deploy-p2-prerelease - runs-on: ubuntu-latest - permissions: write-all - environment: p2-prerelease - timeout-minutes: 15 - - -################################################ -# GITHUB ACTIONS GLOBAL ENV VARIABLES -################################################ - env: - REGION : ap-southeast-2 - ENV : golive # Valid values are dev,test,live only - STACK_NAME: p2-prerelease # Valid values are au,us,uk,p2,lf,nu,p1-sandbox,p1-stage,p2-sandbox,shared only - ROOTSTACK: app-v2 - CFNS3BucketName: devops-cfn-templates - PRIVATES3BucketName: devops-shared-private - PUBLICZONENAME: p2-prerelease.practera.com - APPPUBLICZONENAME: p2-prerelease.practera.app - BUILD_CONFIG: custom - STATUSREPORTS3Bucket: deployment-status.practera.com - STATUS: DEPLOYED - REQUESTOR: ${{ github.event.inputs.REQUESTOR }} - REASON: ${{ github.event.inputs.REASON }} - ENDPOINT: app-old.p2-prerelease.practera.com - AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} - - - - - - steps: - -################################################ -# Export BRANCH_TAG_NAME -################################################ - - name: Get branch for env BRANCH_TAG_NAME - run: | - echo "BRANCH_TAG_NAME="$(echo "$GITHUB_REF_NAME") >> $GITHUB_ENV - -################################################ -# GITHUB REPO CHECKOUT -################################################ - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - -################################################ -# GET P2 PRERELEASE AWS ORGANIZATION NUMBER -################################################ - - name: Get AWS Organization Number - id: AWS_ORG - run: | - P2PRERELEASE=$(echo $AWS_ACCOUNT_ID | jq -r .P2PRERELEASE) - CENTRALIZED=$(echo $AWS_ACCOUNT_ID | jq -r .CENTRALIZED) - - echo "::add-mask::$P2PRERELEASE" - echo "::add-mask::$CENTRALIZED" - - echo "P2PRERELEASE=$P2PRERELEASE" >> $GITHUB_OUTPUT - echo "CENTRALIZED=$CENTRALIZED" >> $GITHUB_OUTPUT - -################################################ -# NODE ENV -################################################ - - name: Setup Node.js environment - uses: actions/setup-node@v4 - with: - node-version: 20.20.2 - - -################################################ -# NODE MODULES CACHE -################################################ - - name: Cache node modules - uses: actions/cache@v4 - id: cache-node-modules - env: - cache-name: cache - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: | - ~/.npm - node_modules - */*/node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - -################################################ -# NODE MODULES INSTALL -################################################ - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: npm ci --ignore-scripts - - -################################################ -# c. P1 AWS ACCESS -# AWS CLI CONFIGURATION - P1 MAIN ACCOUNT -################################################ - - name: Configure AWS Credentials from P1 Centralized account - uses: ./.github/actions/aws-oidc - with: - role-to-assume: arn:aws:iam::${{ steps.AWS_ORG.outputs.CENTRALIZED }}:role/github-restricted-role-to-assume - region: ${{ env.REGION }} - -############################################################### -# SERVERLESS DEPLOYMENT VARIABLES FROM SHARED ACCOUNT -############################################################## - - name: Serverless deployment variables created from shared account - run: | - cat >> .env <> $GITHUB_ENV - - env: - CUSTOM_PATH_IMAGE: /appv2/test/images/ - CUSTOM_PATH_VIDEO: /appv2/test/videos/ - CUSTOM_GRAPH_QL: https://core-graphql-api.${{ env.PUBLICZONENAME }} - CUSTOM_API_ENDPOINT: https://admin.${{ env.PUBLICZONENAME }}/ - CUSTOM_S3_BUCKET: files.${{ env.PUBLICZONENAME }} - CUSTOM_ENVIRONMENT: ${{ env.ENV }} - CUSTOM_CHAT_GRAPH_QL: https://chat-api.${{ env.PUBLICZONENAME }} - CUSTOM_GLOBAL_LOGIN_URL: https://app.login-stage.practera.com - CUSTOM_COUNTRY: AUS #TODO CHECK - CUSTOMPLAIN_SKIPGLOBALLOGINFLAG: false - CUSTOM_PATH_ANY: /appv2/test/any/ - CUSTOM_AWS_REGION: ${{ env.REGION }} - CUSTOM_JS_ENVIRONEMENT: dev #TODO CHECK - CUSTOM_LOGIN_API_URL: https://api.login-stage.practera.com - CUSTOM_NEWRELIC: false - CUSTOM_APPV3_URL: https://appv3.${{ env.PUBLICZONENAME }} - CUSTOM_SWITCH_APP3: true - - -# ################################################ -# # PERFORM LINT TEST -# ################################################ - - name: Run lint test if present - run: | - npm run lint --if-present - - -############################################################### -# BUILD WEB PACKAGES -############################################################## - - name: Build Web Packages - run: | - test -f src/environments/environment.ts && echo "environment here" || cp src/environments/environment.local.ts src/environments/environment.ts - node_modules/.bin/ng build --configuration=${{ env.BUILD_CONFIG }} - npm run generate-version - - -# # ############################################################### -# # # PERFORM UNIT TEST -# # ############################################################## -# - name: Performing Unit test -# run: | -# node_modules/.bin/ng test --karmaConfig=src/karma.conf.sonarci.js --no-watch - - -# # ############################################################### -# # # SONARCLOUD SCANNER -# # ############################################################## -# - name: Performing Sonarcloud Scanner -# uses: SonarSource/sonarcloud-github-action@master -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - - -########################################################## -# AWS S3 SYNC - SERVERLESS TEMPLATES -########################################################## - - name: AWS S3 Sync operation - run: | - - aws s3 cp serverless.yml s3://$CFNS3BucketName/$STACK_NAME/$REGION/$ROOTSTACK/sls-templates/serverless.yml - - -########################################################## -# CLOUDFORMATION EXPORT VARIABLES -########################################################## - - name: Cloudformation Export variables - run: | - cat >> .env <> $GITHUB_ENV - -# ################################################ -# # DEVOPS-DEPLOYMENT REPORT -# ################################################ - - name: DevOps Deployment Reporting - if: always() - run: | - pip install --upgrade pip - pip install --upgrade csvtotable - export REASON=$(git log -2 --format=%s | sed -n 2p) - export REQUESTOR=${{ github.actor }} - - aws s3 cp s3://$STATUSREPORTS3Bucket/deploy-reporting.sh deploy-reporting.sh - chmod +x deploy-reporting.sh && ./deploy-reporting.sh - echo "LINK="${GITHUB_REPOSITORY##*/}.html >> $GITHUB_ENV - echo $REASON - echo $REQUESTOR diff --git a/.github/workflows/p2-sandbox.yml b/.github/workflows/p2-sandbox.yml deleted file mode 100644 index 70544b88db..0000000000 --- a/.github/workflows/p2-sandbox.yml +++ /dev/null @@ -1,317 +0,0 @@ -################################################ -# GITHUB ACTION WORKFLOW NAME -################################################ -name: Deploy to p2-sandbox environment - - -################################################ -# GITHUB ACTION EVENT TRIGGER -################################################ -on: - workflow_dispatch: - push: - branches: [ 'develop-legacy' ] - - -################################################ -# GITHUB ACTION JOBS -################################################ -jobs: - deploy-p2-sandbox: - name: deploy-p2-sandbox - runs-on: ubuntu-latest - environment: p2-sandbox - permissions: write-all - timeout-minutes: 15 - - -################################################ -# GITHUB ACTIONS GLOBAL ENV VARIABLES -################################################ - env: - REGION : ap-southeast-2 - ENV : dev # Valid values are dev,test,live only - STACK_NAME: p2-sandbox # Valid values are au,us,uk,p2,lf,nu,p1-sandbox,p1-stage,p2-sandbox,shared only - ROOTSTACK: app-v2 - CFNS3BucketName: devops-cfn-templates - PRIVATES3BucketName: devops-shared-private - PUBLICZONENAME: p2-sandbox.practera.com - BUILD_CONFIG: custom - STATUSREPORTS3Bucket: deployment-status.practera.com - STATUS: DEPLOYED - REQUESTOR: ${{ github.event.inputs.REQUESTOR }} - REASON: ${{ github.event.inputs.REASON }} - ENDPOINT: app-old.p2-sandbox.practera.com - BRANCH_TAG_NAME: develop-legacy - AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} - -################################################ -# GITHUB REPO CHECKOUT -################################################ - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - - -################################################ -# NODE ENV -################################################ - - name: Setup Node.js environment - uses: actions/setup-node@v4 - with: - node-version: 20.20.2 - - -################################################ -# NODE MODULES CACHE -################################################ - - name: Cache node modules - uses: actions/cache@v4 - id: cache-node-modules - env: - cache-name: cache - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: | - ~/.npm - node_modules - */*/node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - -################################################ -# NODE MODULES INSTALL -################################################ - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: npm ci --ignore-scripts - -################################################ -# GET P2 SANDBOX AWS ORGANIZATION NUMBER -################################################ - - name: Get AWS Organization Number - id: AWS_ORG - run: | - CENTRALIZED=$(echo $AWS_ACCOUNT_ID | jq -r .CENTRALIZED) - P2SANDBOX=$(echo $AWS_ACCOUNT_ID | jq -r .P2SANDBOX) - - echo "::add-mask::$CENTRALIZED" - echo "::add-mask::$P2SANDBOX" - - echo "CENTRALIZED=$CENTRALIZED" >> $GITHUB_OUTPUT - echo "P2SANDBOX=$P2SANDBOX" >> $GITHUB_OUTPUT - -################################################ -# AWS CLI CONFIGURATION - CENTRALIZED ACCOUNT -################################################ - - name: Configure AWS Credentials from CENTRALIZED Account - uses: ./.github/actions/aws-oidc - with: - role-to-assume: arn:aws:iam::${{ steps.AWS_ORG.outputs.CENTRALIZED }}:role/github-restricted-role-to-assume - region: ${{ env.REGION }} - -############################################################### -# SERVERLESS DEPLOYMENT VARIABLES FROM SHARED ACCOUNT -############################################################## - - name: Serverless deployment variables created from shared account - run: | - cat >> .env <> $GITHUB_ENV - - env: - CUSTOM_PATH_IMAGE: /appv2/dev/images/ - CUSTOM_PATH_VIDEO: /appv2/dev/videos/ - CUSTOM_GRAPH_QL: https://core-graphql-api.${{ env.PUBLICZONENAME }} - CUSTOM_API_ENDPOINT: https://admin.${{ env.PUBLICZONENAME }}/ - CUSTOM_S3_BUCKET: files.${{ env.PUBLICZONENAME }} - CUSTOM_ENVIRONMENT: ${{ env.ENV }} - CUSTOM_CHAT_GRAPH_QL: https://chat-api.${{ env.PUBLICZONENAME }} - CUSTOM_GLOBAL_LOGIN_URL: https://app.login-stage.practera.com - CUSTOM_COUNTRY: AUS #TODO CHECK - CUSTOMPLAIN_SKIPGLOBALLOGINFLAG: true - CUSTOM_PATH_ANY: /appv2/dev/any/ - CUSTOM_AWS_REGION: ${{ env.REGION }} - CUSTOM_JS_ENVIRONEMENT: dev #TODO CHECK - CUSTOM_LOGIN_API_URL: https://api.login-stage.practera.com - CUSTOM_NEWRELIC: true - CUSTOM_APPV3_URL: https://appv3.${{ env.PUBLICZONENAME }} - CUSTOM_SWITCH_APP3: true - - -############################################################### -# BUILD WEB PACKAGES -############################################################## - - name: Build Web Packages - run: | - test -f src/environments/environment.ts && echo "environment here" || cp src/environments/environment.local.ts src/environments/environment.ts - node_modules/.bin/ng build --configuration=${{ env.BUILD_CONFIG }} - npm run generate-version - - -########################################################## -# AWS S3 SYNC - SERVERLESS TEMPLATES -########################################################## - - name: AWS S3 Sync operation - run: | - - aws s3 cp serverless.yml s3://$CFNS3BucketName/$STACK_NAME/$REGION/$ROOTSTACK/sls-templates/serverless.yml - - -########################################################## -# CLOUDFORMATION EXPORT VARIABLES -########################################################## - - name: Cloudformation Export variables - run: | - cat >> .env <> $GITHUB_ENV - -# ################################################ -# # DEVOPS-DEPLOYMENT REPORT -# ################################################ - - name: DevOps Deployment Reporting - if: always() - run: | - pip install --upgrade pip - pip install --upgrade csvtotable - export REASON=$(git log -2 --format=%s | sed -n 2p) - export REQUESTOR=${{ github.actor }} - - aws s3 cp s3://$STATUSREPORTS3Bucket/deploy-reporting.sh deploy-reporting.sh - chmod +x deploy-reporting.sh && ./deploy-reporting.sh - echo "LINK="${GITHUB_REPOSITORY##*/}.html >> $GITHUB_ENV - echo $REASON - echo $REQUESTOR diff --git a/.github/workflows/p2-stage.yml b/.github/workflows/p2-stage.yml deleted file mode 100644 index d7fdd0a076..0000000000 --- a/.github/workflows/p2-stage.yml +++ /dev/null @@ -1,346 +0,0 @@ -################################################ -# GITHUB ACTION WORKFLOW NAME -################################################ -name: Deploy to p2-stage environment - - -################################################ -# GITHUB ACTION EVENT TRIGGER -################################################ -on: - workflow_dispatch: - push: - branches: [ 'trunk-legacy' ] - - -################################################ -# GITHUB ACTION JOBS -################################################ -jobs: - deploy-p2-stage: - name: deploy-p2-stage - runs-on: ubuntu-latest - environment: p2-stage - permissions: write-all - timeout-minutes: 15 - - -################################################ -# GITHUB ACTIONS GLOBAL ENV VARIABLES -################################################ - env: - REGION : ap-southeast-2 - ENV : test # Valid values are dev,test,live only - STACK_NAME: p2-stage # Valid values are au,us,uk,p2,lf,nu,p1-sandbox,p1-stage,p2-sandbox,shared only - ROOTSTACK: app-v2 - CFNS3BucketName: devops-cfn-templates - PRIVATES3BucketName: devops-shared-private - PUBLICZONENAME: p2-stage.practera.com - APPPUBLICZONENAME: p2-stage.practera.app - BUILD_CONFIG: custom - STATUSREPORTS3Bucket: deployment-status.practera.com - STATUS: DEPLOYED - REQUESTOR: ${{ github.event.inputs.REQUESTOR }} - REASON: ${{ github.event.inputs.REASON }} - ENDPOINT: app-old.p2-stage.practera.com - BRANCH_TAG_NAME: trunk-legacy - AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} - -################################################ -# GITHUB REPO CHECKOUT -################################################ - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - - - -################################################ -# NODE ENV -################################################ - - name: Setup Node.js environment - uses: actions/setup-node@v4 - with: - node-version: 20.20.2 - - -################################################ -# NODE MODULES CACHE -################################################ - - name: Cache node modules - uses: actions/cache@v4 - id: cache-node-modules - env: - cache-name: cache - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: | - ~/.npm - node_modules - */*/node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - -################################################ -# NODE MODULES INSTALL -################################################ - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: npm ci --ignore-scripts - -################################################ -# GET P2 STAGE AWS ORGANIZATION NUMBER -################################################ - - name: Get AWS Organization Number - id: AWS_ORG - run: | - CENTRALIZED=$(echo $AWS_ACCOUNT_ID | jq -r .CENTRALIZED) - P2STAGE=$(echo $AWS_ACCOUNT_ID | jq -r .P2STAGE) - - echo "::add-mask::$CENTRALIZED" - echo "::add-mask::$P2STAGE" - - echo "CENTRALIZED=$CENTRALIZED" >> $GITHUB_OUTPUT - echo "P2STAGE=$P2STAGE" >> $GITHUB_OUTPUT - -################################################ -# AWS CLI CONFIGURATION - CENTRALIZED ACCOUNT -################################################ - - name: Configure AWS Credentials from CENTRALIZED Account - uses: ./.github/actions/aws-oidc - with: - role-to-assume: arn:aws:iam::${{ steps.AWS_ORG.outputs.CENTRALIZED }}:role/github-restricted-role-to-assume - region: ${{ env.REGION }} - -############################################################### -# SERVERLESS DEPLOYMENT VARIABLES FROM SHARED ACCOUNT -############################################################## - - name: Serverless deployment variables created from shared account - run: | - cat >> .env <> $GITHUB_ENV - - env: - CUSTOM_PATH_IMAGE: /appv2/test/images/ - CUSTOM_PATH_VIDEO: /appv2/test/videos/ - CUSTOM_GRAPH_QL: https://core-graphql-api.${{ env.PUBLICZONENAME }} - CUSTOM_API_ENDPOINT: https://admin.${{ env.PUBLICZONENAME }}/ - CUSTOM_S3_BUCKET: files.${{ env.PUBLICZONENAME }} - CUSTOM_ENVIRONMENT: ${{ env.ENV }} - CUSTOM_CHAT_GRAPH_QL: https://chat-api.${{ env.PUBLICZONENAME }} - CUSTOM_GLOBAL_LOGIN_URL: https://app.login-stage.practera.com - CUSTOM_COUNTRY: AUS #TODO CHECK - CUSTOMPLAIN_SKIPGLOBALLOGINFLAG: false - CUSTOM_PATH_ANY: /appv2/test/any/ - CUSTOM_AWS_REGION: ${{ env.REGION }} - CUSTOM_JS_ENVIRONEMENT: dev #TODO CHECK - CUSTOM_LOGIN_API_URL: https://api.login-stage.practera.com - CUSTOM_NEWRELIC: false - CUSTOM_APPV3_URL: https://appv3.${{ env.PUBLICZONENAME }} - CUSTOM_SWITCH_APP3: true - - -# ################################################ -# # PERFORM LINT TEST -# ################################################ - - name: Run lint test if present - run: | - npm run lint --if-present - - -############################################################### -# BUILD WEB PACKAGES -############################################################## - - name: Build Web Packages - run: | - test -f src/environments/environment.ts && echo "environment here" || cp src/environments/environment.local.ts src/environments/environment.ts - node_modules/.bin/ng build --configuration=${{ env.BUILD_CONFIG }} - npm run generate-version - - -# # ############################################################### -# # # PERFORM UNIT TEST -# # ############################################################## -# - name: Performing Unit test -# run: | -# node_modules/.bin/ng test --karmaConfig=src/karma.conf.sonarci.js --no-watch - - -# # ############################################################### -# # # SONARCLOUD SCANNER -# # ############################################################## -# - name: Performing Sonarcloud Scanner -# uses: SonarSource/sonarcloud-github-action@master -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - - -########################################################## -# AWS S3 SYNC - SERVERLESS TEMPLATES -########################################################## - - name: AWS S3 Sync operation - run: | - - aws s3 cp serverless.yml s3://$CFNS3BucketName/$STACK_NAME/$REGION/$ROOTSTACK/sls-templates/serverless.yml - - -########################################################## -# CLOUDFORMATION EXPORT VARIABLES -########################################################## - - name: Cloudformation Export variables - run: | - cat >> .env <> $GITHUB_ENV - -# ################################################ -# # DEVOPS-DEPLOYMENT REPORT -# ################################################ - - name: DevOps Deployment Reporting - if: always() - run: | - pip install --upgrade pip - pip install --upgrade csvtotable - export REASON=$(git log -2 --format=%s | sed -n 2p) - export REQUESTOR=${{ github.actor }} - - aws s3 cp s3://$STATUSREPORTS3Bucket/deploy-reporting.sh deploy-reporting.sh - chmod +x deploy-reporting.sh && ./deploy-reporting.sh - echo "LINK="${GITHUB_REPOSITORY##*/}.html >> $GITHUB_ENV - echo $REASON - echo $REQUESTOR - - diff --git a/.github/workflows/p2-usa.yml b/.github/workflows/p2-usa.yml deleted file mode 100644 index defe8c6ce3..0000000000 --- a/.github/workflows/p2-usa.yml +++ /dev/null @@ -1,322 +0,0 @@ -################################################ -# GITHUB ACTION WORKFLOW NAME -################################################ -name: Deploy to p2-usa live environment - - -################################################ -# GITHUB ACTION EVENT TRIGGER -################################################ -on: - workflow_dispatch: - inputs: - BRANCH_TAG_NAME: - description: 'New tag version based on create-release-tag workflow' - required: true - default: '' - - -################################################ -# GITHUB ACTION JOBS -################################################ -jobs: - deploy-p2-usa-live: - name: deploy-p2-usa-live - runs-on: ubuntu-latest - environment: p2-usa - permissions: write-all - timeout-minutes: 15 - - -################################################ -# GITHUB ACTIONS GLOBAL ENV VARIABLES -################################################ - env: - REGION : us-east-2 - ENV : live # Valid values are dev,test,live only - STACK_NAME: p2-usa # Valid values are au,us,uk,p2,lf,nu,p1-sandbox,p1-stage,p2-sandbox,shared only - ROOTSTACK: app-v2 - CFNS3BucketName: devops-cfn-templates - PRIVATES3BucketName: devops-shared-private - PUBLICZONENAME: usa.practera.com - APPPUBLICZONENAME: usa.practera.app - BUILD_CONFIG: custom - STATUSREPORTS3Bucket: deployment-status.practera.com - STATUS: DEPLOYED - REQUESTOR: ${{ github.event.inputs.REQUESTOR }} - REASON: ${{ github.event.inputs.REASON }} - ENDPOINT: app-old.usa.practera.com - BRANCH_TAG_NAME: ${{ github.event.inputs.BRANCH_TAG_NAME }} - AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} - -################################################ -# GITHUB REPO CHECKOUT -################################################ - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - ref: ${{ github.event.inputs.BRANCH_TAG_NAME }} - - - -################################################ -# NODE ENV -################################################ - - name: Setup Node.js environment - uses: actions/setup-node@v4 - with: - node-version: 20.20.2 - - -################################################ -# NODE MODULES CACHE -################################################ - - name: Cache node modules - uses: actions/cache@v4 - id: cache-node-modules - env: - cache-name: cache - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: | - ~/.npm - node_modules - */*/node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - -################################################ -# NODE MODULES INSTALL -################################################ - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: npm ci --ignore-scripts - -################################################ -# GET P2 P2USA AWS ORGANIZATION NUMBER -################################################ - - name: Get AWS Organization Number - id: AWS_ORG - run: | - P2USA=$(echo $AWS_ACCOUNT_ID | jq -r .P2USA) - CENTRALIZED=$(echo $AWS_ACCOUNT_ID | jq -r .CENTRALIZED) - - echo "::add-mask::$P2USA" - echo "::add-mask::$CENTRALIZED" - - echo "P2USA=$P2USA" >> $GITHUB_OUTPUT - echo "CENTRALIZED=$CENTRALIZED" >> $GITHUB_OUTPUT - -################################################ -# AWS CLI CONFIGURATION - CENTRALIZED ACCOUNT -################################################ - - name: Configure AWS Credentials from P1 Centralized account - uses: ./.github/actions/aws-oidc - with: - role-to-assume: arn:aws:iam::${{ steps.AWS_ORG.outputs.CENTRALIZED }}:role/github-restricted-role-to-assume - region: ap-southeast-2 - -############################################################### -# SERVERLESS DEPLOYMENT VARIABLES FROM SHARED ACCOUNT -############################################################## - - name: Serverless deployment variables created from shared account - run: | - cat >> .env <> $GITHUB_ENV - - env: - CUSTOM_PATH_IMAGE: /appv2/live/images/ - CUSTOM_PATH_VIDEO: /appv2/live/videos/ - CUSTOM_GRAPH_QL: https://core-graphql-api.${{ env.PUBLICZONENAME }} - CUSTOM_API_ENDPOINT: https://${{ env.PUBLICZONENAME }}/ - CUSTOM_S3_BUCKET: files.${{ env.PUBLICZONENAME }} - CUSTOM_ENVIRONMENT: ${{ env.ENV }} - CUSTOM_CHAT_GRAPH_QL: https://chat-api.${{ env.PUBLICZONENAME }} - CUSTOM_GLOBAL_LOGIN_URL: https://login.practera.com - CUSTOM_COUNTRY: US #TODO CHECK - CUSTOMPLAIN_SKIPGLOBALLOGINFLAG: false - CUSTOM_PATH_ANY: /appv2/live/any/ - CUSTOM_AWS_REGION: ${{ env.REGION }} - CUSTOM_JS_ENVIRONEMENT: dev #TODO CHECK - CUSTOM_LOGIN_API_URL: https://login-api.practera.com - CUSTOM_NEWRELIC: false - CUSTOM_APPV3_URL: https://appv3.${{ env.PUBLICZONENAME }} - CUSTOM_SWITCH_APP3: true - - -############################################################### -# BUILD WEB PACKAGES -############################################################## - - name: Build Web Packages - run: | - test -f src/environments/environment.ts && echo "environment here" || cp src/environments/environment.local.ts src/environments/environment.ts - node_modules/.bin/ng build --configuration=${{ env.BUILD_CONFIG }} - npm run generate-version - - -########################################################## -# AWS S3 SYNC - SERVERLESS TEMPLATES -########################################################## - - name: AWS S3 Sync operation - run: | - - aws s3 cp serverless.yml s3://$CFNS3BucketName/$STACK_NAME/$REGION/$ROOTSTACK/sls-templates/serverless.yml - - -########################################################## -# CLOUDFORMATION EXPORT VARIABLES -########################################################## - - name: Cloudformation Export variables - run: | - cat >> .env <> $GITHUB_ENV - -# ################################################ -# # DEVOPS-DEPLOYMENT REPORT -# ################################################ - - name: DevOps Deployment Reporting - if: always() - run: | - pip install --upgrade pip - pip install --upgrade csvtotable - export REASON=$(git log -2 --format=%s | sed -n 2p) - export REQUESTOR=${{ github.actor }} - - aws s3 cp s3://$STATUSREPORTS3Bucket/deploy-reporting.sh deploy-reporting.sh - chmod +x deploy-reporting.sh && ./deploy-reporting.sh - echo "LINK="${GITHUB_REPOSITORY##*/}.html >> $GITHUB_ENV - echo $REASON - echo $REQUESTOR - diff --git a/.github/workflows/pull-req.yml b/.github/workflows/pull-req.yml deleted file mode 100644 index 158712e1e4..0000000000 --- a/.github/workflows/pull-req.yml +++ /dev/null @@ -1,202 +0,0 @@ -################################################ -# GITHUB ACTION WORKFLOW NAME -################################################ -name: Pull Request Event Check - - -################################################ -# GITHUB ACTION EVENT TRIGGER -################################################ -on: - workflow_dispatch: - pull_request: - branches: - - 'trunk' - - 'release/**' - - 'stable' - types: [opened, synchronize, reopened] - - -################################################ -# GITHUB ACTION JOBS -################################################ -jobs: - pull-req-check: - name: pull-req-check - runs-on: ubuntu-latest - environment: pull-req - timeout-minutes: 15 - -################################################ -# GITHUB ACTIONS GLOBAL ENV VARIABLES -################################################ - env: - REGION : NA - ENV : NA # Valid values are dev,test,live only - STACK_NAME: pull-req # Valid values are au,us,uk,p2,lf,nu,p1-sandbox,p2-stage,p2-sandbox,shared only - ROOTSTACK: app-v2 - LOG_LEVEL: DEBUG # Valid values are DEBUG,INFO,WARN and ERROR only - SAMPLE_DEBUG_LOG_RATE: 0.01 # CAUTION with this value increase cost as well. - STATUSREPORTS3Bucket: deployment-status.practera.com - STATUS: SUBMITTED - REQUESTOR: ${{ github.event.inputs.REQUESTOR }} #TODO Submitter NAME here - REASON: ${{ github.event.inputs.REASON }} #TODO commit message here - ENDPOINT: NA - BRANCH_TAG_NAME: trunk - - -################################################ -# GITHUB REPO CHECKOUT -################################################ - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - - -################################################ -# NODE ENV -################################################ - - name: Setup Node.js environment - uses: actions/setup-node@v4 - with: - node-version: 20.20.2 - -################################################ -# NODE MODULES CACHE -################################################ - - name: Cache node modules - uses: actions/cache@v4 - id: cache-node-modules - env: - cache-name: cache - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: | - ~/.npm - node_modules - */*/node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - -################################################ -# NODE MODULES INSTALL -################################################ - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: npm ci --ignore-scripts - - - -################################################ -# AWS CLI CONFIGURATION - DEVOPS -################################################ - - name: Configure AWS credentials from $STACK_NAME account in $REGION region - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.DEVOPS_AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.DEVOPS_AWS_SECRET_ACCESS_KEY }} - aws-region: ap-southeast-2 - - - -# ################################################ -# # PERFORM LINT TEST -# ################################################ - - name: Run lint test if present - run: | - npm run lint --if-present - - -# ############################################################### -# # BUILD WEB PACKAGES -# ############################################################## -# - name: Build Web Packages -# run: | -# test -f src/environments/environment.ts && echo "environment here" || cp src/environments/environment.local.ts src/environments/environment.ts -# node_modules/.bin/ng build --configuration=${{ env.BUILD_CONFIG }} -# npm run generate-version - - -# # ############################################################### -# # # PERFORM UNIT TEST -# # ############################################################## -# - name: Performing Unit test -# run: | -# node_modules/.bin/ng test --karmaConfig=src/karma.conf.sonarci.js --no-watch - - -# # ############################################################### -# # # SONARCLOUD SCANNER -# # ############################################################## -# - name: Performing Sonarcloud Scanner -# uses: SonarSource/sonarcloud-github-action@master -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - - -# ########################################################## -# # SLACK NOTIFICATION -# ########################################################## - - name: Slack Notification - if: always() # Pick up events even if the job fails or is canceled. - uses: 8398a7/action-slack@v3 - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - MATRIX_CONTEXT: ${{ toJson(matrix) }} # required - with: - status: ${{ job.status }} - author_name: New pull request for ${{env.ROOTSTACK}} - mention: 'here' - if_mention: failure,cancelled - job_name: pull-req-check # Match the name above. - fields: repo,commit,eventName,ref,workflow,message,author,job,took - custom_payload: | - { - username: 'GitHub Action CI WorkFlow', - icon_emoji: ':github:', - attachments: [{ - color: '${{ job.status }}' === 'success' ? 'good' : ${{ job.status }}' === 'failure' ? 'danger' : 'warning', - text: - `${process.env.AS_REPO}\n - ${process.env.AS_COMMIT}\n - ${process.env.AS_EVENT_NAME}\n - @${process.env.AS_REF}\n - @${process.env.AS_WORKFLOW}\n - ${process.env.AS_MESSAGE}\n - ${process.env.AS_AUTHOR}\n - ${process.env.AS_JOB}\n - ${process.env.AS_TOOK}`, - }] - } - - -# ################################################ -# # STATUS VARIABLE UPDATE -# ################################################ - - name: Deployment status variable update - if: ${{ failure() }} - run: | - echo "STATUS=FAILURE" >> $GITHUB_ENV - -# ################################################ -# # DEVOPS-DEPLOYMENT REPORT -# ################################################ - - name: DevOps Deployment Reporting - if: always() - run: | - pip install --upgrade pip - pip install --upgrade csvtotable - export REASON=$(git log -2 --format=%s | sed -n 2p) - export REQUESTOR=${{ github.actor }} - - aws s3 cp s3://$STATUSREPORTS3Bucket/deploy-reporting.sh deploy-reporting.sh - chmod +x deploy-reporting.sh && ./deploy-reporting.sh - echo $REASON - echo $REQUESTOR