|
8 | 8 | type: string
|
9 | 9 | default: >-
|
10 | 10 | [""]
|
| 11 | + k8s-environment: |
| 12 | + required: false |
| 13 | + description: Specifies which environmet to use for k8s testing. ["production", "staging"] |
| 14 | + type: string |
| 15 | + default: "production" |
| 16 | + k8s-manifests-branch: |
| 17 | + required: false |
| 18 | + description: "branch for k8s manifests to run the tests on" |
| 19 | + type: string |
| 20 | + default: "main" |
11 | 21 | secrets:
|
12 | 22 | GH_TOKEN_ADMIN:
|
13 | 23 | description: Github admin token
|
|
77 | 87 | execute-modinput-labeled: ${{ steps.configure-tests-on-labels.outputs.execute_modinput_functional_labeled }}
|
78 | 88 | execute-scripted_inputs-labeled: ${{ steps.configure-tests-on-labels.outputs.execute_scripted_inputs_labeled }}
|
79 | 89 | execute-requirement-labeled: ${{ steps.configure-tests-on-labels.outputs.execute_requirement_test_labeled }}
|
| 90 | + s3_bucket_k8s: ${{ steps.k8s-environment.outputs.s3_bucket }} |
| 91 | + argo_server_domain_k8s: ${{ steps.k8s-environment.outputs.argo_server_domain }} |
| 92 | + argo_token_secret_id_k8s: ${{ steps.k8s-environment.outputs.argo_token_secret_id }} |
80 | 93 | steps:
|
| 94 | + - name: set k8s environment |
| 95 | + id: k8s-environment |
| 96 | + run: | |
| 97 | + if [[ ${{ inputs.k8s-environment }} == 'staging' ]]; then |
| 98 | + echo "setting up argo variables for staging" |
| 99 | + { |
| 100 | + echo "s3_bucket=ta-staging-artifacts" |
| 101 | + echo "argo_server_domain=argo.staging.wfe.splgdi.com" |
| 102 | + echo "argo_token_secret_id=ta-staging-github-workflow-automation-token" |
| 103 | + } >> "$GITHUB_OUTPUT" |
| 104 | + else |
| 105 | + echo "setting up argo variables for production" |
| 106 | + { |
| 107 | + echo "s3_bucket=ta-production-artifacts" |
| 108 | + echo "argo_server_domain=argo.wfe.splgdi.com" |
| 109 | + echo "argo_token_secret_id=ta-github-workflow-automation-token" |
| 110 | + } >> "$GITHUB_OUTPUT" |
| 111 | + fi |
81 | 112 | - name: skip workflow if description is empty for labeled pr
|
82 | 113 | id: skip-workflow
|
83 | 114 | env:
|
@@ -678,7 +709,7 @@ jobs:
|
678 | 709 | run: |
|
679 | 710 | echo "name=$(basename "${{ steps.slim.outputs.OUTPUT }}")" >> "$GITHUB_OUTPUT"
|
680 | 711 | basename "${{ steps.slim.outputs.OUTPUT }}"
|
681 |
| - aws s3 cp "${{ steps.slim.outputs.OUTPUT }}" s3://ta-production-artifacts/ta-apps/ |
| 712 | + aws s3 cp "${{ steps.slim.outputs.OUTPUT }}" "s3://${{ needs.setup-workflow.outputs.s3_bucket_k8s }}/ta-apps/" |
682 | 713 |
|
683 | 714 | build-3_9:
|
684 | 715 | runs-on: ubuntu-latest
|
@@ -894,6 +925,7 @@ jobs:
|
894 | 925 |
|
895 | 926 | setup:
|
896 | 927 | needs:
|
| 928 | + - setup-workflow |
897 | 929 | - build
|
898 | 930 | - test-inventory
|
899 | 931 | if: ${{ !cancelled() && needs.build.result == 'success' }}
|
@@ -938,23 +970,23 @@ jobs:
|
938 | 970 | JOB_NAME=$(echo "$ADDON_NAME" | tail -c 16)-$(echo "${GITHUB_SHA}" | tail -c 8)-TEST-TYPE-${GITHUB_RUN_ID}
|
939 | 971 | JOB_NAME=${JOB_NAME//[_.]/-}
|
940 | 972 | LABELS="addon-name=${ADDON_NAME}"
|
941 |
| - ADDON_UPLOAD_PATH="s3://ta-production-artifacts/ta-apps/${{ needs.build.outputs.buildname }}" |
| 973 | + ADDON_UPLOAD_PATH="s3://${{ needs.setup-workflow.outputs.s3_bucket_k8s }}/ta-apps/${{ needs.build.outputs.buildname }}" |
942 | 974 | {
|
943 |
| - echo "argo-server=argo.wfe.splgdi.com:443" |
| 975 | + echo "argo-server=${{ needs.setup-workflow.outputs.argo_server_domain_k8s }}:443" |
944 | 976 | echo "argo-http1=true"
|
945 | 977 | echo "argo-secure=true"
|
946 | 978 | echo "argo-base-href=\'\'"
|
947 | 979 | echo "argo-namespace=workflows"
|
948 | 980 | echo "argo-workflow-tmpl-name=ta-workflow"
|
949 | 981 | echo "argo-cancel-workflow-tmpl-name=cancel-workflow"
|
950 | 982 | echo "directory-path=/tmp"
|
951 |
| - echo "s3-bucket=ta-production-artifacts" |
| 983 | + echo "s3-bucket=${{ needs.setup-workflow.outputs.s3_bucket_k8s }}" |
952 | 984 | echo "addon-name=\"$ADDON_NAME\""
|
953 | 985 | echo "job-name=wf-$JOB_NAME"
|
954 | 986 | echo "labels=$LABELS"
|
955 | 987 | echo "addon-upload-path=$ADDON_UPLOAD_PATH"
|
956 | 988 | echo "spl-host-suffix=wfe.splgdi.com"
|
957 |
| - echo "k8s-manifests-branch=main" |
| 989 | + echo "k8s-manifests-branch=${{ inputs.k8s-manifests-branch }}" |
958 | 990 | } >> "$GITHUB_OUTPUT"
|
959 | 991 | - uses: actions/download-artifact@v3
|
960 | 992 | if: ${{ needs.test-inventory.outputs.ucc_modinput_functional == 'true' && needs.test-inventory.outputs.modinput_functional == 'true'}}
|
@@ -988,7 +1020,7 @@ jobs:
|
988 | 1020 | AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
989 | 1021 | run: |
|
990 | 1022 | swagger_name=swagger_$(basename "$BUILD_NAME" .spl)
|
991 |
| - aws s3 sync "${{ steps.download-openapi.outputs.download-path }}/tmp/restapi_client/" "s3://ta-production-artifacts/ta-apps/$swagger_name/" --exclude "*" --include "README.md" --include "*swagger_client*" --only-show-errors |
| 1023 | + aws s3 sync "${{ steps.download-openapi.outputs.download-path }}/tmp/restapi_client/" "s3://${{ needs.setup-workflow.outputs.s3_bucket_k8s }}/ta-apps/$swagger_name/" --exclude "*" --include "README.md" --include "*swagger_client*" --only-show-errors |
992 | 1024 |
|
993 | 1025 | run-knowledge-tests:
|
994 | 1026 | if: ${{ !cancelled() && needs.build.result == 'success' && needs.test-inventory.outputs.knowledge == 'true' && (needs.setup-workflow.outputs.execute-ko == 'Yes' || needs.setup-workflow.outputs.execute-knowledge-labeled == 'true') }}
|
@@ -1045,7 +1077,7 @@ jobs:
|
1045 | 1077 | - name: Read secrets from AWS Secrets Manager into environment variables
|
1046 | 1078 | id: get-argo-token
|
1047 | 1079 | run: |
|
1048 |
| - ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id ta-github-workflow-automation-token | jq -r '.SecretString') |
| 1080 | + ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id "${{ needs.setup-workflow.outputs.argo_token_secret_id_k8s }}" | jq -r '.SecretString') |
1049 | 1081 | echo "argo-token=$ARGO_TOKEN" >> "$GITHUB_OUTPUT"
|
1050 | 1082 | - name: create job name
|
1051 | 1083 | id: create-job-name
|
@@ -1092,7 +1124,7 @@ jobs:
|
1092 | 1124 | id: update-argo-token
|
1093 | 1125 | if: ${{ !cancelled() }}
|
1094 | 1126 | run: |
|
1095 |
| - ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id ta-github-workflow-automation-token | jq -r '.SecretString') |
| 1127 | + ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id "${{ needs.setup-workflow.outputs.argo_token_secret_id_k8s }}" | jq -r '.SecretString') |
1096 | 1128 | echo "argo-token=$ARGO_TOKEN" >> "$GITHUB_OUTPUT"
|
1097 | 1129 | - name: calculate timeout
|
1098 | 1130 | id: calculate-timeout
|
@@ -1286,7 +1318,7 @@ jobs:
|
1286 | 1318 | - name: Read secrets from AWS Secrets Manager into environment variables
|
1287 | 1319 | id: get-argo-token
|
1288 | 1320 | run: |
|
1289 |
| - ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id ta-github-workflow-automation-token | jq -r '.SecretString') |
| 1321 | + ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id "${{ needs.setup-workflow.outputs.argo_token_secret_id_k8s }}" | jq -r '.SecretString') |
1290 | 1322 | echo "argo-token=$ARGO_TOKEN" >> "$GITHUB_OUTPUT"
|
1291 | 1323 | - name: create job name
|
1292 | 1324 | id: create-job-name
|
@@ -1508,7 +1540,7 @@ jobs:
|
1508 | 1540 | - name: Read secrets from AWS Secrets Manager into environment variables
|
1509 | 1541 | id: get-argo-token
|
1510 | 1542 | run: |
|
1511 |
| - ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id ta-github-workflow-automation-token | jq -r '.SecretString') |
| 1543 | + ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id "${{ needs.setup-workflow.outputs.argo_token_secret_id_k8s }}" | jq -r '.SecretString') |
1512 | 1544 | echo "argo-token=$ARGO_TOKEN" >> "$GITHUB_OUTPUT"
|
1513 | 1545 | - name: create job name
|
1514 | 1546 | id: create-job-name
|
@@ -1555,7 +1587,7 @@ jobs:
|
1555 | 1587 | id: update-argo-token
|
1556 | 1588 | if: ${{ !cancelled() }}
|
1557 | 1589 | run: |
|
1558 |
| - ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id ta-github-workflow-automation-token | jq -r '.SecretString') |
| 1590 | + ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id "${{ needs.setup-workflow.outputs.argo_token_secret_id_k8s }}" | jq -r '.SecretString') |
1559 | 1591 | echo "argo-token=$ARGO_TOKEN" >> "$GITHUB_OUTPUT"
|
1560 | 1592 | - name: calculate timeout
|
1561 | 1593 | id: calculate-timeout
|
@@ -1737,7 +1769,7 @@ jobs:
|
1737 | 1769 | - name: Read secrets from AWS Secrets Manager into environment variables
|
1738 | 1770 | id: get-argo-token
|
1739 | 1771 | run: |
|
1740 |
| - ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id ta-github-workflow-automation-token | jq -r '.SecretString') |
| 1772 | + ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id "${{ needs.setup-workflow.outputs.argo_token_secret_id_k8s }}" | jq -r '.SecretString') |
1741 | 1773 | echo "argo-token=$ARGO_TOKEN" >> "$GITHUB_OUTPUT"
|
1742 | 1774 | - name: create job name
|
1743 | 1775 | id: create-job-name
|
@@ -1796,7 +1828,7 @@ jobs:
|
1796 | 1828 | id: update-argo-token
|
1797 | 1829 | if: ${{ !cancelled() }}
|
1798 | 1830 | run: |
|
1799 |
| - ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id ta-github-workflow-automation-token | jq -r '.SecretString') |
| 1831 | + ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id "${{ needs.setup-workflow.outputs.argo_token_secret_id_k8s }}" | jq -r '.SecretString') |
1800 | 1832 | echo "argo-token=$ARGO_TOKEN" >> "$GITHUB_OUTPUT"
|
1801 | 1833 | - name: calculate timeout
|
1802 | 1834 | id: calculate-timeout
|
@@ -1975,7 +2007,7 @@ jobs:
|
1975 | 2007 | - name: Read secrets from AWS Secrets Manager into environment variables
|
1976 | 2008 | id: get-argo-token
|
1977 | 2009 | run: |
|
1978 |
| - ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id ta-github-workflow-automation-token | jq -r '.SecretString') |
| 2010 | + ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id "${{ needs.setup-workflow.outputs.argo_token_secret_id_k8s }}" | jq -r '.SecretString') |
1979 | 2011 | echo "argo-token=$ARGO_TOKEN" >> "$GITHUB_OUTPUT"
|
1980 | 2012 | - name: create job name
|
1981 | 2013 | id: create-job-name
|
@@ -2204,7 +2236,7 @@ jobs:
|
2204 | 2236 | - name: Read secrets from AWS Secrets Manager into environment variables
|
2205 | 2237 | id: get-argo-token
|
2206 | 2238 | run: |
|
2207 |
| - ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id ta-github-workflow-automation-token | jq -r '.SecretString') |
| 2239 | + ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id "${{ needs.setup-workflow.outputs.argo_token_secret_id_k8s }}" | jq -r '.SecretString') |
2208 | 2240 | echo "argo-token=$ARGO_TOKEN" >> "$GITHUB_OUTPUT"
|
2209 | 2241 | - name: create job name
|
2210 | 2242 | id: create-job-name
|
@@ -2440,7 +2472,7 @@ jobs:
|
2440 | 2472 | - name: Read secrets from AWS Secrets Manager into environment variables
|
2441 | 2473 | id: get-argo-token
|
2442 | 2474 | run: |
|
2443 |
| - ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id ta-github-workflow-automation-token | jq -r '.SecretString') |
| 2475 | + ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id "${{ needs.setup-workflow.outputs.argo_token_secret_id_k8s }}" | jq -r '.SecretString') |
2444 | 2476 | echo "argo-token=$ARGO_TOKEN" >> "$GITHUB_OUTPUT"
|
2445 | 2477 | - name: create job name
|
2446 | 2478 | id: create-job-name
|
|
0 commit comments