terraspace 1.1.5 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/.cody/all/bin/build.sh +33 -0
  3. data/.cody/all/buildspec.yml +10 -0
  4. data/.cody/{aws/role.rb → all/iam_role.rb} +0 -0
  5. data/.cody/all/project.rb +6 -0
  6. data/.cody/aws/bin/build.sh +5 -0
  7. data/.cody/aws/iam_role.rb +6 -0
  8. data/.cody/aws/project.rb +6 -2
  9. data/.cody/azurerm/bin/build.sh +5 -0
  10. data/.cody/azurerm/{role.rb → iam_role.rb} +0 -0
  11. data/.cody/azurerm/project.rb +5 -3
  12. data/.cody/google/bin/build.sh +5 -0
  13. data/.cody/google/{role.rb → iam_role.rb} +0 -0
  14. data/.cody/google/project.rb +5 -3
  15. data/.cody/none/bin/build.sh +5 -0
  16. data/.cody/none/{role.rb → iam_role.rb} +0 -0
  17. data/.cody/none/project.rb +6 -2
  18. data/.cody/shared/script/install/terraform.sh +2 -1
  19. data/.cody/shared/script/update/gemfile.sh +2 -0
  20. data/.cody/unit/project.rb +2 -2
  21. data/.gitignore +2 -0
  22. data/.pipedream/pipeline.rb +4 -3
  23. data/CHANGELOG.md +31 -0
  24. data/exe/terraspace +0 -7
  25. data/lib/templates/base/project/config/app.rb +3 -0
  26. data/lib/templates/plugin/ci/%gem_name%.gemspec.tt +32 -0
  27. data/lib/templates/plugin/ci/.gitignore +12 -0
  28. data/lib/templates/plugin/{.rspec → ci/.rspec} +0 -0
  29. data/lib/templates/plugin/ci/.rubocop.yml +13 -0
  30. data/lib/templates/plugin/ci/CHANGELOG.md.tt +5 -0
  31. data/lib/templates/plugin/ci/Gemfile +10 -0
  32. data/lib/templates/plugin/ci/LICENSE.txt +21 -0
  33. data/lib/templates/plugin/ci/README.md.tt +19 -0
  34. data/lib/templates/plugin/ci/Rakefile +12 -0
  35. data/lib/templates/plugin/ci/lib/%gem_name%/autoloader.rb.tt +23 -0
  36. data/lib/templates/plugin/ci/lib/%gem_name%/interface.rb.tt +15 -0
  37. data/lib/templates/plugin/ci/lib/%gem_name%/pr.rb.tt +15 -0
  38. data/lib/templates/plugin/ci/lib/%gem_name%/vars.rb.tt +26 -0
  39. data/lib/templates/plugin/ci/lib/%gem_name%/version.rb.tt +5 -0
  40. data/lib/templates/plugin/ci/lib/%gem_name%.rb.tt +17 -0
  41. data/lib/templates/plugin/ci/spec/%gem_name%_spec.rb.tt +7 -0
  42. data/lib/templates/plugin/ci/spec/spec_helper.rb.tt +15 -0
  43. data/lib/templates/plugin/{.gitignore → core/.gitignore} +0 -0
  44. data/lib/templates/plugin/core/.rspec +3 -0
  45. data/lib/templates/plugin/{CHANGELOG.md → core/CHANGELOG.md} +0 -0
  46. data/lib/templates/plugin/{Gemfile → core/Gemfile} +0 -0
  47. data/lib/templates/plugin/{LICENSE.txt → core/LICENSE.txt} +0 -0
  48. data/lib/templates/plugin/{README.md.tt → core/README.md.tt} +0 -0
  49. data/lib/templates/plugin/{Rakefile → core/Rakefile} +0 -0
  50. data/lib/templates/plugin/{bin → core/bin}/console.tt +0 -0
  51. data/lib/templates/plugin/{bin → core/bin}/setup +0 -0
  52. data/lib/templates/plugin/{lib → core/lib}/templates/hcl/module/main.tf +0 -0
  53. data/lib/templates/plugin/{lib → core/lib}/templates/hcl/module/outputs.tf +0 -0
  54. data/lib/templates/plugin/{lib → core/lib}/templates/hcl/module/variables.tf +0 -0
  55. data/lib/templates/plugin/{lib → core/lib}/templates/hcl/project/config/terraform/backend.tf.tt +0 -0
  56. data/lib/templates/plugin/{lib → core/lib}/templates/hcl/project/config/terraform/provider.tf +0 -0
  57. data/lib/templates/plugin/{lib → core/lib}/templates/hcl/stack/main.tf +0 -0
  58. data/lib/templates/plugin/{lib → core/lib}/templates/hcl/stack/outputs.tf +0 -0
  59. data/lib/templates/plugin/{lib → core/lib}/templates/hcl/stack/variables.tf +0 -0
  60. data/lib/templates/plugin/{lib → core/lib}/templates/ruby/module/main.rb +0 -0
  61. data/lib/templates/plugin/{lib → core/lib}/templates/ruby/module/outputs.rb +0 -0
  62. data/lib/templates/plugin/{lib → core/lib}/templates/ruby/module/variables.rb +0 -0
  63. data/lib/templates/plugin/{lib → core/lib}/templates/ruby/project/config/terraform/backend.rb.tt +0 -0
  64. data/lib/templates/plugin/{lib → core/lib}/templates/ruby/project/config/terraform/provider.rb +0 -0
  65. data/lib/templates/plugin/{lib → core/lib}/templates/ruby/stack/main.rb +0 -0
  66. data/lib/templates/plugin/{lib → core/lib}/templates/ruby/stack/outputs.rb +0 -0
  67. data/lib/templates/plugin/{lib → core/lib}/templates/ruby/stack/variables.rb +0 -0
  68. data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/.rspec +0 -0
  69. data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/Gemfile +0 -0
  70. data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/spec/fixtures/stack/main.tf +0 -0
  71. data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/spec/fixtures/stack/outputs.tf +0 -0
  72. data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/spec/fixtures/stack/variables.tf +0 -0
  73. data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/spec/main_spec.rb +0 -0
  74. data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/spec/spec_helper.rb +0 -0
  75. data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/autoloader.rb.tt +0 -0
  76. data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/clients.rb.tt +0 -0
  77. data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/interfaces/backend.rb.tt +0 -0
  78. data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/interfaces/config.rb.tt +0 -0
  79. data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/interfaces/expander.rb.tt +0 -0
  80. data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/interfaces/layer.rb.tt +0 -0
  81. data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/version.rb.tt +0 -0
  82. data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%.rb.tt +0 -0
  83. data/lib/templates/plugin/{spec → core/spec}/spec_helper.rb.tt +0 -0
  84. data/lib/templates/plugin/{spec → core/spec}/terraspace_provider_%name%_spec.rb.tt +0 -0
  85. data/lib/templates/plugin/{terraspace_plugin_%name%.gemspec.tt → core/terraspace_plugin_%name%.gemspec.tt} +0 -0
  86. data/lib/terraspace/all/runner.rb +4 -1
  87. data/lib/terraspace/all/summary.rb +2 -0
  88. data/lib/terraspace/app.rb +23 -4
  89. data/lib/terraspace/builder/children.rb +6 -7
  90. data/lib/terraspace/builder.rb +8 -2
  91. data/lib/terraspace/cli/concerns/plan_path.rb +8 -0
  92. data/lib/terraspace/cli/down.rb +4 -0
  93. data/lib/terraspace/cli/init.rb +1 -1
  94. data/lib/terraspace/cli/new/ci.rb +121 -0
  95. data/lib/terraspace/cli/new/example.rb +1 -1
  96. data/lib/terraspace/cli/new/helpers/plugin_gem.rb +1 -1
  97. data/lib/terraspace/cli/new/plugin/ci.rb +46 -0
  98. data/lib/terraspace/cli/new/plugin/core.rb +26 -0
  99. data/lib/terraspace/cli/new/plugin/helper.rb +4 -1
  100. data/lib/terraspace/cli/new/plugin.rb +8 -15
  101. data/lib/terraspace/cli/new/test.rb +1 -1
  102. data/lib/terraspace/cli/new.rb +17 -13
  103. data/lib/terraspace/cli/plan.rb +13 -0
  104. data/lib/terraspace/cli/setup/check.rb +8 -0
  105. data/lib/terraspace/cli/up.rb +8 -12
  106. data/lib/terraspace/cli.rb +2 -2
  107. data/lib/terraspace/cloud/api/cani.rb +30 -0
  108. data/lib/terraspace/cloud/api/concern/errors.rb +12 -0
  109. data/lib/terraspace/cloud/api/concern/record.rb +18 -0
  110. data/lib/terraspace/cloud/api/concern.rb +38 -0
  111. data/lib/terraspace/cloud/api/http_methods.rb +116 -0
  112. data/lib/terraspace/cloud/api/validate.rb +24 -0
  113. data/lib/terraspace/cloud/api.rb +33 -0
  114. data/lib/terraspace/cloud/base.rb +97 -0
  115. data/lib/terraspace/cloud/ci/generic.rb +25 -0
  116. data/lib/terraspace/cloud/ci/manual.rb +81 -0
  117. data/lib/terraspace/cloud/ci/vcs/base.rb +36 -0
  118. data/lib/terraspace/cloud/ci/vcs/bitbucket.rb +11 -0
  119. data/lib/terraspace/cloud/ci/vcs/github.rb +11 -0
  120. data/lib/terraspace/cloud/ci/vcs/gitlab.rb +11 -0
  121. data/lib/terraspace/cloud/ci/vcs.rb +18 -0
  122. data/lib/terraspace/cloud/ci.rb +56 -0
  123. data/lib/terraspace/cloud/context.rb +14 -0
  124. data/lib/terraspace/cloud/folder/base.rb +17 -0
  125. data/lib/terraspace/cloud/folder/package.rb +33 -0
  126. data/lib/terraspace/cloud/folder/tidy.rb +54 -0
  127. data/lib/terraspace/cloud/folder/uploader.rb +37 -0
  128. data/lib/terraspace/cloud/folder.rb +11 -0
  129. data/lib/terraspace/cloud/plan.rb +47 -0
  130. data/lib/terraspace/cloud/update.rb +37 -0
  131. data/lib/terraspace/command.rb +16 -1
  132. data/lib/terraspace/compiler/dsl/syntax/mod.rb +2 -2
  133. data/lib/terraspace/compiler/dsl/syntax/tfvar.rb +1 -1
  134. data/lib/terraspace/compiler/expander/backend.rb +1 -1
  135. data/lib/terraspace/compiler/expander.rb +1 -1
  136. data/lib/terraspace/compiler/strategy/tfvar/layer.rb +57 -28
  137. data/lib/terraspace/core.rb +36 -3
  138. data/lib/terraspace/ext/core/module.rb +9 -4
  139. data/lib/terraspace/hooks/builder.rb +1 -1
  140. data/lib/terraspace/logger.rb +32 -5
  141. data/lib/terraspace/mod.rb +21 -9
  142. data/lib/terraspace/plugin/expander/interface.rb +15 -11
  143. data/lib/terraspace/plugin.rb +14 -5
  144. data/lib/terraspace/shell.rb +7 -2
  145. data/lib/terraspace/terraform/args/thor.rb +8 -2
  146. data/lib/terraspace/terraform/ihooks/after/apply.rb +8 -0
  147. data/lib/terraspace/terraform/ihooks/after/destroy.rb +8 -0
  148. data/lib/terraspace/terraform/ihooks/after/plan.rb +31 -2
  149. data/lib/terraspace/terraform/ihooks/base.rb +7 -3
  150. data/lib/terraspace/terraform/ihooks/before/apply.rb +8 -0
  151. data/lib/terraspace/terraform/ihooks/before/destroy.rb +8 -0
  152. data/lib/terraspace/terraform/ihooks/before/plan.rb +11 -3
  153. data/lib/terraspace/terraform/runner.rb +19 -5
  154. data/lib/terraspace/version.rb +1 -1
  155. data/lib/terraspace.rb +2 -0
  156. data/terraspace.gemspec +1 -0
  157. metadata +119 -51
  158. data/.pipedream/schedule.rb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 91fe12476c2039a757ceb34e964609b8b5d0d922b08818f122088b5cd3989364
