-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add OpenTofu example and update workflows
- Loading branch information
1 parent
2a7937c
commit 784b21c
Showing
13 changed files
with
90 additions
and
15 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
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,43 @@ | ||
name: Examples tofu tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
paths: | ||
- 'examples/**.tfvars' | ||
- 'examples/**.tf' | ||
- 'scripts/test-examples.sh' | ||
- 'GNUmakefile' | ||
schedule: | ||
- cron: '30 22 * * *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
Examples_tofu_tests: | ||
environment: test-eu-west-2 | ||
runs-on: [self-hosted, linux, eu-west-2] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
- uses: outscale/frieza-github-actions/frieza-clean@master | ||
with: | ||
access_key: ${{ secrets.OSC_ACCESS_KEY }} | ||
secret_key: ${{ secrets.OSC_SECRET_KEY }} | ||
region: ${{ secrets.OSC_REGION }} | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: 'stable' | ||
- name: Setup OpenTofu | ||
uses: opentofu/setup-opentofu@v1 | ||
with: | ||
tofu_wrapper: false | ||
- name: Run Examples | ||
run: make tofu-examples | ||
env: | ||
TF_VAR_access_key_id: ${{ secrets.OSC_ACCESS_KEY }} | ||
TF_VAR_secret_key_id: ${{ secrets.OSC_SECRET_KEY }} | ||
TF_VAR_region: ${{ secrets.OSC_REGION }} | ||
TF_VAR_image_id: ${{ secrets.OSC_OMI_EXEMPLE }} |
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
File renamed without changes.
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,28 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
project_dir=$(cd "$(dirname $0)" && pwd) | ||
project_root=$(cd $project_dir/.. && pwd) | ||
EXAMPLES_DIR=$project_root/examples | ||
|
||
go build -o terraform-provider-outscale | ||
|
||
for f in $EXAMPLES_DIR/* | ||
do | ||
if [ -d $f ] | ||
then | ||
cd $f | ||
VERSION_DIR=`grep -o '[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*' outscale.tf` | ||
INSTALL_DIR=$f/terraform.d/providers/registry.opentofu.org/outscale/outscale/$VERSION_DIR/linux_amd64/ | ||
echo $INSTALL_DIR | ||
mkdir -p $INSTALL_DIR | ||
cp ../../terraform-provider-outscale $INSTALL_DIR | ||
tofu init | ||
tofu apply -auto-approve | ||
tofu destroy -auto-approve | ||
cd - | ||
fi | ||
done | ||
|
||
exit 0 |