6 - Check Egress Operation #5732
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: 6 - Check Egress Operation | |
| on: | |
| schedule: | |
| - cron: '40 02,14 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| egress-check: | |
| name: ${{matrix.app}} - ${{matrix.environ}} - ${{matrix.command}} | |
| runs-on: ubuntu-latest | |
| environment: ${{ matrix.environ }} | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 2 | |
| matrix: | |
| command: | |
| - 'HTTP403Test || curl -I -L --http1.1 http://gsa.gov | grep \"HTTP/1.1 403 Forbidden\"' | |
| - 'GoodDomain200Test || python -c \"import requests,sys; sys.exit(requests.get(''https://gsa.gov'').status_code!=200)\"' | |
| - 'BadDomain403Test || curl -I -L --http1.1 https://yahoo.com | grep \"HTTP/1.1 403 Forbidden\"' | |
| environ: ['development', 'staging', 'prod'] | |
| app: | |
| - 'catalog-admin' | |
| - 'catalog-web' | |
| - 'catalog-fetch' | |
| - 'catalog-gather' | |
| steps: | |
| - name: Store Instance Name | |
| run: | | |
| INSTANCE_NAME="$(echo egress-check-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT})" | |
| echo "INSTANCE_NAME=${INSTANCE_NAME}" | tee -a $GITHUB_ENV | |
| - name: checkout | |
| uses: actions/checkout@v5 | |
| - name: run task | |
| uses: cloud-gov/cg-cli-tools@main | |
| with: | |
| command: > | |
| cf run-task ${{ matrix.app }} --command "${{ matrix.command }}" | |
| --name $INSTANCE_NAME -k 1500M -m 150M | |
| cf_org: gsa-datagov | |
| cf_space: ${{ matrix.environ }} | |
| cf_username: ${{secrets.CF_SERVICE_USER}} | |
| cf_password: ${{secrets.CF_SERVICE_AUTH}} | |
| - name: monitor task output | |
| uses: cloud-gov/cg-cli-tools@main | |
| with: | |
| command: > | |
| tools/monitor_cf_logs.sh ${{ matrix.app }} $INSTANCE_NAME | |
| cf_org: gsa-datagov | |
| cf_space: ${{ matrix.environ }} | |
| cf_username: ${{secrets.CF_SERVICE_USER}} | |
| cf_password: ${{secrets.CF_SERVICE_AUTH}} | |
| - name: Create Issue for failure 😢 | |
| if: ${{ failure() }} | |
| uses: JasonEtco/create-an-issue@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }} | |
| GITHUB_JOB: ${{ toJson(github)['job'] }} | |
| GITHUB_ATTEMPTS: ${{ github.run_attempt }} | |
| LAST_COMMIT: ${{ github.sha }} | |
| LAST_RUN_BY: ${{ github.actor }} | |
| RUN_ID: ${{ github.run_id }} | |
| COMMAND: ${{ matrix.command }} | |
| APP_NAME: ${{ matrix.app }} | |
| ENVIRONMENT: ${{ matrix.environ }} | |
| with: | |
| filename: .github/egress_check_error.md | |
| update_existing: true |