Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Included container to python pipeline #9

Merged
merged 3 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions .github/workflows/release-terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,4 @@ jobs:
release-message: "${{ github.event.inputs.release-message }}"
environment-name: k8s
runs-on: ghr-proxmox-vm-sthings-cicd
continue-error: false

VM-Creation-Terraform:
if: github.event.ref == 'refs/heads/main'
name: VM-Creation
needs: Release-Terraform
uses: stuttgart-things/stuttgart-things/.github/workflows/vm-creation-terraform.yaml@main
with:
module-name: proxmox-vm
environment-name: k8s
runs-on: ghr-proxmox-vm-sthings-cicd
continue-error: false
continue-error: false
30 changes: 18 additions & 12 deletions .github/workflows/vm-creation-terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ env:
jobs:

build-terraform-file:
runs-on: ghr-proxmox-vm-sthings-cicd
runs-on: ghr-proxmox-vm-sthings-cicd
steps:
- uses: actions/checkout@v4

- name: Checkout code
uses: actions/[email protected]
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
env:
AGENT_TOOLSDIRECTORY: /home/runner/_work/_tool

- name: Install dependencies
run: |
Expand All @@ -43,24 +45,23 @@ jobs:
with:
name: terraform_main
path: main.tf

- name: DEBUG
shell: bash
run: |
echo "/home/runner/_work/_tool/"
ls -la /home/runner/_work/_tool/

test-terraform-apply:
needs: build-terraform-file
runs-on: ghr-proxmox-vm-sthings-cicd
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/[email protected]

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.7.0"

- name: Install dependencies
run: |
python -m pip install github-action-utils python-terraform
Expand Down Expand Up @@ -90,13 +91,18 @@ jobs:
needs: test-terraform-apply
runs-on: ghr-proxmox-vm-sthings-cicd
steps:
- uses: actions/checkout@v4

- name: Checkout code
uses: actions/[email protected]

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.7.0"

- name: Install dependencies
run: |
python -m pip install github-action-utils python-terraform
Expand Down
2 changes: 1 addition & 1 deletion tests/terraform_apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def main():

# Initialize the Terraform working directory
global tf
tf = python_terraform.Terraform(working_dir='.', variables=tfvars) #, terraform_bin_path='/home/runner/k8s')
tf = python_terraform.Terraform(working_dir='.', variables=tfvars)
tf.init()

# Run terraform Apply and Terraform Destroy
Expand Down