Skip to content

Commit

Permalink
Merge branch 'dev' into segev_dra_4.13
Browse files Browse the repository at this point in the history
  • Loading branch information
elsegev committed Oct 23, 2023
2 parents 2686346 + 5a82f32 commit d2d0d53
Show file tree
Hide file tree
Showing 5 changed files with 404 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,30 @@ jobs:
fail-fast: false
matrix:
include:
- name: Sonar Basic
- name: Azure - POC - DSF
example: ./examples/azure/dsf_deployment
terraformvars: |
resource_group_location = "East US"
tarball_location = {
az_resource_group = "dummy-resource-group"
az_storage_account = "dummy-torage-account"
az_container = "dummy-container"
az_blob = "dummy-blob"
}
- name: AWS - POC - DSF
example: ./examples/poc/dsf_deployment
terraformvars: |
dam_license="license.mprv"
- name: AWS - POC - Sonar Basic
example: ./examples/poc/sonar_basic_deployment
- name: Sonar HADR
- name: AWS - POC - Sonar HADR
example: ./examples/poc/sonar_hadr_deployment
- name: Sonar Single Account
- name: AWS - Installation - Sonar Single Account
example: ./examples/installation/sonar_single_account_deployment
- name: Sonar Multi Account
- name: AWS - Installation - Sonar Multi Account
example: ./examples/installation/sonar_multi_account_deployment
- name: AWS - Installation - DSF Single Account
example: ./examples/installation/dsf_single_account_deployment

name: '${{ matrix.name }}'
env:
Expand All @@ -65,7 +81,11 @@ jobs:
AWS_REGION: us-west-2
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

ARM_SUBSCRIPTION_ID: ${{ vars.ARM_SUBSCRIPTION_ID }}
ARM_CLIENT_ID: ${{ vars.ARM_CLIENT_ID }}
ARM_TENANT_ID: ${{ vars.ARM_TENANT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}

steps:
- name: Pick ref
run: |
Expand All @@ -83,14 +103,20 @@ jobs:
- name: Change the modules source to local
if: ${{ inputs.use_modules_from_terraform_registry == false }}
run: |
find ./examples/ -type f -exec sed -i -f sed.expr {} \;
find ${{ matrix.example }} -type f -exec sed -i -f sed.expr {} \;
# Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: ~1.6.0

- name: Create License File
env:
MY_SECRET: ${{ secrets.DAM_LICENSE }}
run: |
echo "${{ secrets.DAM_LICENSE }}" | base64 -d > ${{ matrix.example }}/license.mprv
- name: Configure AWS credentials - innodev
if: contains(matrix.name, 'single account') || contains(matrix.name, 'multi account')
run: |
Expand All @@ -108,23 +134,34 @@ jobs:
run: |
aws sts get-caller-identity
- name: Create tfvars File
if: contains(matrix.name, 'Single Account') || contains(matrix.name, 'Multi Account')
- name: Create tfvars file (1)
if: matrix.terraformvars
run: |
echo '${{ matrix.terraformvars }}' >> "${{ matrix.example }}/terraform.tfvars"
- name: Create tfvars File (2)
if: matrix.name == 'AWS - Installation - Sonar Single Account'
run: |
if [ "${{ matrix.name }}" == "Sonar Single Account" ]; then
cat << EOF > "${{ matrix.example }}/terraform.tfvars"
${{ vars.TFVAR_PARAMETERS_SINGLE_ACCOUNT_AUTOMATION_V1 }}
cat << EOF > "${{ matrix.example }}/terraform.tfvars"
${{ vars.TFVAR_PARAMETERS_SINGLE_ACCOUNT_AUTOMATION_V1 }}
EOF
elif [ "${{ matrix.name }}" == "Sonar Multi Account" ]; then
cat << EOF > "${{ matrix.example }}/terraform.tfvars"
${{ vars.TFVAR_PARAMETERS_MULTI_ACCOUNT_AUTOMATION_V1 }}
- name: Create tfvars File (3)
if: matrix.name == 'AWS - Installation - Sonar Multi Account'
run: |
cat << EOF > "${{ matrix.example }}/terraform.tfvars"
${{ vars.TFVAR_PARAMETERS_MULTI_ACCOUNT_AUTOMATION_V1 }}
EOF
fi
- name: Create tfvars File (4)
if: matrix.name == 'AWS - Installation - DSF Single Account'
run: |
cat << EOF > "${{ matrix.example }}/terraform.tfvars"
${{ vars.TFVAR_PARAMETERS_DSF_SINGLE_ACCOUNT_AUTOMATION_PRIVATE_SUBNETS_V1 }}
EOF
- name: View The Vars
if: contains(matrix.name, 'single account') || contains(matrix.name, 'multi account')
run: cat ${{ matrix.example }}/terraform.tfvars
run: cat ${{ matrix.example }}/terraform.tfvars || true

# Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc.
- name: Terraform Init
Expand Down
Loading

0 comments on commit d2d0d53

Please sign in to comment.