Skip to content

Commit 11141e1

Browse files
authored
Merge pull request hashicorp#125 from hashicorp/jray-update-automation-script
Jray update automation script
2 parents 2eb87ca + 3713328 commit 11141e1

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

operations/automation-script/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ The script does the following steps:
3838
1. If any apply was done, the script goes into a second loop to wait for it to finish.
3939
1. When the apply is finished, the script downloads the apply log and the state files from before and after the apply.
4040

41-
Note that some json template files are included from which other json files are generated so that they can be passed to the curl commands.
41+
*Note* that some json template files are included from which other json files are generated so that they can be passed to the curl commands.
4242

4343
In addition to the loadAndRunWorkspace.sh script, this example includes the following files:
4444

4545
1. [config/main.tf](./config/main.tf): the file with some Terraform code that says "Hello" to the person whose name is given and generates a random number. This is used if no git URL is provided to the script.
46-
1. [workspace.template.json](./workspace.template.json) which is used to generate workspace.json which is used when creating the workspace.
46+
1. [workspace.template.json](./workspace.template.json) which is used to generate workspace.json which is used when creating the workspace. If you wish to add or modify the API commands that are included in _@workspace.json_ payload, add them to _workspace.template.json_ and be sure to check the Terraform Enterprise API [syntax](https://www.terraform.io/docs/enterprise/api/workspaces.html#update-a-workspace). Update or modify `"terraform-version": "0.11.14"` within _workspace.template.json_ to set a specific workspace version of Terraform OSS binary.
4747
1. [configversion.json](./configversion.json) which is used to generate a new configuration version.
4848
1. [variable.template.json](./variable.template.json) which is used to generate variable.json which is used when creating a variable called "name" in the workspace.
4949
1. [run.template.json](./run.template.json) which is used to generate run.json which is used when triggering a run against the workspace.
@@ -52,7 +52,7 @@ In addition to the loadAndRunWorkspace.sh script, this example includes the foll
5252
1. [deleteWorkspace.sh](./deleteWorkspace.sh): a script that can be used to delete the workspace.
5353
1. [restrict-name-variable.sentinel](./restrict-name-variable.sentinel): a Sentinel policy you can add to your TFE organization in order to see how the script can check Sentinel policies and even override soft-mandatory failures.
5454

55-
Note that the json templates file need to be in the same directory as the script itself. The variables.csv file should also be in the same directory as the script unless you include a file with the same name in your git repository.
55+
*Note* that the json templates file need to be in the same directory as the script itself. The variables.csv file should also be in the same directory as the script unless you include a file with the same name in your git repository.
5656

5757
## Preparation
5858
Do the following before using this script:

operations/automation-script/config/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ variable "name" {
33
}
44

55
resource "random_id" "random" {
6-
keepers {
6+
keepers = {
77
uuid = "${uuid()}"
88
}
99
byte_length = 32

operations/automation-script/workspace.template.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"data":
33
{
44
"attributes": {
5-
"name":"placeholder"
5+
"name":"placeholder",
6+
"terraform-version": "0.11.14"
67
},
78
"type":"workspaces"
89
}

0 commit comments

Comments
 (0)