Skip to content

Commit

Permalink
BC-5468 update all ymls after review
Browse files Browse the repository at this point in the history
  • Loading branch information
UzaeirKhan committed Nov 24, 2023
1 parent af54c59 commit a76263f
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 15 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/automatic-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ jobs:
echo "tag=tag:stable:ci" >> $GITHUB_OUTPUT
echo "environment=dev" >> $GITHUB_OUTPUT
- name: Print output results
shell: bash
run: |
echo "cypress brb result: ${{steps.set_variables.outputs.cypress_brb}}"
echo "cypress dbc result: ${{steps.set_variables.outputs.cypress_dbc}}"
echo "cypress nbc result: ${{steps.set_variables.outputs.cypress_nbc}}"
echo "tag result: ${{steps.set_variables.outputs.tag}}"
echo "environment result: ${{steps.set_variables.outputs.environment}}"
configuring-loading-secrets-running-tests:
needs: e2e-system-tests
uses: ./.github/workflows/main.yml
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ on:
required: true
inputs:
cypress_brb:
description: "brb url from remote workflow"
description: "brb url from the workflow"
type: string
cypress_nbc:
description: "nbc url from remote workflow"
description: "nbc url from the workflow"
type: string
cypress_default:
description: "default url from remote workflow"
description: "default url from the workflow"
type: string
tag:
description: "tag for running cypress tests"
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/manual-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ on:
jobs:
e2e-system-tests:
runs-on: ubuntu-latest
outputs:
cypress_brb: ${{steps.set_variables.outputs.cypress_brb}}
cypress_dbc: ${{steps.set_variables.outputs.cypress_dbc}}
cypress_nbc: ${{steps.set_variables.outputs.cypress_nbc}}
tag: ${{steps.set_variables.outputs.tag}}
environment: ${{steps.set_variables.outputs.environment}}

steps:
- name: Setup Node
Expand All @@ -28,11 +34,34 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Set all parameters for next job
id: set_variables
shell: bash
run: |
echo "cypress_brb=${{inputs.instance1}}"
echo "cypress_nbc=${{inputs.instance2}}"
echo "cypress_dbc=${{inputs.instance3}}"
if [[ ! $cypress_brb =~ (staging|schulportal) && ! $cypress_dbc =~ (staging|schulportal) && ! $cypress_nbc =~ (staging|schulportal) ]]; then
environment="dev"
else
environment="ref"
fi
echo "tag=tag:stable:ci" >> $GITHUB_OUTPUT
echo "environment=$environment" >> $GITHUB_OUTPUT
configuring-loading-secrets-running-tests:
needs: e2e-system-tests
uses: ./.github/workflows/main.yml
secrets:
service-account-token: ${{ secrets.CYPRESS_ONEPWD_SERVICE_ACCOUNT_TOKEN }}
with:
cypress_brb: ${{needs.e2e-system-tests.outputs.cypress_brb}}
cypress_default: ${{needs.e2e-system-tests.outputs.cypress_dbc}}
cypress_nbc: ${{needs.e2e-system-tests.outputs.cypress_nbc}}
tag: ${{needs.e2e-system-tests.outputs.tag}}
environment: ${{needs.e2e-system-tests.outputs.environment}}

notify_RC:
runs-on: ubuntu-latest
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/remote-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
cypress_brb: ${{ steps.set_target.outputs.CYPRESS_BRB }}
cypress_nbc: ${{ steps.set_target.outputs.CYPRESS_NBC }}
cypress_default: ${{ steps.set_target.outputs.CYPRESS_DEFAULT }}
tag: ${{steps.set_target.outputs.tag}}
environment: ${{steps.set_target.outputs.environment}}