4
- data.tar.gz: 01c7ec1d07c2a6be6da3d14e300c5dfb460a2b2595e511c4dc792e50530853f5
3
+ metadata.gz: e2e48b2824f50628986b242f0d8f751795b755f54ae1cf3cda72bf7ff2447807
4
+ data.tar.gz: cdaec82517675a111b57f15ef081f930bc4f4712003109452dda9c79222b2ee5
5
5
  SHA512:
6
- metadata.gz: 0fadfaa474138a8ef5f5856eb4b4cf5c3c998ecc6787c4ebbbc1c960e35b7949cf1ae6dd0b42bc0c6a8eba5b60007e57bc402c35a5ccd115a0172d1cbce67cb5
7
- data.tar.gz: 26f8095beac1358e28c0eb516c7dafc5bf896a3076d7fb113e2bd0a97906b9ad3dfc7bd4816a7d844656fc7bf95e006f377b7b83407e4279bda614b2c4e35252
6
+ metadata.gz: 6cc7d06b5e877b2ff3a5dccf2a19c1a94028ed34f83ce8067600c1b6a0e1ba9b3a1dd27d558a7a3d6916af346b09a7eb5248536b4afc162e4268862a484b710f
7
+ data.tar.gz: c4293d7b1b496ea38c839113c1845d95552d11da8b041ff115ae1ecaab3b11e659a4e7f906b7b704150144ac70e48faa689e35cb75642b583db7e19a3c36ff79
@@ -0,0 +1,33 @@
1
+ #!/bin/bash
2
+
3
+ set -eu
4
+
5
+ # will build from /tmp because terraspace/Gemfile may interfere
6
+ cd /tmp
7
+
8
+ export PATH=~/bin:$PATH # ~/bin/terraspace wrapper
9
+
10
+ set -x
11
+
12
+ git clone https://github.com/boltops-tools/terraspace-graph-demo
13
+ cd terraspace-graph-demo
14
+
15
+ # Rewrite the Gemfile to use the local terraspace gem for testing
16
+ cat << EOF > Gemfile
17
+ source "https://rubygems.org"
18
+ gem "terraspace", path: "$CODEBUILD_SRC_DIR", submodules: true
19
+ gem "rspec-terraspace", git: "https://github.com/boltops-tools/rspec-terraspace", branch: "master"
20
+ gem "terraspace_plugin_aws", git: "https://github.com/boltops-tools/terraspace_plugin_aws", branch: "master"
21
+ EOF
22
+ bundle
23
+
24
+ # Uncomment to enable logger level debug
25
+ # cat << EOF > config/app.rb
26
+ # Terraspace.configure do |config|
27
+ # config.logger.level = :debug
28
+ # end
29
+ # EOF
30
+
31
+ terraspace all up -y
32
+ terraspace clean all -y
33
+ terraspace all down -y
@@ -0,0 +1,10 @@
1
+ version: 0.2
2
+
3
+ phases:
4
+ install:
5
+ runtime-versions:
6
+ ruby: latest
7
+ build:
8
+ commands:
9
+ - .cody/shared/script/install.sh
10
+ - .cody/all/bin/build.sh
File without changes
@@ -0,0 +1,6 @@
1
+ github("boltops-tools/terraspace")
2
+ image("aws/codebuild/amazonlinux2-x86_64-standard:3.0")
3
+ env_vars(
4
+ TS_ORG: "qa",
5
+ TS_TOKEN: "ssm:/#{Cody.env}/TS_TOKEN",
6
+ )
@@ -10,6 +10,11 @@ export PATH=~/bin:$PATH # ~/bin/terraspace wrapper
10
10
  set -x
