kite 0.2.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +130 -66
  3. data/LICENSE.md +202 -0
  4. data/README.md +35 -11
  5. data/bin/concourse/out +16 -20
  6. data/docs/kite-concourse-resource.md +45 -0
  7. data/kite.gemspec +1 -0
  8. data/lib/kite.rb +3 -1
  9. data/lib/kite/cloud.rb +1 -0
  10. data/lib/kite/core.rb +8 -2
  11. data/lib/kite/generate.rb +12 -46
  12. data/lib/kite/helpers.rb +0 -72
  13. data/lib/kite/helpers/concourse.rb +3 -2
  14. data/lib/kite/module.rb +76 -0
  15. data/lib/kite/terraform.rb +45 -0
  16. data/lib/kite/version.rb +1 -1
  17. data/tpl/aws/environment/main.tf.tt +5 -0
  18. data/tpl/aws/environment/s3.tf.tt +13 -0
  19. data/tpl/gcp/environment/gcs.tf.tt +18 -0
  20. data/tpl/gcp/environment/main.tf.tt +5 -0
  21. data/tpl/gcp/environment/outputs.tf.tt +5 -0
  22. data/tpl/service/%output_path%/pipelines/review.yml.tt +55 -37
  23. data/tpl/service/%output_path%/pipelines/tasks/create-pull-requests-tag.yml.tt +1 -1
  24. data/tpl/service/%output_path%/pipelines/tasks/create-repository-tag.yml.tt +1 -1
  25. data/tpl/service/%output_path%/pipelines/tasks/run-unit.yml.tt +7 -0
  26. data/tpl/service/Makefile.tt +11 -7
  27. data/tpl/service/docs/getting-started.md +73 -0
  28. data/tpl/service/docs/service.md +101 -0
  29. data/tpl/skel/Gemfile.tt +0 -9
  30. data/tpl/skel/config/cloud.yml +11 -66
  31. metadata +29 -88
  32. data/lib/kite/render.rb +0 -116
  33. data/tpl/aws/README.md +0 -52
  34. data/tpl/aws/bin/base/bootstrap.sh +0 -35
  35. data/tpl/aws/bin/base/cleanup.sh.tt +0 -19
  36. data/tpl/aws/bin/base/set-env.sh.tt +0 -7
  37. data/tpl/aws/bin/base/setup-tunnel.sh.tt +0 -4
  38. data/tpl/aws/bin/bosh-install.sh.tt +0 -23
  39. data/tpl/aws/bin/concourse-deploy.sh.tt +0 -14
  40. data/tpl/aws/bin/ingress-deploy.sh.tt +0 -7
  41. data/tpl/aws/bin/ingress-update.sh.tt +0 -7
  42. data/tpl/aws/bin/kops-delete.sh.erb +0 -5
  43. data/tpl/aws/bin/kops-deploy.sh.erb +0 -11
  44. data/tpl/aws/bin/oauth-deploy.sh.tt +0 -17
  45. data/tpl/aws/bin/prometheus-deploy.sh.tt +0 -23
  46. data/tpl/aws/bin/vault-deploy.sh.tt +0 -10
  47. data/tpl/aws/bosh-vars.yml.erb +0 -12
  48. data/tpl/aws/config/oauth.yml +0 -59
  49. data/tpl/aws/deployments/bosh/bosh.yml +0 -144
  50. data/tpl/aws/deployments/bosh/cloud-config.yml.tt +0 -86
  51. data/tpl/aws/deployments/bosh/cpi.yml +0 -98
  52. data/tpl/aws/deployments/bosh/jumpbox-user.yml +0 -27
  53. data/tpl/aws/deployments/concourse/concourse.yml.tt +0 -98
  54. data/tpl/aws/deployments/ingress/ingress.yml.erb +0 -78
  55. data/tpl/aws/deployments/oauth/oauth.yml.tt +0 -95
  56. data/tpl/aws/deployments/prometheus/monitor-bosh.yml +0 -518
  57. data/tpl/aws/deployments/prometheus/monitor-kubernetes.yml +0 -30
  58. data/tpl/aws/deployments/prometheus/prometheus.yml.tt +0 -184
  59. data/tpl/aws/deployments/vault/vault.yml.erb +0 -38
  60. data/tpl/aws/docs/bosh.md +0 -31
  61. data/tpl/aws/docs/concourse.md +0 -41
  62. data/tpl/aws/docs/ingress.md +0 -14
  63. data/tpl/aws/docs/kops.md +0 -35
  64. data/tpl/aws/docs/oauth.md +0 -24
  65. data/tpl/aws/docs/prometheus.md +0 -31
  66. data/tpl/aws/docs/vault.md +0 -35
  67. data/tpl/aws/terraform/kite_bucket.tf +0 -8
  68. data/tpl/aws/terraform/main.tf.tt +0 -36
  69. data/tpl/aws/terraform/network.tf.tt +0 -252
  70. data/tpl/aws/terraform/outputs.tf +0 -19
  71. data/tpl/aws/terraform/terraform.tfvars.tt +0 -21
  72. data/tpl/aws/terraform/variables.tf +0 -73
  73. data/tpl/gcp/README.md +0 -54
  74. data/tpl/gcp/bin/base/bootstrap.sh +0 -35
  75. data/tpl/gcp/bin/base/cleanup.sh.tt +0 -20
  76. data/tpl/gcp/bin/base/set-env.sh.tt +0 -10
  77. data/tpl/gcp/bin/base/setup-tunnel.sh.tt +0 -13
  78. data/tpl/gcp/bin/bosh-install.sh.tt +0 -22
  79. data/tpl/gcp/bin/concourse-deploy.sh.tt +0 -14
  80. data/tpl/gcp/bin/ingress-deploy.sh.tt +0 -7
  81. data/tpl/gcp/bin/ingress-update.sh.tt +0 -7
  82. data/tpl/gcp/bin/oauth-deploy.sh.tt +0 -19
  83. data/tpl/gcp/bin/prometheus-deploy.sh.tt +0 -23
  84. data/tpl/gcp/bin/vault-deploy.sh.tt +0 -10
  85. data/tpl/gcp/bosh-vars.yml.erb +0 -9
  86. data/tpl/gcp/config/oauth.yml +0 -59
  87. data/tpl/gcp/deployments/bosh/bosh.yml +0 -144
  88. data/tpl/gcp/deployments/bosh/cloud-config.yml.tt +0 -73
  89. data/tpl/gcp/deployments/bosh/cpi.yml +0 -69
  90. data/tpl/gcp/deployments/bosh/jumpbox-user.yml +0 -27
  91. data/tpl/gcp/deployments/concourse/concourse.yml.tt +0 -104
  92. data/tpl/gcp/deployments/concourse/test/test-credentials.yml +0 -3
  93. data/tpl/gcp/deployments/concourse/test/test-pipeline.yml +0 -24
  94. data/tpl/gcp/deployments/ingress/ingress.yml.erb +0 -111
  95. data/tpl/gcp/deployments/oauth/oauth.yml.tt +0 -95
  96. data/tpl/gcp/deployments/prometheus/monitor-bosh.yml +0 -518
  97. data/tpl/gcp/deployments/prometheus/monitor-kubernetes.yml +0 -30
  98. data/tpl/gcp/deployments/prometheus/prometheus.yml +0 -183
  99. data/tpl/gcp/deployments/vault/vault.yml.erb +0 -37
  100. data/tpl/gcp/docs/bosh.md +0 -36
  101. data/tpl/gcp/docs/concourse.md +0 -41
  102. data/tpl/gcp/docs/ingress.md +0 -12
  103. data/tpl/gcp/docs/oauth.md +0 -24
  104. data/tpl/gcp/docs/prometheus.md +0 -27
  105. data/tpl/gcp/docs/vault.md +0 -36
  106. data/tpl/gcp/terraform/gcs.tf.tt +0 -18
  107. data/tpl/gcp/terraform/main.tf +0 -70
  108. data/tpl/gcp/terraform/network.tf +0 -52
  109. data/tpl/gcp/terraform/outputs.tf +0 -7
  110. data/tpl/gcp/terraform/terraform.tfvars.tt +0 -15
  111. data/tpl/gcp/terraform/variables.tf +0 -37
  112. data/tpl/service/%output_path%/pipelines/tasks/helm-deploy.yml.tt +0 -22
  113. data/tpl/service/%output_path%/pipelines/tasks/run-master-tests.yml.tt +0 -12
  114. data/tpl/service/%output_path%/pipelines/tasks/run-pr-tests.yml.tt +0 -12
  115. data/tpl/skel/docs/index.md.tt +0 -0
  116. data/tpl/skel/docs/quickstart.md.tt +0 -0
