From cb51b334bb38c3290df1641911f74044a21ea64e Mon Sep 17 00:00:00 2001 From: magodo Date: Wed, 25 Dec 2024 11:37:28 +1100 Subject: [PATCH 1/6] Github action example --- .github/workflows/demo.yml | 24 ++++++++++++++++++++++++ .gitignore | 2 ++ example/main.tf | 31 +++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 .github/workflows/demo.yml create mode 100644 .gitignore create mode 100644 example/main.tf diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml new file mode 100644 index 0000000..b30d2bd --- /dev/null +++ b/.github/workflows/demo.yml @@ -0,0 +1,24 @@ +name: Pipeform Demo +on: + workflow_dispatch +jobs: + Demo: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Go 1.23 + uses: actions/setup-go@v5 + with: + go-version: '1.23' + - name: Install pipeform + run: go install + - uses: hashicorp/setup-terraform@v3 + with: + terraform_version: "1.10.3" + - run: | + cd example + terraform init + terraform apply -json -auto-approve | $HOME/go/bin/pipeform + + + \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5dfe310 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.terraform* +terraform.tfstate* diff --git a/example/main.tf b/example/main.tf new file mode 100644 index 0000000..9d1959e --- /dev/null +++ b/example/main.tf @@ -0,0 +1,31 @@ +terraform { + required_providers { + null = { + source = "hashicorp/null" + version = "3.2.3" + } + } +} + +resource "null_resource" "cluster" { + count = 30 + triggers = { + foo = "bar" + } + + provisioner "local-exec" { + command = "sleep ${count.index % 5 + 1}" + } +} + +output "output_string" { + value = null_resource.cluster[0].id +} + +output "output_bool" { + value = true +} + +output "output_num" { + value = 123 +} From 3829ec3d1b540370e6761d5b56861259e7b9e8a1 Mon Sep 17 00:00:00 2001 From: magodo Date: Wed, 25 Dec 2024 11:48:40 +1100 Subject: [PATCH 2/6] temporarily add trigger pull_request --- .github/workflows/demo.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index b30d2bd..79b9522 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -1,6 +1,7 @@ name: Pipeform Demo on: - workflow_dispatch + workflow_dispatch: + pull_request: jobs: Demo: runs-on: ubuntu-latest From 8dcc88de49d90839b5f9dcb696d2172e193a6e1d Mon Sep 17 00:00:00 2001 From: magodo Date: Wed, 25 Dec 2024 11:50:13 +1100 Subject: [PATCH 3/6] update --- .github/workflows/demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index 79b9522..9179727 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -12,7 +12,7 @@ jobs: with: go-version: '1.23' - name: Install pipeform - run: go install + run: CGO_ENABLED=0 go install - uses: hashicorp/setup-terraform@v3 with: terraform_version: "1.10.3" From 928648c423ac30fa40429c401ca2b67ffa53e0f5 Mon Sep 17 00:00:00 2001 From: magodo Date: Mon, 13 Jan 2025 16:44:29 +1100 Subject: [PATCH 4/6] test no input --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index f7b8369..ab1ab68 100644 --- a/main.go +++ b/main.go @@ -98,7 +98,7 @@ func main() { reader := reader.NewReader(os.Stdin, teeWriter) m := ui.NewRuntimeModel(logger, reader, startTime) - tm, err := tea.NewProgram(m, tea.WithInputTTY(), tea.WithAltScreen()).Run() + tm, err := tea.NewProgram(m, tea.WithInput(nil), tea.WithAltScreen()).Run() if err != nil { return fmt.Errorf("Error running program: %v\n", err) } From 86e31b87ae56f503b85d0582cb00a9dca9e6bfa1 Mon Sep 17 00:00:00 2001 From: magodo Date: Mon, 13 Jan 2025 16:47:44 +1100 Subject: [PATCH 5/6] Revert "test no input" This reverts commit 928648c423ac30fa40429c401ca2b67ffa53e0f5. --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index ab1ab68..f7b8369 100644 --- a/main.go +++ b/main.go @@ -98,7 +98,7 @@ func main() { reader := reader.NewReader(os.Stdin, teeWriter) m := ui.NewRuntimeModel(logger, reader, startTime) - tm, err := tea.NewProgram(m, tea.WithInput(nil), tea.WithAltScreen()).Run() + tm, err := tea.NewProgram(m, tea.WithInputTTY(), tea.WithAltScreen()).Run() if err != nil { return fmt.Errorf("Error running program: %v\n", err) } From 957fc49566a7cac8f536b6c74284ea47ea054439 Mon Sep 17 00:00:00 2001 From: magodo Date: Mon, 13 Jan 2025 22:00:01 +1100 Subject: [PATCH 6/6] update --- .github/workflows/demo.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index 9179727..0e755c3 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -19,7 +19,7 @@ jobs: - run: | cd example terraform init - terraform apply -json -auto-approve | $HOME/go/bin/pipeform + terraform apply -json -auto-approve | $HOME/go/bin/pipeform --plain-ui - \ No newline at end of file +