11
11
  terraspace new project infra --examples
12
12
  cd infra
13
+ $CODEBUILD_SRC_DIR/.cody/shared/script/update/gemfile.sh
14
+
13
15
  terraspace new test demo --type stack
14
16
  cd app/stacks/demo
17
+ cd test
18
+ $CODEBUILD_SRC_DIR/.cody/shared/script/update/gemfile.sh
19
+ cd -
15
20
  terraspace test
@@ -0,0 +1,6 @@
1
+ iam_policy(
2
+ "dynamodb",
3
+ "logs",
4
+ "s3",
5
+ "ssm",
6
+ )
data/.cody/aws/project.rb CHANGED
@@ -1,2 +1,6 @@
1
- github_url("https://github.com/boltops-tools/terraspace.git")
2
- linux_image("aws/codebuild/amazonlinux2-x86_64-standard:3.0")
1
+ github("boltops-tools/terraspace")
2
+ image("aws/codebuild/amazonlinux2-x86_64-standard:3.0")
3
+ env_vars(
4
+ TS_ORG: "qa",
5
+ TS_TOKEN: "ssm:/#{Cody.env}/TS_TOKEN",
6
+ )
@@ -17,6 +17,11 @@ export ARM_TENANT_ID=$(cat ~/.azure/app-client.json | jq -r '.tenant_id')
17
17
  set -x
