Skip to content

Commit

Permalink
Merge pull request #56 from silinternational/develop
Browse files Browse the repository at this point in the history
Release 3.1.0
  • Loading branch information
briskt authored Mar 8, 2023
2 parents ba33737 + befd91b commit d9a91f2
Show file tree
Hide file tree
Showing 27 changed files with 1,361 additions and 533 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Fetch all tags
run: git fetch --force --tags
-
name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.16
go-version: 1.19
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release --rm-dist
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test

on:
pull_request:
push:
tags:
- '*'

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2018-2021 SIL International
Copyright 2018-2022 SIL International

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
125 changes: 92 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ Examples.

Get help about the command.

```$ go run main.go workspaces clone -h```
```$ tfc-ops workspaces clone -h```

Clone just the workspace (no variables) to the same organization.

```$ go run main.go workspaces clone -o=my-org -s=source-workspace -n=new-workspace```
```$ tfc-ops workspaces clone -o=my-org -s=source-workspace -n=new-workspace```

Clone a workspace, its variables and its state to a different organization in TF Cloud.

Expand All @@ -37,7 +37,7 @@ workspace will need to be moved in the destination workspace from the normal var
down to the environment variables section (e.g. `CONFIRM_DESTROY`).

```
$ go run main.go workspaces clone -c=true -t=true -o=org1 -p=org2 -d=true \
$ tfc-ops workspaces clone -c=true -t=true -o=org1 -p=org2 -d=true \
$ -s=source-workspace -n=destination-workspace -v=org2-vcs-token
```

Expand All @@ -47,11 +47,11 @@ Examples.

Get help about the command.

```$ go run main.go workspaces list -h```
```$ tfc-ops workspaces list -h```

List the workspaces with at least one of their attributes/pieces of data.

```$ go run main.go workspaces list -o=gtis -a=id,name,created-at,environment,working-directory,terraform-version,vcsrepo```
```$ tfc-ops workspaces list -o=gtis -a=id,name,created-at,environment,working-directory,terraform-version,vcs-repo.identifier```

## Usage

Expand All @@ -66,42 +66,42 @@ Usage:
Available Commands:
help Help about any command
variables Update or List variables
version Show version
varsets Commands for Variable Sets
version Show tfc-ops version
workspaces Clone, List, or Update workspaces
Flags:
-h, --help help for tfc-ops
-o, --organization string required - Name of Terraform Enterprise Organization
-h, --help help for tfc-ops
Use "tfc-ops [command] --help" for more information about a command.
```

### Workspaces Help
```text
$ tfc-ops workspaces
Top level command for describing or updating workspaces or cloning a workspace
Usage:
tfc-ops workspaces [command]
Available Commands:
clone Clone a V2 Workspace
clone Clone a Workspace
list List Workspaces
update Update Workspaces
Flags:
-h, --help help for workspaces
-h, --help help for workspaces
-o, --organization string required - Name of Terraform Cloud Organization
-r, --read-only-mode read-only mode (e.g. "-r")
Global Flags:
-o, --organization string required - Name of Terraform Enterprise Organization
Use "tfc-ops [command] --help" for more information about a command.
Use "tfc-ops workspaces [command] --help" for more information about a command.
```


### Workspace Clone Help
```text
$ tfc-ops workspaces clone -h
Clone a TF Enterprise Version 2 Workspace
Clone a Terraform Cloud Workspace
Usage:
tfc-ops workspaces clone [flags]
Expand All @@ -111,13 +111,14 @@ Flags:
-c, --copyVariables optional (e.g. "-c=true") whether to copy the values of the Source Workspace variables.
-d, --differentDestinationAccount optional (e.g. "-d=true") whether to clone to a different TF account.
-h, --help help for clone
-p, --new-organization string Name of the Destination Organization in TF Enterprise (version 2)
-p, --new-organization string Name of the Destination Organization in Terraform Cloud
-v, --new-vcs-token-id string The new organization's VCS repo's oauth-token-id
-n, --new-workspace string required - Name of the new Workspace in TF Enterprise (version 2)
-s, --source-workspace string required - Name of the Source Workspace in TF Enterprise (version 2)
-n, --new-workspace string required - Name of the new Workspace in Terraform Cloud
-s, --source-workspace string required - Name of the Source Workspace in Terraform Cloud
Global Flags:
-o, --organization string required - Name of Terraform Enterprise Organization
-o, --organization string required - Name of Terraform Cloud Organization
-r, --read-only-mode read-only mode (e.g. "-r")
```

### Workspace List Help
Expand All @@ -138,7 +139,8 @@ Flags:
-h, --help help for list
Global Flags:
-o, --organization string required - Name of Terraform Enterprise Organization
-o, --organization string required - Name of Terraform Cloud Organization
-r, --read-only-mode read-only mode (e.g. "-r")
```

