-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into PR_main_tempalte
# Conflicts: # terracumber_config/tf_files/Uyuni-PR-tests-env1.tf # terracumber_config/tf_files/Uyuni-PR-tests-env10.tf # terracumber_config/tf_files/Uyuni-PR-tests-env2.tf # terracumber_config/tf_files/Uyuni-PR-tests-env3.tf # terracumber_config/tf_files/Uyuni-PR-tests-env4.tf # terracumber_config/tf_files/Uyuni-PR-tests-env5.tf # terracumber_config/tf_files/Uyuni-PR-tests-env6.tf # terracumber_config/tf_files/Uyuni-PR-tests-env7.tf # terracumber_config/tf_files/Uyuni-PR-tests-env8.tf # terracumber_config/tf_files/Uyuni-PR-tests-env9.tf
- Loading branch information
Showing
40 changed files
with
371 additions
and
131 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Sumaform validation | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'terracumber_config/tf_files/**' | ||
|
||
jobs: | ||
validate_sumaform: | ||
name: Validate sumaform files | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: tf_files | ||
name: Get modified .tf files | ||
uses: Ana06/[email protected] | ||
with: | ||
filter: '*.tf' | ||
- name: Install terraform | ||
if: steps.tf_files.outputs.added_modified | ||
uses: hashicorp/setup-terraform@v2 | ||
with: | ||
terraform_version: 1.0.10 | ||
- name: Checkout sumaform | ||
if: steps.tf_files.outputs.added_modified | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: uyuni-project/sumaform | ||
path: sumaform | ||
- name: Validate files | ||
if: steps.tf_files.outputs.added_modified | ||
run: | | ||
# Remove providers to use the 'null' provider | ||
sed -i '/provider *"/,/\}/d' ${{steps.tf_files.outputs.added_modified}} | ||
# Remove libvirt provider dependency | ||
sed -i '/libvirt = {/,/\}/d' ${{steps.tf_files.outputs.added_modified}} | ||
# Setup sumaform with the 'null' backend | ||
cd sumaform | ||
ln -sfn ../backend_modules/null modules/backend | ||
# Set TF variables | ||
export TF_VAR_SCC_USER="user" | ||
export TF_VAR_SCC_PASSWORD="password" | ||
for tf_file in ${{steps.tf_files.outputs.added_modified}}; do | ||
echo "::notice::Validating '`basename $tf_file`'..." | ||
cp ../$tf_file main.tf | ||
# Uncomment for Terraform detailed logging | ||
# export TF_LOG=trace | ||
terraform init -input=false | ||
terraform validate | ||
terraform plan -input=false | ||
echo | ||
done |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.