18
18
  terraspace new project infra --examples --plugin azurerm
19
19
  cd infra
20
+ $CODEBUILD_SRC_DIR/.cody/shared/script/update/gemfile.sh
21
+
20
22
  terraspace new test demo --type stack
21
23
  cd app/stacks/demo
24
+ cd test
25
+ $CODEBUILD_SRC_DIR/.cody/shared/script/update/gemfile.sh
26
+ cd -
22
27
  terraspace test
File without changes
@@ -1,6 +1,8 @@
1
- github_url("https://github.com/boltops-tools/terraspace.git")
2
- linux_image("aws/codebuild/amazonlinux2-x86_64-standard:3.0")
3
- environment_variables(
1
+ github("boltops-tools/terraspace")
2
+ image("aws/codebuild/amazonlinux2-x86_64-standard:3.0")
3
+ env_vars(
4
4
  # Used by .cody/azurerm/bin/az/configure.sh
5
5
  AZURE_APP_CLIENT_JSON: ssm("/terraspace/#{Cody.env}/azure_app_client_json"),
6
+ TS_ORG: "qa",
7
+ TS_TOKEN: "ssm:/#{Cody.env}/TS_TOKEN",
6
8
  )
@@ -14,6 +14,11 @@ export GOOGLE_PROJECT=$(cat $GOOGLE_APPLICATION_CREDENTIALS | jq -r '.project_id
14
14
  set -x
15
15
  terraspace new project infra --examples --plugin google
16
16
  cd infra
17
+ $CODEBUILD_SRC_DIR/.cody/shared/script/update/gemfile.sh
18
+
17
19
  terraspace new test demo --type stack
18
20
  cd app/stacks/demo
21
+ cd test
22
+ $CODEBUILD_SRC_DIR/.cody/shared/script/update/gemfile.sh
23
+ cd -
19
24
  terraspace test
File without changes
@@ -1,6 +1,8 @@
1
- github_url("https://github.com/boltops-tools/terraspace.git")
2
- linux_image("aws/codebuild/amazonlinux2-x86_64-standard:3.0")
3
- environment_variables(
1
+ github("boltops-tools/terraspace")
2
+ image("aws/codebuild/amazonlinux2-x86_64-standard:3.0")
3
+ env_vars(
4
4
  # Used by .cody/google/bin/gcloud/configure.sh
5
5
  GOOGLE_CREDS_JSON: ssm("/terraspace/#{Cody.env}/google_creds_json"),
6
+ TS_ORG: "qa",
7
+ TS_TOKEN: "ssm:/#{Cody.env}/TS_TOKEN",
6
8
  )
@@ -10,6 +10,11 @@ export PATH=~/bin:$PATH # ~/bin/terraspace wrapper
10
10
  set -x
11
11
  terraspace new project infra --plugin none --examples
12
12
  cd infra
13
+ $CODEBUILD_SRC_DIR/.cody/shared/script/update/gemfile.sh
14
+
13
15
  terraspace new test demo --type stack
14
16
  cd app/stacks/demo
17
+ cd test
18
+ $CODEBUILD_SRC_DIR/.cody/shared/script/update/gemfile.sh
19
+ cd -
15
20
  terraspace test
File without changes
@@ -1,2 +1,6 @@
1
- github_url("https://github.com/boltops-tools/terraspace.git")
2
- linux_image("aws/codebuild/amazonlinux2-x86_64-standard:3.0")
1
+ github("boltops-tools/terraspace")
2
+ image("aws/codebuild/amazonlinux2-x86_64-standard:3.0")
3
+ env_vars(
4
+ TS_ORG: "qa",
5
+ TS_TOKEN: "ssm:/#{Cody.env}/TS_TOKEN",
6
+ )
@@ -2,7 +2,8 @@
2
2
 
3
3
  set -eu
4
4
 
5
- TERRAFORM_VERSION=latest
5
+ #TERRAFORM_VERSION=latest
6
+ TERRAFORM_VERSION=1.1.9
6
7
 
7
8
  git clone https://github.com/tfutils/tfenv.git ~/.tfenv
8
9
  echo 'export PATH="$HOME/.tfenv/bin:$PATH"' >> ~/.bash_profile
@@ -0,0 +1,2 @@
1
+ #!/bin/bash
2
+ sed -i 's/gem "terraspace".*/gem "terraspace", path: ENV[\"CODEBUILD_SRC_DIR\"]/' Gemfile
@@ -1,2 +1,2 @@
1
- github_url("https://github.com/boltops-tools/terraspace.git")
2
- linux_image("aws/codebuild/amazonlinux2-x86_64-standard:3.0")
1
+ github("boltops-tools/terraspace")
2
+ image("aws/codebuild/amazonlinux2-x86_64-standard:3.0")
data/.gitignore CHANGED
@@ -18,3 +18,5 @@
18
18
  /test/tmp
19
19
  /test/version_tmp
20
20
  /tmp
21
+ .cody/output
22
+ .pipedream/output
@@ -1,14 +1,15 @@
1
1
  stage "Source" do
2
2
  github(
3
- source: "boltops-tools/terraspace",
4
- # branch: "master", # branch defaults to "master" or the `pipe deploy --branch` option
5
- auth_token: ssm("/github/boltopsbot/token")
3
+ Source: "boltops-tools/terraspace",
4
+ # Branch: "master", # branch defaults to "master" or the `pipe deploy --branch` option
5
+ AuthToken: ssm("/github/boltopsbot/token")
6
6
  )
7
7
  end
8
8
 
9
9
  stage "Build" do
10
10
  # in parallel
11
11
  codebuild(
12
+ "terraspace-all",
12
13
  "terraspace-aws",
13
14
  "terraspace-azurerm",
14
15
  "terraspace-google",
data/CHANGELOG.md CHANGED
@@ -3,6 +3,37 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [2.0.0] - 2022-06-10
7
+ * Terraspace Cloud Support
8
+
9
+ Highlights:
10
+ * Record updates to Terraspace Cloud API
11
+ * CI plugin support
12
+ * CI plugin generator
13
+ * VCS manual support in core for github, gitlab, bitbucket
14
+
15
+ More:
16
+ * Backend expander variables handle env vars in general
17
+ * Remove config.build.cache_root option
18
+ * Clean up Terraspace::Plugin.autodetect
19
+ * cloud.record = "changes". dont create cloud record when no changes
20
+ * ci generic
21
+ * edge case TS_ENV=''
22
+ * .cody/cloud test
23
+ * cloud warning message when TS_TOKEN is confiugred but cloud is not yet
24
+ * API expodential retry logic
25
+ * plugin autodetect cleanup
26
+ * TS_EXTRA in favor of instance option, deprecate instance option
27
+ * handle ctrl-c
28
+ * improve acceptannce codebuild scripts
29
+
30
+ ## [1.1.7] - 2022-02-22
31
+ - [#215](https://github.com/boltops-tools/terraspace/pull/215) fix all down by building child nodes
32
+ - [#216](https://github.com/boltops-tools/terraspace/pull/216) add codebuild project with acceptance test for terraspace all
33
+
34
+ ## [1.1.6] - 2022-02-21
35
+ - [#213](https://github.com/boltops-tools/terraspace/pull/213) ability to show layers for debugging
36
+
6
37
  ## [1.1.5] - 2022-02-21
7
38
  - [#212](https://github.com/boltops-tools/terraspace/pull/212) ability to show layers for debugging
8
39
  - show layers for debugging with logger level debug and TS_SHOW_ALL_LAYERS=1
data/exe/terraspace CHANGED
@@ -1,12 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # Trap ^C
4
- Signal.trap("INT") {
5
- puts "\nCtrl-C detected. Exiting..."
6
- sleep 0.1
7
- exit
8
- }
9
-
10
3
  $:.unshift(File.expand_path("../../lib", __FILE__))
11
4
  require "terraspace"
12
5
  require "terraspace/cli"
@@ -1,4 +1,7 @@
1
1
  # Docs: https://terraspace.cloud/docs/config/reference/
2
2
  Terraspace.configure do |config|
3
3
  config.logger.level = :info
4
+
5
+ # config.cloud.org = "ORG" # replace with your org. only letters, numbers, underscore and dashes allowed
6
+ # config.cloud.project = "main" # optional. main is the default project name. only letters, numbers, underscore and dashes allowed
4
7
  end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/<%= gem_name %>/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "<%= gem_name %>"
7
+ spec.version = <%= gem_class_name %>::VERSION
8
+ spec.authors = ["Author Name"]
9
+ spec.email = ["example@email.com"]
10
+
11
+ spec.summary = "Terraspace CI <%= name %> support"
12
+ spec.homepage = "https://github.com/ORG/<%= gem_name %>"
13
+ spec.license = "MIT"
14
+ spec.required_ruby_version = ">= 2.6.0"
15
+
16
+ spec.metadata["homepage_uri"] = spec.homepage
17
+ spec.metadata["source_code_uri"] = "https://github.com/ORG/<%= gem_name %>"
18
+ spec.metadata["changelog_uri"] = "https://github.com/ORG/<%= gem_name %>/blob/master/CHANGELOG.md"
19
+
20
+ # Specify which files should be added to the gem when it is released.
21
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
+ spec.files = Dir.chdir(__dir__) do
23
+ `git ls-files -z`.split("\x0").reject do |f|
24
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
25
+ end
26
+ end
27
+ spec.bindir = "exe"
28
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ["lib"]
30
+
31
+ spec.add_dependency "zeitwerk"
32
+ end
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /Gemfile.lock
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+
11
+ # rspec failure tracking
12
+ .rspec_status
File without changes
@@ -0,0 +1,13 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - <%= Time.now.strftime("%Y-%m-%d") %>
4
+
5
+ - Initial release
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in gemspec
6
+ gemspec
7
+
8
+ gem "rake"
9
+ gem "rspec"
10
+ gem "rubocop"
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,19 @@
1
+ # <%= gem_name %>
2
+
3
+ Provides Terraspace CI support for <%= name %>.
4
+
5
+ ## Installation
6
+
7
+ Add gem to your Terraspace project
8
+
9
+ Gemfile
10
+
11
+ gem <%= gem_name %>
12
+
13
+ Then to install run
14
+
15
+ bundle
16
+
17
+ ## Contributing
18
+
19
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ORG/<%= gem_name %>/
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,23 @@
1
+ require "zeitwerk"
2
+
3
+ module <%= gem_class_name %>
4
+ class Autoloader
5
+ class Inflector < Zeitwerk::Inflector
6
+ def camelize(basename, _abspath)
7
+ map = { version: "VERSION" }
8
+ map[basename.to_sym] || super
9
+ end
10
+ end
11
+
12
+ class << self
13
+ def setup
14
+ loader = Zeitwerk::Loader.new
15
+ loader.inflector = Inflector.new
16
+ loader.push_dir(File.dirname(__dir__)) # lib
17
+ loader.log! if ENV["<%= gem_name.underscore.upcase %>_AUTOLOAD_LOG"]
18
+ loader.setup
19
+ end
20
+ end
21
+ end
22
+ end
23
+
@@ -0,0 +1,15 @@
1
+ module <%= gem_class_name %>
2
+ class Interface
3
+ # required interface
4
+ def vars
5
+ Vars.new.data
6
+ end
7
+ <% if @options[:pr] %>
8
+ # optional interface
9
+ # uncomment to use
10
+ def comment(url)
11
+ Pr.new.comment(url)
12
+ end
13
+ <% end -%>
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ module <%= gem_class_name %>
2
+ class Pr
3
+ # Implement this method.
4
+ # Method should update existing comment instead of always creating new comment.
5
+ # Otherwise it gets noisy.
6
+ # Remember to also uncomment out the definition in
7
+ #
8
+ # <%= gem_class_name %>::Interface#comment(url)
9
+ #
10
+ # If CI system does not support PRs and comments. Can delete this class entirely.
11
+ #
12
+ def comment(url)
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,26 @@
1
+ module <%= gem_class_name %>
2
+ class Vars
3
+ # Interface method. Hash of properties to be stored
4
+ # Usually available from env vars.
5
+ # Provide as many CI system as possible.
6
+ def data
7
+ {
8
+ build_system: "REPLACE_ME",
9
+ host: ENV['REPLACE_ME'],
10
+ full_repo: ENV['REPLACE_ME'],
11
+ branch_name: ENV['REPLACE_ME'],
12
+ # urls
13
+ pr_url: ENV['REPLACE_ME'],
14
+ build_url: ENV['REPLACE_ME'],
15
+ # additional properties
16
+ build_type: ENV['REPLACE_ME'],
17
+ pr_number: ENV['REPLACE_ME'],
18
+ sha: ENV['REPLACE_ME'],
19
+ # additional properties
20
+ commit_message: ENV['REPLACE_ME'],
21
+ build_id: ENV['REPLACE_ME'],
22
+ build_number: ENV['REPLACE_ME'],
23
+ }
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module <%= gem_class_name %>
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "<%= gem_name %>/autoloader"
4
+ <%= gem_class_name %>::Autoloader.setup
5
+
6
+ require "json"
7
+
8
+ module <%= gem_class_name %>
9
+ class Error < StandardError; end
10
+ end
11
+
12
+ Terraspace::Cloud::Ci.register(
13
+ name: "<%= name %>",
14
+ env_key: "<%= name.upcase %>", # IMPORTANT: Env var used for CI detection. Probably have to change.
15
+ root: __dir__,
16
+ # exe: "bin", # terraspace new ci NAME generator will make files in this folder executable
17
+ )
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.describe TerraspaceCiGithub do
4
+ it "has a version number" do
5
+ expect(TerraspaceCiGithub::VERSION).not_to be nil
6
+ end
7
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "<%= gem_name %>"
4
+
5
+ RSpec.configure do |config|
6
+ # Enable flags like --only-failures and --next-failure
7
+ config.example_status_persistence_file_path = ".rspec_status"
8
+
9
+ # Disable RSpec exposing methods globally on `Module` and `main`
10
+ config.disable_monkey_patching!
11
+
12
+ config.expect_with :rspec do |c|
13
+ c.syntax = :expect
14
+ end
15
+ end
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
File without changes
File without changes
File without changes
File without changes