### Workspace Update Help
Expand All @@ -159,28 +161,32 @@ Flags:
-d, --dry-run-mode dry run mode only. (e.g. "-d")
-h, --help help for update
-v, --value string required - Value
-w, --workspace string required - Workspace filter
-w, --workspace string required - Partial workspace name to search across all workspaces
Global Flags:
-o, --organization string required - Name of Terraform Enterprise Organization
-o, --organization string required - Name of Terraform Cloud Organization
-r, --read-only-mode read-only mode (e.g. "-r")
```

### Variables Help
```text
$ tfc-ops variables
Top level command to update or lists variables in all workspaces
Usage:
tfc-ops variables [command]
Available Commands:
add Add new variable (if not already present)
delete Delete variable
list Report on variables
update Update/add a variable in a V2 Workspace
update Update/add a variable in a Workspace
Flags:
-h, --help help for variables
Global Flags:
-o, --organization string required - Name of Terraform Enterprise Organization
-h, --help help for variables
-o, --organization string required - Name of Terraform Cloud Organization
-r, --read-only-mode read-only mode (e.g. "-r")
-w, --workspace string Name of the Workspace in Terraform Cloud
Use "tfc-ops variables [command] --help" for more information about a command.
```
Expand All @@ -197,33 +203,86 @@ Flags:
-h, --help help for list
-k, --key_contains string required if value_contains is blank - string contained in the Terraform variable keys to report on
-v, --value_contains string required if key_contains is blank - string contained in the Terraform variable values to report on
-w, --workspace string Name of the Workspace in TF Enterprise
Global Flags:
-o, --organization string required - Name of Terraform Enterprise Organization
-o, --organization string required - Name of Terraform Cloud Organization
-r, --read-only-mode read-only mode (e.g. "-r")
-w, --workspace string Name of the Workspace in Terraform Cloud
```

### Variables Update Help
```text
$ tfc-ops variables update -h
Update or add a variable in a TF Enterprise Version 2 Workspace based on a complete case-insensitive match
Update or add a variable in a Terraform Cloud Workspace based on a complete case-insensitive match
Usage:
tfc-ops variables update [flags]
Flags:
-a, --add-key-if-not-found optional (e.g. "-a=true") whether to add a new variable if a matching key is not found.
-d, --dry-run-mode optional (e.g. "-d=true") dry run mode only.
-h, --help help for update
-n, --new-variable-value string required - The desired new value of the variable
-v, --search-on-variable-value optional (e.g. "-v=true") whether to do the search based on the value of the variables. (Must be false if add-key-if-not-found is true
-x, --sensitive-variable optional (e.g. "-x=true") make the variable sensitive.
-s, --variable-search-string string required - The string to match in the current variables (either in the Key or Value - see other flags)
-w, --workspace string Name of the Workspace in TF Enterprise (version 2)
Global Flags:
-o, --organization string required - Name of Terraform Enterprise Organization
-o, --organization string required - Name of Terraform Cloud Organization
-r, --read-only-mode read-only mode (e.g. "-r")
-w, --workspace string Name of the Workspace in Terraform Cloud
```

### Variables Delete Help
```text
Delete variable in matching workspace having the specified key
Usage:
tfc-ops variables delete [flags]
Flags:
-h, --help help for delete
-k, --key string required - Terraform variable key to delete, must match exactly
Global Flags:
-o, --organization string required - Name of Terraform Cloud Organization
-r, --read-only-mode read-only mode (e.g. "-r")
-w, --workspace string Name of the Workspace in Terraform Cloud
```

### Variables Add Help
```text
Add variable in matching workspace having the specified key
Usage:
tfc-ops variables add [flags]
Flags:
-h, --help help for add
-k, --key string required - Terraform variable key
-v, --value string required - Terraform variable value
Global Flags:
-o, --organization string required - Name of Terraform Cloud Organization
-r, --read-only-mode read-only mode (e.g. "-r")
-w, --workspace string Name of the Workspace in Terraform Cloud
```

### Variable Sets Apply Help
```text
Apply an existing variable set to workspaces
Usage:
tfc-ops varsets apply [flags]
Flags:
-h, --help help for apply
-s, --set string required - Terraform variable set to add
-w, --workspace string Name of the Workspace in Terraform Cloud
--workspace-filter string Partial workspace name to search across all workspaces
Global Flags:
-o, --organization string required - Name of Terraform Cloud Organization
-r, --read-only-mode read-only mode (e.g. "-r")
```

## License
Expand Down
2 changes: 1 addition & 1 deletion backend.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
terraform {
backend "atlas" {
backend "remote" {
}
}
Loading

0 comments on commit d9a91f2

Please sign in to comment.