terraspace 1.1.6 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.cody/all/bin/build.sh +33 -0
- data/.cody/all/buildspec.yml +10 -0
- data/.cody/{aws/role.rb → all/iam_role.rb} +0 -0
- data/.cody/all/project.rb +6 -0
- data/.cody/aws/bin/build.sh +5 -0
- data/.cody/aws/iam_role.rb +6 -0
- data/.cody/aws/project.rb +6 -2
- data/.cody/azurerm/bin/build.sh +5 -0
- data/.cody/azurerm/{role.rb → iam_role.rb} +0 -0
- data/.cody/azurerm/project.rb +5 -3
- data/.cody/google/bin/build.sh +5 -0
- data/.cody/google/{role.rb → iam_role.rb} +0 -0
- data/.cody/google/project.rb +5 -3
- data/.cody/none/bin/build.sh +5 -0
- data/.cody/none/{role.rb → iam_role.rb} +0 -0
- data/.cody/none/project.rb +6 -2
- data/.cody/shared/script/install/terraform.sh +2 -1
- data/.cody/shared/script/update/gemfile.sh +2 -0
- data/.cody/unit/project.rb +2 -2
- data/.gitignore +2 -0
- data/.pipedream/pipeline.rb +4 -3
- data/CHANGELOG.md +30 -0
- data/exe/terraspace +0 -7
- data/lib/templates/base/project/config/app.rb +3 -0
- data/lib/templates/plugin/ci/%gem_name%.gemspec.tt +32 -0
- data/lib/templates/plugin/ci/.gitignore +12 -0
- data/lib/templates/plugin/{.rspec → ci/.rspec} +0 -0
- data/lib/templates/plugin/ci/.rubocop.yml +13 -0
- data/lib/templates/plugin/ci/CHANGELOG.md.tt +5 -0
- data/lib/templates/plugin/ci/Gemfile +10 -0
- data/lib/templates/plugin/ci/LICENSE.txt +21 -0
- data/lib/templates/plugin/ci/README.md.tt +19 -0
- data/lib/templates/plugin/ci/Rakefile +12 -0
- data/lib/templates/plugin/ci/lib/%gem_name%/autoloader.rb.tt +23 -0
- data/lib/templates/plugin/ci/lib/%gem_name%/interface.rb.tt +15 -0
- data/lib/templates/plugin/ci/lib/%gem_name%/pr.rb.tt +15 -0
- data/lib/templates/plugin/ci/lib/%gem_name%/vars.rb.tt +26 -0
- data/lib/templates/plugin/ci/lib/%gem_name%/version.rb.tt +5 -0
- data/lib/templates/plugin/ci/lib/%gem_name%.rb.tt +17 -0
- data/lib/templates/plugin/ci/spec/%gem_name%_spec.rb.tt +7 -0
- data/lib/templates/plugin/ci/spec/spec_helper.rb.tt +15 -0
- data/lib/templates/plugin/{.gitignore → core/.gitignore} +0 -0
- data/lib/templates/plugin/core/.rspec +3 -0
- data/lib/templates/plugin/{CHANGELOG.md → core/CHANGELOG.md} +0 -0
- data/lib/templates/plugin/{Gemfile → core/Gemfile} +0 -0
- data/lib/templates/plugin/{LICENSE.txt → core/LICENSE.txt} +0 -0
- data/lib/templates/plugin/{README.md.tt → core/README.md.tt} +0 -0
- data/lib/templates/plugin/{Rakefile → core/Rakefile} +0 -0
- data/lib/templates/plugin/{bin → core/bin}/console.tt +0 -0
- data/lib/templates/plugin/{bin → core/bin}/setup +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/hcl/module/main.tf +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/hcl/module/outputs.tf +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/hcl/module/variables.tf +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/hcl/project/config/terraform/backend.tf.tt +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/hcl/project/config/terraform/provider.tf +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/hcl/stack/main.tf +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/hcl/stack/outputs.tf +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/hcl/stack/variables.tf +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/ruby/module/main.rb +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/ruby/module/outputs.rb +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/ruby/module/variables.rb +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/ruby/project/config/terraform/backend.rb.tt +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/ruby/project/config/terraform/provider.rb +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/ruby/stack/main.rb +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/ruby/stack/outputs.rb +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/ruby/stack/variables.rb +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/.rspec +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/Gemfile +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/spec/fixtures/stack/main.tf +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/spec/fixtures/stack/outputs.tf +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/spec/fixtures/stack/variables.tf +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/spec/main_spec.rb +0 -0
- data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/spec/spec_helper.rb +0 -0
- data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/autoloader.rb.tt +0 -0
- data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/clients.rb.tt +0 -0
- data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/interfaces/backend.rb.tt +0 -0
- data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/interfaces/config.rb.tt +0 -0
- data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/interfaces/expander.rb.tt +0 -0
- data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/interfaces/layer.rb.tt +0 -0
- data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/version.rb.tt +0 -0
- data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%.rb.tt +0 -0
- data/lib/templates/plugin/{spec → core/spec}/spec_helper.rb.tt +0 -0
- data/lib/templates/plugin/{spec → core/spec}/terraspace_provider_%name%_spec.rb.tt +0 -0
- data/lib/templates/plugin/{terraspace_plugin_%name%.gemspec.tt → core/terraspace_plugin_%name%.gemspec.tt} +0 -0
- data/lib/terraspace/all/runner.rb +4 -1
- data/lib/terraspace/all/summary.rb +2 -0
- data/lib/terraspace/app.rb +23 -4
- data/lib/terraspace/builder/children.rb +6 -7
- data/lib/terraspace/builder.rb +8 -2
- data/lib/terraspace/cli/concerns/plan_path.rb +8 -0
- data/lib/terraspace/cli/down.rb +4 -0
- data/lib/terraspace/cli/init.rb +1 -1
- data/lib/terraspace/cli/new/ci.rb +121 -0
- data/lib/terraspace/cli/new/example.rb +1 -1
- data/lib/terraspace/cli/new/helpers/plugin_gem.rb +1 -1
- data/lib/terraspace/cli/new/plugin/ci.rb +46 -0
- data/lib/terraspace/cli/new/plugin/core.rb +26 -0
- data/lib/terraspace/cli/new/plugin/helper.rb +4 -1
- data/lib/terraspace/cli/new/plugin.rb +8 -15
- data/lib/terraspace/cli/new/test.rb +1 -1
- data/lib/terraspace/cli/new.rb +17 -13
- data/lib/terraspace/cli/plan.rb +13 -0
- data/lib/terraspace/cli/setup/check.rb +8 -0
- data/lib/terraspace/cli/up.rb +8 -12
- data/lib/terraspace/cli.rb +2 -2
- data/lib/terraspace/cloud/api/cani.rb +30 -0
- data/lib/terraspace/cloud/api/concern/errors.rb +12 -0
- data/lib/terraspace/cloud/api/concern/record.rb +18 -0
- data/lib/terraspace/cloud/api/concern.rb +38 -0
- data/lib/terraspace/cloud/api/http_methods.rb +116 -0
- data/lib/terraspace/cloud/api/validate.rb +24 -0
- data/lib/terraspace/cloud/api.rb +33 -0
- data/lib/terraspace/cloud/base.rb +97 -0
- data/lib/terraspace/cloud/ci/generic.rb +25 -0
- data/lib/terraspace/cloud/ci/manual.rb +81 -0
- data/lib/terraspace/cloud/ci/vcs/base.rb +36 -0
- data/lib/terraspace/cloud/ci/vcs/bitbucket.rb +11 -0
- data/lib/terraspace/cloud/ci/vcs/github.rb +11 -0
- data/lib/terraspace/cloud/ci/vcs/gitlab.rb +11 -0
- data/lib/terraspace/cloud/ci/vcs.rb +18 -0
- data/lib/terraspace/cloud/ci.rb +56 -0
- data/lib/terraspace/cloud/context.rb +14 -0
- data/lib/terraspace/cloud/folder/base.rb +17 -0
- data/lib/terraspace/cloud/folder/package.rb +33 -0
- data/lib/terraspace/cloud/folder/tidy.rb +54 -0
- data/lib/terraspace/cloud/folder/uploader.rb +37 -0
- data/lib/terraspace/cloud/folder.rb +11 -0
- data/lib/terraspace/cloud/plan.rb +47 -0
- data/lib/terraspace/cloud/update.rb +37 -0
- data/lib/terraspace/command.rb +16 -1
- data/lib/terraspace/compiler/dsl/syntax/mod.rb +2 -2
- data/lib/terraspace/compiler/dsl/syntax/tfvar.rb +1 -1
- data/lib/terraspace/compiler/expander/backend.rb +1 -1
- data/lib/terraspace/compiler/expander.rb +1 -1
- data/lib/terraspace/compiler/strategy/tfvar/layer.rb +56 -29
- data/lib/terraspace/core.rb +36 -3
- data/lib/terraspace/ext/core/module.rb +9 -4
- data/lib/terraspace/hooks/builder.rb +1 -1
- data/lib/terraspace/logger.rb +32 -5
- data/lib/terraspace/mod.rb +21 -9
- data/lib/terraspace/plugin/expander/interface.rb +19 -11
- data/lib/terraspace/plugin.rb +14 -5
- data/lib/terraspace/shell.rb +7 -2
- data/lib/terraspace/terraform/args/thor.rb +8 -2
- data/lib/terraspace/terraform/ihooks/after/apply.rb +8 -0
- data/lib/terraspace/terraform/ihooks/after/destroy.rb +8 -0
- data/lib/terraspace/terraform/ihooks/after/plan.rb +31 -2
- data/lib/terraspace/terraform/ihooks/base.rb +7 -3
- data/lib/terraspace/terraform/ihooks/before/apply.rb +8 -0
- data/lib/terraspace/terraform/ihooks/before/destroy.rb +8 -0
- data/lib/terraspace/terraform/ihooks/before/plan.rb +11 -3
- data/lib/terraspace/terraform/runner.rb +19 -5
- data/lib/terraspace/version.rb +1 -1
- data/lib/terraspace.rb +2 -0
- data/terraspace.gemspec +1 -0
- metadata +119 -51
- data/.pipedream/schedule.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63e85a272438c620049ad889851566afb09872566924895dee994322d65f75f2
|
4
|
+
data.tar.gz: b7f30a83ab50550fca3484eb6e7d58e39334708b5af98cd1d7a0964a24e96df7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18896509755488401183456c7e6888b9d909df0f45a62e164e75b0e746a8775c88fb22da7e4e921d3eb0c5a779631ab7d441827caefa6eaf7c79fe984079140e
|
7
|
+
data.tar.gz: 3993bfcf2cfd81eecef5841957e9b6bb4d12dfbe6a8276d00a96149f3032bf93206e68c7e53cba3171aacd16bfc5e3b1bfcdd6c26fc3c235816105b2ebb93fb8
|
@@ -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
|
File without changes
|
data/.cody/aws/bin/build.sh
CHANGED
@@ -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
|
data/.cody/aws/project.rb
CHANGED
@@ -1,2 +1,6 @@
|
|
1
|
-
|
2
|
-
|
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
|
+
)
|
data/.cody/azurerm/bin/build.sh
CHANGED
@@ -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
|
data/.cody/azurerm/project.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
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
|
)
|
data/.cody/google/bin/build.sh
CHANGED
@@ -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
|
data/.cody/google/project.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
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
|
)
|
data/.cody/none/bin/build.sh
CHANGED
@@ -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
|
data/.cody/none/project.rb
CHANGED
@@ -1,2 +1,6 @@
|
|
1
|
-
|
2
|
-
|
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
|
+
)
|
data/.cody/unit/project.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
github("boltops-tools/terraspace")
|
2
|
+
image("aws/codebuild/amazonlinux2-x86_64-standard:3.0")
|
data/.gitignore
CHANGED
data/.pipedream/pipeline.rb
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
stage "Source" do
|
2
2
|
github(
|
3
|
-
|
4
|
-
#
|
5
|
-
|
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,36 @@
|
|
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.1] - 2022-06-14
|
7
|
+
- [#240](https://github.com/boltops-tools/terraspace/pull/240) add project expander variable
|
8
|
+
|
9
|
+
## [2.0.0] - 2022-06-10
|
10
|
+
* Terraspace Cloud Support
|
11
|
+
|
12
|
+
Highlights:
|
13
|
+
* Record updates to Terraspace Cloud API
|
14
|
+
* CI plugin support
|
15
|
+
* CI plugin generator
|
16
|
+
* VCS manual support in core for github, gitlab, bitbucket
|
17
|
+
* Layering: simplified by removing provider layering by default.
|
18
|
+
* Layering: new default `config.layering.mode = "simple"`. Use `config.layering.mode = "provider"` for v1 behavior.
|
19
|
+
* Layering: easier to debug with config.layering.show
|
20
|
+
* Layering: App, Role, Extra level layering
|
21
|
+
|
22
|
+
More:
|
23
|
+
* Backend expander variables handle env vars in general
|
24
|
+
* Remove config.build.cache_root option
|
25
|
+
* cloud.record = "changes". dont create cloud record when no changes
|
26
|
+
* cloud warning message when TS_TOKEN is confiugred but cloud is not yet
|
27
|
+
* Cloud API expodential retry logic
|
28
|
+
* TS_EXTRA in favor of instance option, deprecate instance option
|
29
|
+
* handle ctrl-c
|
30
|
+
* improve acceptance codebuild scripts
|
31
|
+
|
32
|
+
## [1.1.7] - 2022-02-22
|
33
|
+
- [#215](https://github.com/boltops-tools/terraspace/pull/215) fix all down by building child nodes
|
34
|
+
- [#216](https://github.com/boltops-tools/terraspace/pull/216) add codebuild project with acceptance test for terraspace all
|
35
|
+
|
6
36
|
## [1.1.6] - 2022-02-21
|
7
37
|
- [#213](https://github.com/boltops-tools/terraspace/pull/213) ability to show layers for debugging
|
8
38
|
|
data/exe/terraspace
CHANGED
@@ -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
|
File without changes
|
@@ -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,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 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,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,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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/templates/plugin/{lib → core/lib}/templates/hcl/project/config/terraform/backend.tf.tt
RENAMED
File without changes
|
data/lib/templates/plugin/{lib → core/lib}/templates/hcl/project/config/terraform/provider.tf
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/templates/plugin/{lib → core/lib}/templates/ruby/project/config/terraform/backend.rb.tt
RENAMED
File without changes
|
data/lib/templates/plugin/{lib → core/lib}/templates/ruby/project/config/terraform/provider.rb
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|