Skip to content

Commit

Permalink
Added more links and documentation to the steps
Browse files Browse the repository at this point in the history
  • Loading branch information
mcasperson committed Aug 21, 2024
1 parent 483e4b8 commit da1bb7e
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 11 deletions.
6 changes: 5 additions & 1 deletion internal/steps/aws_terraform_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/mcasperson/OctoterraWizard/internal/strutil"
"github.com/mcasperson/OctoterraWizard/internal/validators"
"github.com/mcasperson/OctoterraWizard/internal/wizard"
"net/url"
"strings"
)

Expand Down Expand Up @@ -94,6 +95,9 @@ func (s AwsTerraformStateStep) GetContainer(parent fyne.Window) *fyne.Container
Terraform manages its state in an S3 bucket in AWS. Please provide the details of the S3 bucket that will be used to store the Terraform state.
`))

linkUrl, _ := url.Parse("https://developer.hashicorp.com/terraform/language/settings/backends/s3")
link := widget.NewHyperlink("Learn more about the AWS S3 Terraform backend.", linkUrl)

s.result = widget.NewLabel("")

s.infinite = widget.NewProgressBarInfinite()
Expand Down Expand Up @@ -143,7 +147,7 @@ func (s AwsTerraformStateStep) GetContainer(parent fyne.Window) *fyne.Container

formLayout := container.New(layout.NewFormLayout(), accessKeyLabel, s.accessKey, secretKeyLabel, s.secretKey, s3BucketLabel, s.s3Bucket, apiKeyLabel, s.s3Region)

middle := container.New(layout.NewVBoxLayout(), heading, label1, formLayout, s.infinite, s.result, s.logs)
middle := container.New(layout.NewVBoxLayout(), heading, label1, link, formLayout, s.infinite, s.result, s.logs)

content := container.NewBorder(nil, bottom, nil, nil, middle)

Expand Down
6 changes: 5 additions & 1 deletion internal/steps/azure_terraform_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/mcasperson/OctoterraWizard/internal/strutil"
"github.com/mcasperson/OctoterraWizard/internal/validators"
"github.com/mcasperson/OctoterraWizard/internal/wizard"
"net/url"
"strings"
)

Expand Down Expand Up @@ -111,6 +112,9 @@ func (s AzureTerraformStateStep) GetContainer(parent fyne.Window) *fyne.Containe
Please provide the details of the storage account that will be used to store the Terraform state.
`))

linkUrl, _ := url.Parse("https://developer.hashicorp.com/terraform/language/settings/backends/azurerm")
link := widget.NewHyperlink("Learn more about the Azure Terraform backend.", linkUrl)

s.logs = widget.NewEntry()
s.logs.SetMinRowsVisible(10)
s.logs.MultiLine = true
Expand Down Expand Up @@ -195,7 +199,7 @@ func (s AzureTerraformStateStep) GetContainer(parent fyne.Window) *fyne.Containe
azureContainerNameLabel,
s.containerName)

middle := container.New(layout.NewVBoxLayout(), heading, label1, formLayout, s.result, s.logs)
middle := container.New(layout.NewVBoxLayout(), heading, label1, link, formLayout, s.result, s.logs)

content := container.NewBorder(nil, bottom, nil, nil, middle)

Expand Down
6 changes: 5 additions & 1 deletion internal/steps/backend_selection.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fyne.io/fyne/v2/widget"
"github.com/mcasperson/OctoterraWizard/internal/strutil"
"github.com/mcasperson/OctoterraWizard/internal/wizard"
"net/url"
)

type BackendSelectionStep struct {
Expand Down Expand Up @@ -42,6 +43,9 @@ func (s BackendSelectionStep) GetContainer(parent fyne.Window) *fyne.Container {
Terraform requires a backend to manage its state. Select a backend from the list below.
`))

linkUrl, _ := url.Parse("https://developer.hashicorp.com/terraform/language/settings/backends/configuration")
link := widget.NewHyperlink("Learn more about Terraform backends.", linkUrl)

radio := widget.NewRadioGroup([]string{AwsS3, AzureStorage}, func(value string) {
s.State.BackendType = value
})
Expand All @@ -52,7 +56,7 @@ func (s BackendSelectionStep) GetContainer(parent fyne.Window) *fyne.Container {
radio.SetSelected(s.State.BackendType)
}

middle := container.New(layout.NewVBoxLayout(), heading, label1, radio)
middle := container.New(layout.NewVBoxLayout(), heading, label1, link, radio)

content := container.NewBorder(nil, bottom, nil, nil, middle)

Expand Down
7 changes: 6 additions & 1 deletion internal/steps/spread_variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/mcasperson/OctoterraWizard/internal/spreadvariables"
"github.com/mcasperson/OctoterraWizard/internal/strutil"
"github.com/mcasperson/OctoterraWizard/internal/wizard"
"net/url"
)

type SpreadVariablesStep struct {
Expand Down Expand Up @@ -56,6 +57,10 @@ func (s SpreadVariablesStep) GetContainer(parent fyne.Window) *fyne.Container {
intro3.Wrapping = fyne.TextWrapWord
intro4 := widget.NewLabel(strutil.TrimMultilineWhitespace(`Modifying variables in this way means steps can continue to refer to the original sensitive variable name, so no changes are required to the deployment process. However, removing the scopes from the sensitive variables does have security implications. In particular, all sensitive variables are exposed to all deployments and runbook runs.`))
intro4.Wrapping = fyne.TextWrapWord

linkUrl, _ := url.Parse("https://octopus.com/docs/administration/migrate-spaces-with-octoterra#spreading-sensitive-variables")
link := widget.NewHyperlink("Learn more about spreading sensitive variables.", linkUrl)

s.confirmChanges = widget.NewCheck("I understand and accept the security risks associated with spreading sensitive variables", func(value bool) {
if value {
s.spreadVariables.Enable()
Expand Down Expand Up @@ -89,7 +94,7 @@ func (s SpreadVariablesStep) GetContainer(parent fyne.Window) *fyne.Container {
}()
})
s.spreadVariables.Disable()
middle := container.New(layout.NewVBoxLayout(), heading, intro, intro2, intro3, intro4, s.confirmChanges, s.spreadVariables, infinite, result)
middle := container.New(layout.NewVBoxLayout(), heading, intro, intro2, intro3, intro4, link, s.confirmChanges, s.spreadVariables, infinite, result)

content := container.NewBorder(nil, bottom, nil, nil, middle)

Expand Down
7 changes: 6 additions & 1 deletion internal/steps/test_terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fyne.io/fyne/v2/widget"
"github.com/mcasperson/OctoterraWizard/internal/strutil"
"github.com/mcasperson/OctoterraWizard/internal/wizard"
"net/url"
"os/exec"
)

Expand Down Expand Up @@ -35,6 +36,10 @@ func (s TestTerraformStep) GetContainer(parent fyne.Window) *fyne.Container {
You must have Terraform installed to use this tool.
Click the "Test" button to check if Terraform is installed.
`))