steps:
- name: Setup Node
Expand Down Expand Up @@ -69,6 +71,15 @@ jobs:
echo "CYPRESS_DEFAULT=https://default-${cleaned_branch_name}.cd.dbildungscloud.dev" >> $GITHUB_OUTPUT
echo "Set CYPRESS_DEFAULT=https://default-${cleaned_branch_name}.cd.dbildungscloud.dev"
if [[ ! $CYPRESS_BRB =~ (staging|schulportal) && ! $CYPRESS_DEFAULT =~ (staging|schulportal) && ! $CYPRESS_NBC =~ (staging|schulportal) ]]; then
environment="dev"
else
environment="ref"
fi
echo "tag=tag:stable:ci" >> $GITHUB_OUTPUT
echo "environment=$environment" >> $GITHUB_OUTPUT
- name: Check if all apps are running
shell: bash
run: |
Expand Down Expand Up @@ -105,3 +116,5 @@ jobs:
cypress_brb: ${{ needs.e2e-system-tests.outputs.cypress_brb }}
cypress_nbc: ${{ needs.e2e-system-tests.outputs.cypress_nbc }}
cypress_default: ${{ needs.e2e-system-tests.outputs.cypress_default }}
tag: ${{needs.e2e-system-tests.outputs.tag}}
environment: ${{needs.e2e-system-tests.outputs.environment}}
33 changes: 33 additions & 0 deletions .github/workflows/scheduled-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ on:
jobs:
e2e-system-tests:
runs-on: ubuntu-latest
outputs:
cypress_brb: ${{steps.set_variables.outputs.cypress_brb}}
cypress_dbc: ${{steps.set_variables.outputs.cypress_dbc}}
cypress_nbc: ${{steps.set_variables.outputs.cypress_nbc}}
tag: ${{steps.set_variables.outputs.tag}}
environment: ${{steps.set_variables.outputs.environment}}

steps:
- name: Setup Node
Expand All @@ -15,11 +21,38 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install 1Password CLI
uses: 1password/install-cli-action@v1

- name: Verify 1Password was Installed
run: op --version

- name: Configure 1Password Service Account
uses: 1password/load-secrets-action/configure@v1
with:
service-account-token: ${{ secrets.CYPRESS_ONEPWD_SERVICE_ACCOUNT_TOKEN }}

- name: Set all parameters for next job
id: set_variables
shell: bash
run: |
echo "cypress_brb=$(op document get cypress-json --vault cy-dev-brb | jq -r '.BRB')" >> $GITHUB_OUTPUT
echo "cypress_dbc=$(op document get cypress-json --vault cy-dev-dbc | jq -r '.DEFAULT')" >> $GITHUB_OUTPUT
echo "cypress_nbc=$(op document get cypress-json --vault cy-dev-nbc | jq -r '.NBC')" >> $GITHUB_OUTPUT
echo "tag=tag:stable:ci" >> $GITHUB_OUTPUT
echo "environment=dev" >> $GITHUB_OUTPUT
configuring-loading-secrets-running-tests:
needs: e2e-system-tests
uses: ./.github/workflows/main.yml
secrets:
service-account-token: ${{ secrets.CYPRESS_ONEPWD_SERVICE_ACCOUNT_TOKEN }}
with:
cypress_brb: ${{needs.e2e-system-tests.outputs.cypress_brb}}
cypress_default: ${{needs.e2e-system-tests.outputs.cypress_dbc}}
cypress_nbc: ${{needs.e2e-system-tests.outputs.cypress_nbc}}
tag: ${{needs.e2e-system-tests.outputs.tag}}
environment: ${{needs.e2e-system-tests.outputs.environment}}

notify_RC:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Install or make sure Chrome browser (at least) have it in your development machi
|---- logs(contains logs of the test run)
|---- node_modules
|---- scripts
| |____ aggregate-json-files.sh (Aggregate all json file into one json file in CI)
| |____ aggregate-json-files.sh (Aggregate all json files into one json file in CI)
|---- .editorconfig
|---- .gitattributes
|---- .gitignore
Expand Down
4 changes: 2 additions & 2 deletions scripts/aggregate-json-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ declare -A key_value_pairs
for instance in "${instances[@]}"; do
if [[ $workflow_name == *"manual"* || $workflow_name == *"remote"* ]]; then
file_path="$workspace_path/e2e-system-tests/env_variables/file-${environment}-${instance}.json"
else
file_path="$workspace_path/e2e-system-tests/env_variables/file-dev-${instance}.json"
# else
# file_path="$workspace_path/e2e-system-tests/env_variables/file-dev-${instance}.json"
fi

file_paths+=("$file_path")
Expand Down

0 comments on commit a76263f

Please sign in to comment.