kite 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,24 @@
1
+ #!/bin/bash
2
+
3
+ if [ ! -f /tmp/terraform-bosh.key.json ]; then
4
+ gcloud iam service-accounts create terraform-bosh
5
+
6
+ gcloud iam service-accounts keys create /tmp/terraform-bosh.key.json \
7
+ --iam-account ${service_account_email}
8
+
9
+ gcloud projects add-iam-policy-binding ${projectid} \
10
+ --member serviceAccount:${service_account_email} \
11
+ --role roles/owner
12
+ fi
13
+
14
+ export GOOGLE_CREDENTIALS=$(cat /tmp/terraform-bosh.key.json)
15
+
16
+ docker run -i -t \
17
+ -e "GOOGLE_CREDENTIALS=${GOOGLE_CREDENTIALS}" \
18
+ -v `pwd`:/$(basename `pwd`) \
19
+ -w /$(basename `pwd`) \
20
+ hashicorp/terraform:light apply \
21
+ -var service_account_email=${service_account_email} \
22
+ -var projectid=${projectid} \
23
+ -var region=${region} \
24
+ -var zone-1=${zone}
@@ -0,0 +1,35 @@
1
+ #!/bin/bash
2
+
3
+ zone=$(curl -s -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/zone)
4
+ export zone=${zone##*/}
5
+ export region=${zone%-*}
6
+ gcloud config set compute/zone ${zone}
7
+ gcloud config set compute/region ${region}
8
+ export project_id=`curl -s -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/project/project-id`
9
+
10
+ if [ ! -f ~/.ssh/bosh ]; then
11
+ ssh-keygen -t rsa -f ~/.ssh/bosh -C bosh
12
+
13
+ echo "------------------~/.ssh/bosh.pub------------------"
14
+ cat ~/.ssh/bosh.pub
15
+ echo "---------------------------------------------------"
16
+
17
+ echo "Navigate to your project's web console and add the new SSH public key by pasting the contents of ~/.ssh/bosh.pub:"
18
+ read -p "Press [Enter] to continue..."
19
+ fi
20
+
21
+ export ssh_key_path=$HOME/.ssh/bosh
22
+
23
+ while ! bosh-init -v; do
24
+ echo "bosh-init is not ready yet..."
25
+ sleep 5
26
+ done
27
+
28
+ mkdir google-bosh-director
29
+ cd google-bosh-director
30
+
31
+ cp ~/gcp/manifest.yml manifest.yml
32
+
33
+ bosh-init deploy manifest.yml
34
+
35
+ bosh target 10.0.0.6
@@ -0,0 +1,29 @@
1
+ #!/bin/bash
2
+
3
+ zone=$(curl -s -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/zone)
4
+ export zone=${zone##*/}
5
+ export region=${zone%-*}
6
+ gcloud config set compute/zone ${zone}
7
+ gcloud config set compute/region ${region}
8
+ export project_id=`curl -s -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/project/project-id`
9
+
10
+ export ssh_key_path=$HOME/.ssh/bosh
11
+
12
+ bosh upload stemcell https://bosh.io/d/stemcells/bosh-google-kvm-ubuntu-trusty-go_agent?v=3263.8
13
+
14
+ bosh upload release https://bosh.io/d/github.com/concourse/concourse?v=2.5.0
15
+ bosh upload release https://bosh.io/d/github.com/cloudfoundry/garden-runc-release?v=1.0.3
16
+
17
+ export external_ip=`gcloud compute addresses describe concourse | grep ^address: | cut -f2 -d' '`
18
+ export director_uuid=`bosh status --uuid 2>/dev/null`
19
+
20
+ openssl rand -base64 16 > ~/common_password
21
+ cp ~/common_password ~/atc_password
22
+
23
+ export common_password=$(cat ~/common_password)
24
+ export atc_password=$(cat ~/atc_password)
25
+
26
+ bosh update cloud-config ~/gcp/cloud-config.yml
27
+
28
+ bosh deployment ~/gcp/concourse.yml
29
+ bosh deploy
@@ -0,0 +1,6 @@
1
+ #!/bin/bash
2
+
3
+ bosh delete deployment concourse
4
+
5
+ cd ~/google-bosh-director
6
+ bosh-init delete manifest.yml
@@ -0,0 +1,23 @@
1
+ export projectid=helios-devel
2
+ export region=europe-west1
3
+ export zone=europe-west1-b
4
+ export service_account_email=terraform-bosh@${projectid}.iam.gserviceaccount.com
5
+
6
+ export GOOGLE_CREDENTIALS=$(cat /tmp/terraform-bosh.key.json)
7
+
8
+ docker run -i -t \
9
+ -e "GOOGLE_CREDENTIALS=${GOOGLE_CREDENTIALS}" \
10
+ -v `pwd`:/$(basename `pwd`) \
11
+ -w /$(basename `pwd`) \
12
+ hashicorp/terraform:light destroy \
13
+ -var service_account_email=${service_account_email} \
14
+ -var projectid=${projectid} \
15
+ -var region=${region} \
16
+ -var zone-1=${zone}
17
+
18
+ gcloud projects remove-iam-policy-binding ${projectid} \
19
+ --member serviceAccount:${service_account_email} \
20
+ --role roles/owner
21
+
22
+ gcloud iam service-accounts delete ${service_account_email}
23
+ rm /tmp/terraform-bosh.key.json
@@ -0,0 +1,22 @@
1
+ #!/bin/bash
2
+
3
+ source .env
4
+
5
+ if ! gcloud auth list | grep @heliostech.fr; then
6
+ gcloud auth login
7
+ fi
8
+
9
+ gcloud config set project ${projectid}
10
+ gcloud config set compute/zone ${zone}
11
+ gcloud config set compute/region ${region}
12
+
13
+ source scripts/01_create_infrastructure.sh
14
+
15
+ # ${bastion_vm_name} ssh timeout
16
+ sleep 10
17
+
18
+ gcloud compute scp --scp-flag=-r . ${bastion_vm_name}:$HOME/gcp
19
+
20
+ gcloud compute ssh ${bastion_vm_name} -- source gcp/scripts/02_deploy_director.sh
21
+
22
+ gcloud compute ssh ${bastion_vm_name} -- source gcp/scripts/03_deploy_concourse.sh
@@ -0,0 +1,16 @@
1
+ #!/bin/bash
2
+
3
+ source .env
4
+
5
+ if ! gcloud auth list | grep @heliostech.fr; then
6
+ gcloud auth login
7
+ gcloud config set project ${projectid}
8
+ gcloud config set compute/zone ${zone}
9
+ gcloud config set compute/region ${region}
10
+ fi
11
+
12
+ gcloud compute scp --scp-flag=-r . ${bastion_vm_name}:$HOME/gcp
13
+
14
+ gcloud compute ssh ${bastion_vm_name} -- source gcp/scripts/04_delete_director.sh
15
+
16
+ source scripts/05_delete_infrastructure.sh
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Louis Bellet
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2017-08-24 00:00:00.000000000 Z
12
12
  dependencies:
@@ -69,7 +69,10 @@ dependencies:
69
69
  description: Kite is a bootstraping tool for your cloud provider and long term administration.
70
70
  email:
71
71
  - lbellet@heliostech.fr
72
- executables: []
72
+ executables:
73
+ - kite
74
+ - kite-config
75
+ - kite-console
73
76
  extensions: []
74
77
  extra_rdoc_files: []
75
78
  files:
@@ -79,11 +82,41 @@ files:
79
82
  - Gemfile
80
83
  - README.md
81
84
  - Rakefile
82
- - bin/console
83
- - bin/setup
85
+ - bin/kite
86
+ - bin/kite-config
87
+ - bin/kite-console
84
88
  - kite.gemspec
85
89
  - lib/kite.rb
90
+ - lib/kite/commands.rb
91
+ - lib/kite/helpers.rb
86
92
  - lib/kite/version.rb
93
+ - tpl/aws/README.md
94
+ - tpl/aws/bin/make_cloud_config.sh
95
+ - tpl/aws/bin/make_manifest_bosh-init.sh
96
+ - tpl/aws/bin/make_manifest_concourse-cluster.sh
97
+ - tpl/aws/bootstrap.sh
98
+ - tpl/aws/env.example.erb
99
+ - tpl/aws/terraform/aws-concourse.tf
100
+ - tpl/aws/terraform/aws-vault.tf
101
+ - tpl/aws/terraform/bosh-aws-base.tf
102
+ - tpl/aws/terraform/outputs.tf
103
+ - tpl/aws/terraform/terraform.tfvars.erb
104
+ - tpl/aws/terraform/variables.tf
105
+ - tpl/gcp/INSTALL.md
106
+ - tpl/gcp/README.md
107
+ - tpl/gcp/cloud-config.yml.erb
108
+ - tpl/gcp/concourse.tf
109
+ - tpl/gcp/concourse.yml.erb
110
+ - tpl/gcp/env.example.erb
111
+ - tpl/gcp/main.tf
112
+ - tpl/gcp/manifest.yml.erb
113
+ - tpl/gcp/scripts/01_create_infrastructure.sh
114
+ - tpl/gcp/scripts/02_deploy_director.sh
115
+ - tpl/gcp/scripts/03_deploy_concourse.sh
116
+ - tpl/gcp/scripts/04_delete_director.sh
117
+ - tpl/gcp/scripts/05_delete_infrastructure.sh
118
+ - tpl/gcp/scripts/bootstrap.sh
119
+ - tpl/gcp/scripts/delete.sh
87
120
  homepage: http://www.heliostech.fr
88
121
  licenses: []
89
122
  metadata: {}