data/lib/kite/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kite
2
- VERSION = "0.2.0"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -0,0 +1,5 @@
1
+ provider "aws" {
2
+ region = "<%= @cloud['region'] %>"
3
+ access_key = "<%= @cloud['aws']['access_key'] %>"
4
+ secret_key = "<%= @cloud['aws']['secret_key'] %>"
5
+ }
@@ -0,0 +1,13 @@
1
+ # Create a bucket for kite purposes
2
+ resource "aws_s3_bucket" "kite_bucket" {
3
+ bucket_prefix = "<%= @cloud['aws']['bucket_name'] %>"
4
+
5
+ tags {
6
+ Name = "<%= @cloud['aws']['bucket_name'] %>"
7
+ Component = "kite-stack"
8
+ }
9
+ }
10
+
11
+ output "bucket_name" {
12
+ value = "${aws_s3_bucket.kite_bucket.id}"
13
+ }
@@ -0,0 +1,18 @@
1
+ # Setup Terraform GCS backend to be able to store .tfstate remotely
2
+ terraform {
3
+ backend "gcs" {
4
+ bucket = "<%= @cloud['gcp']['bucket_name'] %>"
5
+ prefix = "<%= @env_name %>-terraform.tfstate"
6
+ project = "<%= @cloud['gcp']['project'] %>"
7
+ }
8
+ }
9
+
10
+ # Store .tfstate in a GCS bucket
11
+ data "terraform_remote_state" "tfstate" {
12
+ backend = "gcs"
13
+ config {
14
+ bucket = "<%= @cloud['gcp']['bucket_name'] %>"
15
+ path = "<%= @env_name %>-terraform.tfstate"
16
+ project = "<%= @cloud['gcp']['project'] %>"
17
+ }
18
+ }
@@ -0,0 +1,5 @@
1
+ provider "google" {
2
+ credentials = "${file("<%= @cloud['gcp']['service_account'] %>")}"
3
+ project = "<%= @cloud['gcp']['project'] %>"
4
+ region = "<%= @cloud['region'] %>"
5
+ }
@@ -0,0 +1,5 @@
1
+ output service_account_b64 {
2
+ description = "GCloud service account key"
3
+ value = "${base64encode(file("<%= @cloud['gcp']['service_account'] %>"))}"
4
+ sensitive = true
5
+ }
@@ -12,7 +12,19 @@ resource_types:
12
12
  source:
