Skip to content

Commit

Permalink
Update scenario-test.yml (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
prajin-op authored Mar 27, 2024
1 parent a2e980d commit a5da505
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/scenario-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Scenario Tests - DC missions

on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:

env:
Expand Down Expand Up @@ -48,6 +50,8 @@ jobs:
export BTP_PASSWORD=${{ secrets.BTP_PASSWORD }}
export CF_USER=${{ secrets.BTP_USERNAME }}
export CF_PASSWORD=${{ secrets.BTP_PASSWORD }}
timestamp=$(date +"%Y%m%d%H%M%S")
sed -i "s/\(subaccount_name\s*=\s*\"\)[^\"]*\"/\1dcmtest_${timestamp}\"/" released/discovery_center/mission_4327/setup_subaccount_cf/testsamples.tfvars
if [ "${{ matrix.usecase.use_custom_idp }}" = "true" ]
then
else.folder }} apply -var-file="${{ matrix.usecase.var_file }}" -var "btp_user=${BTP_USERNAME}" -var "btp_pass=${BTP_PASSWORD}" -auto-approve -no-color
Expand Down Expand Up @@ -110,6 +114,8 @@ jobs:
export BTP_PASSWORD=${{ secrets.BTP_PASSWORD }}
export CF_USER=${{ secrets.BTP_USERNAME }}
export CF_PASSWORD=${{ secrets.BTP_PASSWORD }}
timestamp=$(date +"%Y%m%d%H%M%S")
sed -i "s/\(subaccount_name\s*=\s*\"\)[^\"]*\"/\1dcmtest_${timestamp}\"/" released/discovery_center/mission_4327/setup_subaccount_cf/testsamples.tfvars
if [ "${{ matrix.usecase.use_custom_idp }}" = "true" ]
then
else.folder }} apply -var-file="${{ matrix.usecase.var_file }}" -var "btp_user=${BTP_USERNAME}" -var "btp_pass=${BTP_PASSWORD}" -auto-approve -no-color
Expand All @@ -131,3 +137,23 @@ jobs:
else
terraform -chdir=${{ matrix.usecase.folder }} destroy -var-file='${{ matrix.usecase.var_file }}' -auto-approve -no-color
fi
create_issue_on_failure:
runs-on: ubuntu-latest
needs: setup_infrastructure
if: ${{ always() && (needs.setup_infrastructure.result == 'failure') }}
steps:
- name: Create issue
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'Automated issue creation: Scenario-tests failure',
body: 'DC mission scenario-tests workflow is failed, Please find the details below'
\n**Workflow Name:** ${process.env.GITHUB_WORKFLOW}
\n**Run Number:** ${process.env.GITHUB_RUN_NUMBER}
\n**Trigger:** ${process.env.GITHUB_EVENT_NAME}
});
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ resource "btp_subaccount_entitlement" "hana-hdi-shared" {
subaccount_id = btp_subaccount.project.id
service_name = "hana"
plan_name = "hdi-shared"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Provider configuration
# ------------------------------------------------------------------------------------------------------
# Your global account subdomain
globalaccount = "sa0176014160"
globalaccount = "terraformintprod"
region = "eu10"
subaccount_name = "testgh"
subaccount_name = "dcmtest"
#------------------------------------------------------------------------------------------------------
# Entitlements plan update
#------------------------------------------------------------------------------------------------------
Expand All @@ -15,4 +15,4 @@ bas_plan_name = "standard-edition"
build_workzone_plan_name = "standard"
#--------------------------------------------------------------------------------------------------------
# For production use of HANA, upgrade the plan from the `free-tier` to the appropriate plan e.g hana
hana-cloud_plan_name = "hana"
hana-cloud_plan_name = "hana"

0 comments on commit a5da505

Please sign in to comment.