Skip to content

Commit

Permalink
Merge pull request #9 from stuttgart-things/feature/issue-1/vmTest-pi…
Browse files Browse the repository at this point in the history
…peline

Included container to python pipeline
  • Loading branch information
anacalva authored Mar 21, 2024
2 parents c4f3c97 + d49401e commit 70c358c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 25 deletions.
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/checkout@v4.1.1
- 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/checkout@v4.1.1

- 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/checkout@v4.1.1

- 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

0 comments on commit 70c358c

Please sign in to comment.