13
13
  repository: jtarchie/pr
14
14
 
15
+ - name: kite
16
+ type: docker-image
17
+ source:
18
+ repository: heliostech/kite
19
+ tag: v0.2.0
20
+
15
21
  resources:
22
+ - name: k8s
23
+ type: kite
24
+ source:
25
+ json_key: ((gcr_password))
26
+ kubeconfig: ((kubeconfig))
27
+
16
28
  - name: <%= @name %>-repository
17
29
  type: git
18
30
  source:
@@ -68,7 +80,8 @@ jobs:
68
80
  path: pull-requests
69
81
  status: pending
70
82
  - task: run-tests
71
- file: pull-requests/<%= @output %>/pipelines/tasks/run-pr-tests.yml
83
+ image: <%= @name %>-image
84
+ file: pull-requests/<%= @output %>/pipelines/tasks/run-unit.yml
72
85
  on_success:
73
86
  do:
74
87
  - put: pull-requests
@@ -119,16 +132,18 @@ jobs:
119
132
  params:
120
133
  build: <%= @name %>-repository
121
134
  tag: tag/name
122
- <% unless @slack.nil? or @slack.empty? -%>
123
- - put: slack-alert
124
- params:
125
- channel: '#<%= @slack %>'
126
- text: |
127
- <%= @name %> master branch was built and pushed!
128
- Check it out at:
129
- $ATC_EXTERNAL_URL/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME
130
- or at:
131
- $ATC_EXTERNAL_URL/builds/$BUILD_ID
135
+ <% unless @slack.to_s.empty? -%>
136
+ on_success:
137
+ try:
138
+ put: slack-alert
139
+ params:
140
+ channel: '#<%= @slack %>'
141
+ text: |
142
+ <%= @name %> master branch was built and pushed!
143
+ Check it out at:
144
+ $ATC_EXTERNAL_URL/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME
145
+ or at:
146
+ $ATC_EXTERNAL_URL/builds/$BUILD_ID
132
147
  <% end -%>
133
148
 
134
149
  - name: master-unit
@@ -141,18 +156,20 @@ jobs:
141
156
  passed: [master-build]
142
157
  trigger: true
143
158
  - task: run-tests
