kite 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/kite +1 -1
- data/lib/kite.rb +9 -6
- data/lib/kite/base.rb +5 -0
- data/lib/kite/cloud.rb +24 -0
- data/lib/kite/core.rb +56 -0
- data/lib/kite/version.rb +1 -1
- data/tpl/skel/Gemfile.tt +12 -0
- data/tpl/skel/README.md.tt +1 -0
- data/tpl/skel/bin/kite +7 -0
- data/tpl/skel/config/cloud.yml +34 -0
- data/tpl/skel/docs/index.md.tt +0 -0
- data/tpl/skel/docs/quickstart.md.tt +0 -0
- data/tpl/skel/lib/tasks/.keep +0 -0
- data/tpl/skel/log/.keep +0 -0
- data/tpl/skel/tmp/.keep +0 -0
- metadata +14 -3
- data/lib/kite/commands.rb +0 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35907f92cd177fd33f70eb0bc63657862c640bc7
|
4
|
+
data.tar.gz: 06e20e23873eafdc2c5f9def0d1877a8bbfbb243
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e39367feaa741376f65874369ff4ba2e1a2fd25ea412fcee9e32b47ee153506ca04eb309b45fc33439f0cfa7cf97e16895424a933ae578875e13ea50439d80cb
|
7
|
+
data.tar.gz: a710b0698232d8110005af89d5cec87d9ecc5b87088227118bd9c7507bfa72033a528a5dddb0d38d91c52ff7007d0cb135e326ea69aec3d446433c168249cff5
|
data/bin/kite
CHANGED
data/lib/kite.rb
CHANGED
@@ -1,7 +1,10 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require 'erb'
|
2
|
+
require 'yaml'
|
3
|
+
require 'thor'
|
4
4
|
|
5
|
-
require
|
6
|
-
require
|
7
|
-
|
5
|
+
require 'kite/version'
|
6
|
+
require 'kite/helpers'
|
7
|
+
|
8
|
+
require 'kite/base'
|
9
|
+
require 'kite/core'
|
10
|
+
require 'kite/cloud'
|
data/lib/kite/base.rb
ADDED
data/lib/kite/cloud.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
class Kite::Cloud
|
2
|
+
|
3
|
+
def initialize(core, cloud_name)
|
4
|
+
@core = core
|
5
|
+
@name = cloud_name
|
6
|
+
@core.destination_root = nil
|
7
|
+
end
|
8
|
+
|
9
|
+
def name
|
10
|
+
@name
|
11
|
+
end
|
12
|
+
|
13
|
+
def core
|
14
|
+
@core
|
15
|
+
end
|
16
|
+
|
17
|
+
def prepare
|
18
|
+
core.directory('skel', name)
|
19
|
+
core.inside(name) do
|
20
|
+
core.chmod('bin/kite', 0755)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
data/lib/kite/core.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
module Kite
|
2
|
+
class Core < Base
|
3
|
+
|
4
|
+
include Kite::Helpers
|
5
|
+
|
6
|
+
def self.source_root
|
7
|
+
File.expand_path(File.join(File.dirname(__FILE__), "../../tpl"))
|
8
|
+
end
|
9
|
+
|
10
|
+
method_option :cloud, type: :string, desc: "Cloud provider", enum: %w{aws gcp}
|
11
|
+
desc "new CLOUD_PATH", "Generate Cloud infrastructure skeleton from configuration"
|
12
|
+
def new(cloud_name)
|
13
|
+
target = Kite::Cloud.new(self, cloud_name)
|
14
|
+
target.prepare
|
15
|
+
end
|
16
|
+
|
17
|
+
method_option :cloud, type: :string, desc: "Cloud provider", enum: %w{aws gcp}, required: true
|
18
|
+
desc "generate", "Generate Cloud IaC from configuration"
|
19
|
+
def generate()
|
20
|
+
say "Generating Cloud #{ options[:cloud] } IaC", :green
|
21
|
+
@values = YAML.load(File.read('config/cloud.yml'))
|
22
|
+
|
23
|
+
case options[:cloud]
|
24
|
+
when "aws"
|
25
|
+
copy_file("aws/bin/make_cloud_config.sh", "bin/make_cloud_config.sh")
|
26
|
+
copy_file("aws/bin/make_manifest_bosh-init.sh", "bin/make_manifest_bosh-init.sh")
|
27
|
+
copy_file("aws/bin/make_manifest_concourse-cluster.sh", "bin/make_manifest_concourse-cluster.sh")
|
28
|
+
|
29
|
+
copy_file("aws/terraform/aws-concourse.tf", "terraform/aws-concourse.tf")
|
30
|
+
copy_file("aws/terraform/aws-vault.tf", "terraform/aws-vault.tf")
|
31
|
+
copy_file("aws/terraform/bosh-aws-base.tf", "terraform/bosh-aws-base.tf")
|
32
|
+
copy_file("aws/terraform/outputs.tf", "terraform/outputs.tf")
|
33
|
+
copy_file("aws/terraform/variables.tf", "terraform/variables.tf")
|
34
|
+
copy_file("aws/terraform/variables.tf", "terraform/variables.tf")
|
35
|
+
|
36
|
+
template("aws/env.example.erb", ".env")
|
37
|
+
copy_file("aws/README.md", "README.md")
|
38
|
+
copy_file("aws/bootstrap.sh", "bootstrap.sh")
|
39
|
+
|
40
|
+
when "gcp"
|
41
|
+
template("gcp/manifest.yml.erb", "manifest.yml")
|
42
|
+
template("gcp/cloud-config.yml.erb", "cloud-config.yml")
|
43
|
+
copy_file("gcp/concourse.yml.erb", "concourse.yml")
|
44
|
+
copy_file("gcp/README.md", "README.md")
|
45
|
+
directory("gcp/scripts", "scripts")
|
46
|
+
copy_file("gcp/INSTALL.md", "INSTALL.md")
|
47
|
+
template("gcp/env.example.erb", ".env")
|
48
|
+
copy_file("gcp/main.tf", "main.tf")
|
49
|
+
copy_file("gcp/concourse.tf", "concourse.tf")
|
50
|
+
else
|
51
|
+
say "Cloud provider not specified"
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
data/lib/kite/version.rb
CHANGED
data/tpl/skel/Gemfile.tt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# <%=@cloud_name %>
|
data/tpl/skel/bin/kite
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
aws:
|
2
|
+
access_key_id: "XXXXXXXXXXXXXX"
|
3
|
+
secret_access_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
4
|
+
region: "us-east-1"
|
5
|
+
az: "us-east-1a"
|
6
|
+
bosh_password: "bosh_password"
|
7
|
+
keypair_name: "bosh"
|
8
|
+
private_key_path: "~/Downloads/bosh.pem"
|
9
|
+
db_password: "database_password"
|
10
|
+
ci_dns_zone_id: "XXXXXXXXXXXXX"
|
11
|
+
ci_hostname: "ci.example.com"
|
12
|
+
concourse_url: "http://ci.example.com"
|
13
|
+
concourse_auth_username: "concourse"
|
14
|
+
concourse_auth_password: "concourse"
|
15
|
+
|
16
|
+
gcp:
|
17
|
+
project_id: gcp-project
|
18
|
+
region: europe-west1
|
19
|
+
zone: europe-west1-b
|
20
|
+
service_account: bosh
|
21
|
+
ssh_key_path: ~/.ssh/bosh
|
22
|
+
|
23
|
+
bosh:
|
24
|
+
bosh_password: "bosh_password"
|
25
|
+
keypair_name: "bosh"
|
26
|
+
private_key_path: "~/Downloads/bosh.pem"
|
27
|
+
db_password: "database_password"
|
28
|
+
|
29
|
+
concourse:
|
30
|
+
hostname: "ci.domain.io"
|
31
|
+
dns_zone: "your_dns_zone_id"
|
32
|
+
url: "http://ci.example.com"
|
33
|
+
auth_username: "concourse"
|
34
|
+
auth_password: "concourse"
|
File without changes
|
File without changes
|
File without changes
|
data/tpl/skel/log/.keep
ADDED
File without changes
|
data/tpl/skel/tmp/.keep
ADDED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Louis Bellet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -87,7 +87,9 @@ files:
|
|
87
87
|
- bin/kite-console
|
88
88
|
- kite.gemspec
|
89
89
|
- lib/kite.rb
|
90
|
-
- lib/kite/
|
90
|
+
- lib/kite/base.rb
|
91
|
+
- lib/kite/cloud.rb
|
92
|
+
- lib/kite/core.rb
|
91
93
|
- lib/kite/helpers.rb
|
92
94
|
- lib/kite/version.rb
|
93
95
|
- tpl/aws/README.md
|
@@ -117,6 +119,15 @@ files:
|
|
117
119
|
- tpl/gcp/scripts/05_delete_infrastructure.sh
|
118
120
|
- tpl/gcp/scripts/bootstrap.sh
|
119
121
|
- tpl/gcp/scripts/delete.sh
|
122
|
+
- tpl/skel/Gemfile.tt
|
123
|
+
- tpl/skel/README.md.tt
|
124
|
+
- tpl/skel/bin/kite
|
125
|
+
- tpl/skel/config/cloud.yml
|
126
|
+
- tpl/skel/docs/index.md.tt
|
127
|
+
- tpl/skel/docs/quickstart.md.tt
|
128
|
+
- tpl/skel/lib/tasks/.keep
|
129
|
+
- tpl/skel/log/.keep
|
130
|
+
- tpl/skel/tmp/.keep
|
120
131
|
homepage: http://www.heliostech.fr
|
121
132
|
licenses: []
|
122
133
|
metadata: {}
|
data/lib/kite/commands.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
class Kite::Commands < Thor
|
2
|
-
include Thor::Actions
|
3
|
-
include Kite::Helpers
|
4
|
-
|
5
|
-
def self.source_root
|
6
|
-
File.expand_path(File.join(File.dirname(__FILE__), "../.."))
|
7
|
-
end
|
8
|
-
|
9
|
-
method_option :values, type: :string, default: "defaults.yml", required: true
|
10
|
-
method_option :cloud, type: :string, desc: "Cloud supplier", enum: %w{aws gcp}, required: true
|
11
|
-
desc "new CLOUDNAME", "Generate Cloud IaC from configuration"
|
12
|
-
def new(cloud_name)
|
13
|
-
say "Generating Cloud #{ cloud_name } IaC", :green
|
14
|
-
@values = YAML.load(File.read(options[:values]))
|
15
|
-
|
16
|
-
case options[:cloud]
|
17
|
-
when "aws"
|
18
|
-
copy_file("tpl/aws/bin/make_cloud_config.sh", "#{cloud_name}/bin/make_cloud_config.sh")
|
19
|
-
copy_file("tpl/aws/bin/make_manifest_bosh-init.sh", "#{cloud_name}/bin/make_manifest_bosh-init.sh")
|
20
|
-
copy_file("tpl/aws/bin/make_manifest_concourse-cluster.sh", "#{cloud_name}/bin/make_manifest_concourse-cluster.sh")
|
21
|
-
|
22
|
-
copy_file("tpl/aws/terraform/aws-concourse.tf", "#{cloud_name}/terraform/aws-concourse.tf")
|
23
|
-
copy_file("tpl/aws/terraform/aws-vault.tf", "#{cloud_name}/terraform/aws-vault.tf")
|
24
|
-
copy_file("tpl/aws/terraform/bosh-aws-base.tf", "#{cloud_name}/terraform/bosh-aws-base.tf")
|
25
|
-
copy_file("tpl/aws/terraform/outputs.tf", "#{cloud_name}/terraform/outputs.tf")
|
26
|
-
template("tpl/aws/terraform/terraform.tfvars.erb", "#{cloud_name}/terraform/terraform.tfvars")
|
27
|
-
copy_file("tpl/aws/terraform/variables.tf", "#{cloud_name}/terraform/variables.tf")
|
28
|
-
copy_file("tpl/aws/terraform/variables.tf", "#{cloud_name}/terraform/variables.tf")
|
29
|
-
|
30
|
-
template("tpl/aws/env.example.erb", "#{cloud_name}/.env")
|
31
|
-
copy_file("tpl/aws/README.md", "#{cloud_name}/README.md")
|
32
|
-
copy_file("tpl/aws/bootstrap.sh", "#{cloud_name}/bootstrap.sh")
|
33
|
-
|
34
|
-
when "gcp"
|
35
|
-
template("tpl/gcp/manifest.yml.erb", "#{cloud_name}/manifest.yml")
|
36
|
-
template("tpl/gcp/cloud-config.yml.erb", "#{cloud_name}/cloud-config.yml")
|
37
|
-
copy_file("tpl/gcp/concourse.yml.erb", "#{cloud_name}/concourse.yml")
|
38
|
-
copy_file("tpl/gcp/README.md", "#{cloud_name}/README.md")
|
39
|
-
directory("tpl/gcp/scripts", "#{cloud_name}/scripts")
|
40
|
-
copy_file("tpl/gcp/INSTALL.md", "#{cloud_name}/INSTALL.md")
|
41
|
-
template("tpl/gcp/env.example.erb", "#{cloud_name}/.env")
|
42
|
-
copy_file("tpl/gcp/main.tf", "#{cloud_name}/main.tf")
|
43
|
-
copy_file("tpl/gcp/concourse.tf", "#{cloud_name}/concourse.tf")
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|