linkUrl, _ := url.Parse("https://developer.hashicorp.com/terraform/install")
link := widget.NewHyperlink("Learn how to install Terraform.", linkUrl)

result := widget.NewLabel("")
testTerraform := widget.NewButton("Test Terraform is Installed", func() {
cmd := exec.Command("terraform", "-version")
Expand All @@ -45,7 +50,7 @@ func (s TestTerraformStep) GetContainer(parent fyne.Window) *fyne.Container {
next.Enable()
}
})
middle := container.New(layout.NewVBoxLayout(), heading, label1, testTerraform, result)
middle := container.New(layout.NewVBoxLayout(), heading, label1, link, testTerraform, result)

content := container.NewBorder(nil, bottom, nil, nil, middle)

Expand Down
10 changes: 7 additions & 3 deletions internal/steps/tools_selection.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fyne.io/fyne/v2/widget"
"github.com/mcasperson/OctoterraWizard/internal/strutil"
"github.com/mcasperson/OctoterraWizard/internal/wizard"
"net/url"
)

type ToolsSelectionStep struct {
Expand All @@ -30,12 +31,15 @@ func (s ToolsSelectionStep) GetContainer(parent fyne.Window) *fyne.Container {
heading.TextStyle = fyne.TextStyle{Bold: true}

label1 := widget.NewLabel(strutil.TrimMultilineWhitespace(`
The source server must either use Docker and container images to expose tools like Python and Terraform,
The source server must either use Docker and container images to expose tools like Python, PowerShell, and Terraform,
or have Terraform and Python installed locally.
If your source server has Docker installed, select the "Container Images" option.
Otherwise, ensure that Terraform and Python are installed locally and select the "Local Tools" option.
Otherwise, ensure that Terraform, Powershell Core, and Python are installed locally and select the "Local Tools" option.
`))

linkUrl, _ := url.Parse("https://octopus.com/docs/administration/migrate-spaces-with-octoterra#local-tools-vs-container-images")
link := widget.NewHyperlink("Learn more about local tools vs container images.", linkUrl)

radio := widget.NewRadioGroup([]string{"Container Images", "Local Tools"}, func(value string) {
s.State.UseContainerImages = value == "Container Images"
})
Expand All @@ -46,7 +50,7 @@ func (s ToolsSelectionStep) GetContainer(parent fyne.Window) *fyne.Container {
radio.SetSelected("Local Tools")
}

middle := container.New(layout.NewVBoxLayout(), heading, label1, radio)
middle := container.New(layout.NewVBoxLayout(), heading, label1, link, radio)

content := container.NewBorder(nil, bottom, nil, nil, middle)

Expand Down
6 changes: 3 additions & 3 deletions internal/steps/welcome.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ func (s WelcomeStep) GetContainer(parent fyne.Window) *fyne.Container {

label1 := widget.NewLabel(strutil.TrimMultilineWhitespace(`
Welcome to the Octoterra Wizard.
This tool prepares your Octopus space to export it to another instance, or to implement the Enterprise Patterns.
This tool prepares your Octopus space to export it to another instance.
`))
linkUrl, _ := url.Parse("https://octopus.com/docs/platform-engineering/enterprise-patterns")
link := widget.NewHyperlink("Learn more about the Enterprise Patterns.", linkUrl)
linkUrl, _ := url.Parse("https://octopus.com/docs/administration/migrate-spaces-with-octoterra")
link := widget.NewHyperlink("Read the documentation.", linkUrl)
middle := container.New(layout.NewVBoxLayout(), heading, label1, link)

bottom, previous, _ := s.BuildNavigation(func() {}, func() {
Expand Down

0 comments on commit da1bb7e

Please sign in to comment.