144
- file: <%= @name %>-repository/<%= @output %>/pipelines/tasks/run-master-tests.yml
145
- <% unless @slack.nil? or @slack.empty? -%>
159
+ image: <%= @name %>-image
160
+ file: <%= @name %>-repository/<%= @output %>/pipelines/tasks/run-unit.yml
161
+ <% unless @slack.to_s.empty? -%>
146
162
  on_success:
147
- put: slack-alert
148
- params:
149
- channel: '#<%= @slack %>'
150
- text: |
151
- <%= @name %> master tests have passed! :thumbsup_all:
152
- Check it out at:
153
- $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME
154
- or at:
155
- $ATC_EXTERNAL_URL/builds/$BUILD_ID
163
+ try:
164
+ put: slack-alert
165
+ params:
166
+ channel: '#<%= @slack %>'
167
+ text: |
168
+ <%= @name %> master tests have passed! :thumbsup_all:
169
+ Check it out at:
170
+ $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME
171
+ or at:
172
+ $ATC_EXTERNAL_URL/builds/$BUILD_ID
156
173
 
157
174
  on_failure:
158
175
  put: slack-alert
@@ -166,24 +183,25 @@ jobs:
166
183
  $ATC_EXTERNAL_URL/builds/$BUILD_ID
167
184
  <% end -%>
168
185
 
169
- - name: helm-deploy
186
+ - name: master-deploy
170
187
  serial: true
171
188
  plan:
172
189
  - get: <%= @name %>-repository
173
- - task: helm-deploy
174
- file: <%= @name %>-repository/<%= @output %>/pipelines/tasks/helm-deploy.yml
190
+ passed: [master-unit]
191
+ trigger: true
192
+ - put: k8s
175
193
  params:
176
- GOOGLE_APPLICATION_JSON: ((gcr_password))
177
- KUBECONFIG_FILE: ((kubeconfig))
178
- <% unless @slack.nil? or @slack.empty? -%>
194
+ command: "bash -xc 'cd /tmp/build/put/<%= @name %>-repository && VERSION=$(git rev-parse --short=8 HEAD) make deploy'"
195
+ <% unless @slack.to_s.empty? -%>
179
196
  on_success:
180
- put: slack-alert
181
- params:
182
- channel: '#<%= @slack %>'
183
- text: |
184
- <%= @name %> deployment has succeeded! :thumbsup_all:
185
- Check it out at:
186
- $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME
187
- or at:
188
- $ATC_EXTERNAL_URL/builds/$BUILD_ID
197
+ try:
198
+ put: slack-alert
199
+ params:
200
+ channel: '#<%= @slack %>'
201
+ text: |
202
+ <%= @name %> deployment has succeeded! :thumbsup_all:
203
+ Check it out at:
204
+ $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME
205
+ or at:
206
+ $ATC_EXTERNAL_URL/builds/$BUILD_ID
189
207
  <% end -%>
@@ -3,7 +3,7 @@ platform: linux
3
3
  image_resource:
4
4
  type: docker-image
5
5
  source:
6
- repository: alpine/git
6
+ repository: heliostech/kite
7
7
  run:
8
8
  path: sh
9
9
  args: ['-xc', 'cd pull-requests && git rev-parse --short=8 HEAD > ../tag/name']
@@ -3,7 +3,7 @@ platform: linux
3
3
  image_resource:
4
4
  type: docker-image
5
5
  source:
6
- repository: alpine/git
6
+ repository: heliostech/kite
7
7
  run:
8
8
  path: sh
9
9
  args: ['-xc', 'cd <%= @name %>-repository && git rev-parse --short=8 HEAD > ../tag/name']
@@ -0,0 +1,7 @@
1
+ ---
2
+ platform: linux
3
+
4
+ run:
5
+ path: sh
6
+ args: ["-exc", "cd /app && npm test"]
7
+
@@ -1,12 +1,16 @@
1
- VERSION := $(shell cat VERSION)
1
+ VERSION ?= $(shell cat VERSION)
2
+ ENV ?= staging
3
+ SERVICE := <%= @name %>
2
4
  IMAGE := <%= @image %>:$(VERSION)
5
+ CURRENT_CONTEXT := $(shell kubectl config current-context)
3
6
 
4
7
  .PHONY: default build push run ci deploy
5
8
 
6
9
  default: build run
7
10
 
8
11
  build:
9
- @echo '> Building "<%= @name %>" docker image...'
12
+ @echo '> Using ENV: $(ENV) and context: $(CURRENT_CONTEXT)'
13
+ @echo '> Building "$(SERVICE)" docker image...'
10
14
  @docker build -t $(IMAGE) .
