Skip to content

Commit

Permalink
Upgrade flow yml (#301)
Browse files Browse the repository at this point in the history
* add upgrade flow yml for unit tests and upgrade automation
  • Loading branch information
sivan-hajbi-imperva authored Nov 1, 2023
1 parent 784026b commit d9d3c31
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 40 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/sonar_upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,6 @@ on:
type: boolean
required: false

push:
branches:
- 'master'
- 'dev'
paths:
- 'modules/aws/sonar-upgrader/**'
- 'examples/sonar_upgrade/*'

pull_request:
types:
- 'opened'
- 'reopened'
branches:
- 'master'
- 'dev'
paths:
- 'modules/aws/sonar-upgrader/**'
- 'examples/sonar_upgrade/*'

env:
TF_CLI_ARGS: "-no-color"
TF_INPUT: 0
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/sonar_upgrade_flow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: 'Sonar Upgrade Flow'

on:
workflow_call:
secrets:
AWS_ACCESS_KEY_ID:
required: true
AWS_SECRET_ACCESS_KEY:
required: true
SLACK_WEBHOOK_URL:
required: true
DAM_LICENSE:
required: true
workflow_dispatch:

push:
branches:
- 'master'
- 'dev'
paths:
- 'modules/aws/sonar-upgrader/**'
- 'examples/sonar_upgrade/*'

pull_request:
types:
- 'opened'
- 'reopened'
branches:
- 'master'
- 'dev'
paths:
- 'modules/aws/sonar-upgrader/**'
- 'examples/sonar_upgrade/*'

permissions:
contents: read

jobs:
sonar_upgrade_unit_tests:
uses: ./.github/workflows/sonar_upgrade_unit_tests.yml
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

sonar_upgrade:
needs: sonar_upgrade_unit_tests
uses: ./.github/workflows/sonar_upgrade.yml
with:
use_modules_from_terraform_registry: false
explicit_ref: '' # current branch
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DAM_LICENSE: ${{ secrets.DAM_LICENSE }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
19 changes: 0 additions & 19 deletions .github/workflows/sonar_upgrade_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,6 @@ on:
required: true
workflow_dispatch:

push:
branches:
- 'master'
- 'dev'
paths:
- 'modules/aws/sonar-upgrader/**'
- 'examples/sonar_upgrade/*'

pull_request:
types:
- 'opened'
- 'reopened'
branches:
- 'master'
- 'dev'
paths:
- 'modules/aws/sonar-upgrader/**'
- 'examples/sonar_upgrade/*'

permissions:
contents: read

Expand Down
4 changes: 2 additions & 2 deletions modules/aws/sonar-upgrader/python_upgrader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ This utility is designed for upgrading DSF Hubs and Agentless Gateways.
To utilize the upgrade package, run the following command and replace [arguments] with the specific arguments required
for your environment configuration:

`python -u -m upgrade.main [arguments]`
`python3 -u -m upgrade.main [arguments]`

For a list of available arguments and their descriptions, use the following command:

`python -u -m upgrade.main -h`
`python3 -u -m upgrade.main -h`
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,4 @@ def test_flush(mocker, setup_for_each_test):
is_file_exist_mock.assert_called_once_with("upgrade_status.json")
read_file_contents_mock.assert_not_called()
assert update_file_safely_mock.call_count == 2

0 comments on commit d9d3c31

Please sign in to comment.