generated from deploymenttheory/Template
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (49 loc) · 1.85 KB
/
importer.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Import By Config File
on:
workflow_dispatch:
inputs:
config_out_fn:
type: string
default: "generated_config.tf"
environment:
type: choice
options:
- "importer-lbgsandbox"
- "importer-tfstaging"
default: "importer-tfstaging"
jobs:
importer:
name: "Import-Run"
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
container:
image: ghcr.io/${{ github.repository }}/python_tf:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JP_TENANT_NAME: ${{ vars.JP_TENANT_NAME }}
JP_CLIENT_ID: ${{ secrets.JP_CLIENT_ID }}
JP_CLIENT_SECRET: ${{ secrets.JP_CLIENT_SECRET }}
WORKING_DIR: ${{ vars.WORKING_DIR }}
TF_TOKEN_app_terraform_io: ${{ secrets.TF_API_KEY }}
steps:
- name: Checkout
uses: actions/[email protected]
- name: Run Import Utility
run: python scripts/import_via_config_file.py
- name: Terraform Generate Plan Config
run: |
cd importer_working_dir/
terraform init
terraform fmt
cat jamfpro_policy.tf
echo "---"
cat jamfpro_script.tf
terraform plan --generate-config-out="${{ inputs.config_out_fn }}"
- name: Commit back to Repo
run: |
git config --global user.email "[email protected]"
git config --global user.name "Github Action"
git config --global --add safe.directory /__w/terraform-importer-jamfpro/terraform-importer-jamfpro
git add importer_working_dir/
git commit -m "Uploading output files"
git push