11
15
 
12
16
  push: build
@@ -17,12 +21,12 @@ push: build
17
21
  <% end -%>
18
22
 
19
23
  run:
20
- @echo '> Starting "<%= @name %>" container...'
24
+ @echo '> Starting "$(SERVICE)" container...'
21
25
  @docker run -d $(IMAGE)
22
26
 
23
27
  ci:
24
- @fly -t ci set-pipeline -p <%= @name %> -c <%= @output %>/pipelines/review.yml -n
25
- @fly -t ci unpause-pipeline -p <%= @name %>
28
+ @fly -t ci set-pipeline -p $(SERVICE) -c <%= @output %>/pipelines/review.yml -n
29
+ @fly -t ci unpause-pipeline -p $(SERVICE)
26
30
 
27
- deploy: push
28
- @helm install ./<%= @output %>/charts/<%= @name %> --set "image.tag=$(VERSION)"
31
+ deploy:
32
+ @helm install ./<%= @output %>/charts/$(SERVICE) --set "image.tag=$(VERSION)"
@@ -0,0 +1,73 @@
1
+ # Prerequisites
2
+
3
+ You should have these packages installed:
4
+
5
+ 1. [Kubernetes](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
6
+
7
+ - Download the binary for your OS
8
+ - Unzip it and run `chmod +x kubectl && sudo mv kubectl /usr/local/bin/kubectl`
9
+ - Check if the kubectl is installed by running `kubectl version`
10
+
11
+ 2. [Vault](https://www.vaultproject.io/docs/install/index.html)
12
+
13
+ - Download the binary for your OS
14
+ - Unzip it and run `chmod +x vault && sudo mv vault /usr/local/bin/vault`
15
+ - Check if the Vault is installed by running `vault -v`
16
+
17
+ 3. [Google Cloud SDK](https://cloud.google.com/sdk/downloads)
18
+
19
+ - Enter the following at a command prompt: `curl https://sdk.cloud.google.com | bash`
20
+ - Restart your shell: `exec -l $SHELL`
21
+ - Run gcloud init to initialize the gcloud environment: `gcloud init`
22
+
23
+ 4. [Helm](https://github.com/kubernetes/helm/blob/master/docs/install.md)
24
+
25
+ - Download the binary for your OS
26
+ - Unzip it and run `chmod +x helm && sudo mv helm /usr/local/bin/helm`
27
+ - Check if the Helm is installed by running `helm version`
28
+
29
+ 5. [Concourse](https://github.com/concourse/fly)
30
+
31
+ - Download the binary for your OS
32
+ - Unzip it and run `chmod +x fly && sudo mv fly /usr/local/bin/fly`
33
+ - Check if the fly is installed by running `fly -v`
34
+
35
+ ## Usage
36
+
37
+ 1. Run your Docker image locally with `make run`
38
+
39
+ 2. Push the Docker image to the registry using `make push`, so that Concourse and Kubernetes can fetch the image when needed
40
+
41
+ 3. Deploy the Concourse pipeline using `make ci`, this will create and unpause a new pipeline named by your service.
42
+ To further configure your pipeline, edit the `*output_dir*/pipelines/review.yml`
43
+
44
+ 4. To add/change/delete Vault secrets to use in the pipeline, run
45
+ ```shell
46
+ export VAULT_ADDR=https://vault.example.com
47
+ vault write concourse/<team>/<secret> value=<value> # save secret to storage
48
+ vault read concourse/<team>/<secret> # read value of secret
49
+ vault delete concourse/<team>/<secret> # delete secret
50
+ ```
51
+
52
+ 5. Deploy the helm chart using `make deploy`.
53
+
54
+ Charts are basically Kubernetes config files which can be used as templates, packaged and easily distributed.
55
+
56
+ To deploy a Helm chart you only need the template files(`*output_dir*/charts/*service_name*/templates`)
57
+ and the values for them(`*output_dir*/charts/*service_name*/values.yaml`).
58
+ Values can be specified either from command line by using `helm install *chart* --set "optionFoo=bar"`
59
+ or from a file by using `helm install *chart* -f *values-prod.yml*`
60
+
61
+ `make deploy` command runs
62
+ `helm install ./*output_dir*/charts/*service_name* --set "image.tag=$(VERSION)"`
63
+ which installs this service's helm charts with current Docker image tag specified
64
+
65
+ To list the deployed Helm charts, use `helm ls`
66
+
67
+ To apply changes made to the chart, use `helm upgrade *deployment name* *output_dir*/charts/*service_name*`
68
+
69
+ To access your deployment locally:
70
+ - Get pod name `export POD_NAME=$(kubectl get pods --namespace default -l "app=<%= @name %>,release=elder-ibis" -o jsonpath="{.items[0].metadata.name}")`
71
+ - Port-forward the pod to localhost `kubectl port-forward $POD_NAME *local_port*:*image_port*`
72
+ - Visit http://127.0.0.1:*port* to use your application
73
+ - See current status of deployments `kubectl get deployments`, pods `kubectl get pods`, services `kubectl get service`
@@ -0,0 +1,101 @@
1
+ # Kite Generate Service
2
+
3
+ ```shell
4
+ kite generate service NAME --git=GIT --image=IMAGE
5
+ ```
6
+
7
+ ## Description
8
+
9
+ Creates __folder__, which contains:
10
+
11
+ - `VERSION`
12
+ - `docs/pipeline.md`
13
+ - `Dockerfile`
14
+ - `Makefile`
15
+ - `config/`
16
+
17
+ ### VERSION
18
+ This file contains current __version__ of your project.
19
+
20
+ ### docs/pipeline.md
21
+ Created basic __documentation__ with explanation of generated concourse pipeline.
22
+
23
+ ### Dockerfile
24
+ Kite generates default `Dockerfile` with nginx.
25
+
26
+ *Example:*
27
+
28
+ ```dockerfile
29
+ FROM nginx:1.13
30
+ # MAINTAINER Some Name <email@test.com>
31
+
32
+ RUN echo "Hello, Test!" > /usr/share/nginx/html/index.html
33
+ ```
34
+
35
+ ### Makefile
36
+ Kite generates `Makefile` for easy run, push, deploy, and manage kite generated pipeline.
37
+
38
+ *Example:*
39
+
40
+ ```makefile
41
+ VERSION := $(shell cat VERSION)
42
+ IMAGE := eu.gcr.io/test-production/test:$(VERSION)
43
+
44
+ .PHONY: default build push run ci deploy
45
+
46
+ default: build run
47
+
48
+ build:
49
+ @echo '> Building "test" docker image...'
50
+ @docker build -t $(IMAGE) .
51
+
52
+ push: build
53
+ docker push $(IMAGE)
54
+
55
+ run:
56
+ @echo '> Starting "test" container...'
57
+ @docker run -d $(IMAGE)
58
+
59
+ ci:
60
+ @fly -t ci set-pipeline -p test -c config/pipelines/review.yml -n
61
+ @fly -t ci unpause-pipeline -p test
62
+
63
+ deploy:
64
+ @helm install ./config/charts/test --set "image.tag=$(VERSION)"
65
+ ```
66
+
67
+ ### Config
68
+
69
+ Kite generates subfolder with stuff for helm chart and concourse pipeline.
70
+
71
+ You can __configure__ folder name with `--output NAME`.
72
+
73
+ By default it called `config/`. We recommend you to use name `.kite/`.
74
+
75
+ # Getting started with kite generate service
76
+
77
+ Lets start from basic command.
78
+
79
+ Kite have three __required__ parameters:
80
+
81
+ - `service name`
82
+ - `--image IMAGE`
83
+ - `--git LINK`
84
+
85
+ You can use `http` or `ssh` link to git repository.
86
+ You can use Docker Hub, GCP Container Registry, etc as path to your docker image.
87
+
88
+ *Example:*
89
+
90
+ ```shell
91
+ kite generate service test --git ssh@github.com:example/test.git --image eu.gcr.io/test-project/test-image
92
+ ```
93
+
94
+ Kite have __6 optional__ parameters:
95
+
96
+ - `--name=NAME` Name of the service
97
+ - `--output=OUTPUT` Config output sub-directory
98
+ - `--slack=SLACK` Slack notifications
99
+ - `--provider=PROVIDER` Cloud provider (AWS, GCP)
100
+ - `--image-version=IMAGE_VERSION` Docker image tag, defualt 0.1.0
101
+ - `--chart-version=CHART_VERSION` Chart version, default 0.1.0
data/tpl/skel/Gemfile.tt CHANGED
@@ -1,12 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'kite', '~> <%= Kite::VERSION %>'
4
-
5
- # Use AWS
6
- # gem 'aws-sdk', '~> 2'
7
-
8
- # Use GCP
9
- # gem 'google-cloud'
10
-
11
- # Use Jekyll
12
- # gem 'jekyll'