-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kite new; now render a generic project skeleton
Moved code into a genrate commands, next should be made modular
- v1.1.7
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.0
- v0.0.9
- v0.0.8
- v0.0.7
- v0.0.6
- v0.0.5
- v0.0.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.18
- 1.1.17
- 1.1.16
- 1.1.15
- 1.1.14
- 1.1.13
- 1.1.12
- 1.1.11
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
Louis Bellet
committed
Aug 25, 2017
1 parent
08b0ccc
commit 9229e67
Showing
15 changed files
with
149 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
require "erb" | ||
require "yaml" | ||
require "thor" | ||
require 'erb' | ||
require 'yaml' | ||
require 'thor' | ||
|
||
require "kite/version" | ||
require "kite/helpers" | ||
require "kite/commands" | ||
require 'kite/version' | ||
require 'kite/helpers' | ||
|
||
require 'kite/base' | ||
require 'kite/core' | ||
require 'kite/cloud' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class Kite::Base < Thor | ||
|
||
include Thor::Actions | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class Kite::Cloud | ||
|
||
def initialize(core, cloud_name) | ||
@core = core | ||
@name = cloud_name | ||
@core.destination_root = nil | ||
end | ||
|
||
def name | ||
@name | ||
end | ||
|
||
def core | ||
@core | ||
end | ||
|
||
def prepare | ||
core.directory('skel', name) | ||
core.inside(name) do | ||
core.chmod('bin/kite', 0755) | ||
end | ||
end | ||
|
||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
module Kite | ||
class Core < Base | ||
|
||
include Kite::Helpers | ||
|
||
def self.source_root | ||
File.expand_path(File.join(File.dirname(__FILE__), "../../tpl")) | ||
end | ||
|
||
method_option :cloud, type: :string, desc: "Cloud provider", enum: %w{aws gcp} | ||
desc "new CLOUD_PATH", "Generate Cloud infrastructure skeleton from configuration" | ||
def new(cloud_name) | ||
target = Kite::Cloud.new(self, cloud_name) | ||
target.prepare | ||
end | ||
|
||
method_option :cloud, type: :string, desc: "Cloud provider", enum: %w{aws gcp}, required: true | ||
desc "generate", "Generate Cloud IaC from configuration" | ||
def generate() | ||
say "Generating Cloud #{ options[:cloud] } IaC", :green | ||
@values = YAML.load(File.read('config/cloud.yml')) | ||
|
||
case options[:cloud] | ||
when "aws" | ||
copy_file("aws/bin/make_cloud_config.sh", "bin/make_cloud_config.sh") | ||
copy_file("aws/bin/make_manifest_bosh-init.sh", "bin/make_manifest_bosh-init.sh") | ||
copy_file("aws/bin/make_manifest_concourse-cluster.sh", "bin/make_manifest_concourse-cluster.sh") | ||
|
||
copy_file("aws/terraform/aws-concourse.tf", "terraform/aws-concourse.tf") | ||
copy_file("aws/terraform/aws-vault.tf", "terraform/aws-vault.tf") | ||
copy_file("aws/terraform/bosh-aws-base.tf", "terraform/bosh-aws-base.tf") | ||
copy_file("aws/terraform/outputs.tf", "terraform/outputs.tf") | ||
copy_file("aws/terraform/variables.tf", "terraform/variables.tf") | ||
copy_file("aws/terraform/variables.tf", "terraform/variables.tf") | ||
|
||
template("aws/env.example.erb", ".env") | ||
copy_file("aws/README.md", "README.md") | ||
copy_file("aws/bootstrap.sh", "bootstrap.sh") | ||
|
||
when "gcp" | ||
template("gcp/manifest.yml.erb", "manifest.yml") | ||
template("gcp/cloud-config.yml.erb", "cloud-config.yml") | ||
copy_file("gcp/concourse.yml.erb", "concourse.yml") | ||
copy_file("gcp/README.md", "README.md") | ||
directory("gcp/scripts", "scripts") | ||
copy_file("gcp/INSTALL.md", "INSTALL.md") | ||
template("gcp/env.example.erb", ".env") | ||
copy_file("gcp/main.tf", "main.tf") | ||
copy_file("gcp/concourse.tf", "concourse.tf") | ||
else | ||
say "Cloud provider not specified" | ||
|
||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'kite', '~> <%= Kite::VERSION %>' | ||
|
||
# Use AWS | ||
# gem 'aws-sdk', '~> 2' | ||
|
||
# Use GCP | ||
# gem 'google-cloud' | ||
|
||
# Use Jekyll | ||
# gem 'jekyll' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# <%=@cloud_name %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env ruby | ||
require "thor" | ||
|
||
$: << File.join(File.dirname(__FILE__), "../lib") | ||
require 'kite' | ||
|
||
Kite::Core.start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
aws: | ||
access_key_id: "XXXXXXXXXXXXXX" | ||
secret_access_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | ||
region: "us-east-1" | ||
az: "us-east-1a" | ||
bosh_password: "bosh_password" | ||
keypair_name: "bosh" | ||
private_key_path: "~/Downloads/bosh.pem" | ||
db_password: "database_password" | ||
ci_dns_zone_id: "XXXXXXXXXXXXX" | ||
ci_hostname: "ci.example.com" | ||
concourse_url: "http://ci.example.com" | ||
concourse_auth_username: "concourse" | ||
concourse_auth_password: "concourse" | ||
|
||
gcp: | ||
project_id: gcp-project | ||
region: europe-west1 | ||
zone: europe-west1-b | ||
service_account: bosh | ||
ssh_key_path: ~/.ssh/bosh | ||
|
||
bosh: | ||
bosh_password: "bosh_password" | ||
keypair_name: "bosh" | ||
private_key_path: "~/Downloads/bosh.pem" | ||
db_password: "database_password" | ||
|
||
concourse: | ||
hostname: "ci.domain.io" | ||
dns_zone: "your_dns_zone_id" | ||
url: "http://ci.example.com" | ||
auth_username: "concourse" | ||
auth_password: "concourse" |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.