kite 0.2.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +130 -66
- data/LICENSE.md +202 -0
- data/README.md +35 -11
- data/bin/concourse/out +16 -20
- data/docs/kite-concourse-resource.md +45 -0
- data/kite.gemspec +1 -0
- data/lib/kite.rb +3 -1
- data/lib/kite/cloud.rb +1 -0
- data/lib/kite/core.rb +8 -2
- data/lib/kite/generate.rb +12 -46
- data/lib/kite/helpers.rb +0 -72
- data/lib/kite/helpers/concourse.rb +3 -2
- data/lib/kite/module.rb +76 -0
- data/lib/kite/terraform.rb +45 -0
- data/lib/kite/version.rb +1 -1
- data/tpl/aws/environment/main.tf.tt +5 -0
- data/tpl/aws/environment/s3.tf.tt +13 -0
- data/tpl/gcp/environment/gcs.tf.tt +18 -0
- data/tpl/gcp/environment/main.tf.tt +5 -0
- data/tpl/gcp/environment/outputs.tf.tt +5 -0
- data/tpl/service/%output_path%/pipelines/review.yml.tt +55 -37
- data/tpl/service/%output_path%/pipelines/tasks/create-pull-requests-tag.yml.tt +1 -1
- data/tpl/service/%output_path%/pipelines/tasks/create-repository-tag.yml.tt +1 -1
- data/tpl/service/%output_path%/pipelines/tasks/run-unit.yml.tt +7 -0
- data/tpl/service/Makefile.tt +11 -7
- data/tpl/service/docs/getting-started.md +73 -0
- data/tpl/service/docs/service.md +101 -0
- data/tpl/skel/Gemfile.tt +0 -9
- data/tpl/skel/config/cloud.yml +11 -66
- metadata +29 -88
- data/lib/kite/render.rb +0 -116
- data/tpl/aws/README.md +0 -52
- data/tpl/aws/bin/base/bootstrap.sh +0 -35
- data/tpl/aws/bin/base/cleanup.sh.tt +0 -19
- data/tpl/aws/bin/base/set-env.sh.tt +0 -7
- data/tpl/aws/bin/base/setup-tunnel.sh.tt +0 -4
- data/tpl/aws/bin/bosh-install.sh.tt +0 -23
- data/tpl/aws/bin/concourse-deploy.sh.tt +0 -14
- data/tpl/aws/bin/ingress-deploy.sh.tt +0 -7
- data/tpl/aws/bin/ingress-update.sh.tt +0 -7
- data/tpl/aws/bin/kops-delete.sh.erb +0 -5
- data/tpl/aws/bin/kops-deploy.sh.erb +0 -11
- data/tpl/aws/bin/oauth-deploy.sh.tt +0 -17
- data/tpl/aws/bin/prometheus-deploy.sh.tt +0 -23
- data/tpl/aws/bin/vault-deploy.sh.tt +0 -10
- data/tpl/aws/bosh-vars.yml.erb +0 -12
- data/tpl/aws/config/oauth.yml +0 -59
- data/tpl/aws/deployments/bosh/bosh.yml +0 -144
- data/tpl/aws/deployments/bosh/cloud-config.yml.tt +0 -86
- data/tpl/aws/deployments/bosh/cpi.yml +0 -98
- data/tpl/aws/deployments/bosh/jumpbox-user.yml +0 -27
- data/tpl/aws/deployments/concourse/concourse.yml.tt +0 -98
- data/tpl/aws/deployments/ingress/ingress.yml.erb +0 -78
- data/tpl/aws/deployments/oauth/oauth.yml.tt +0 -95
- data/tpl/aws/deployments/prometheus/monitor-bosh.yml +0 -518
- data/tpl/aws/deployments/prometheus/monitor-kubernetes.yml +0 -30
- data/tpl/aws/deployments/prometheus/prometheus.yml.tt +0 -184
- data/tpl/aws/deployments/vault/vault.yml.erb +0 -38
- data/tpl/aws/docs/bosh.md +0 -31
- data/tpl/aws/docs/concourse.md +0 -41
- data/tpl/aws/docs/ingress.md +0 -14
- data/tpl/aws/docs/kops.md +0 -35
- data/tpl/aws/docs/oauth.md +0 -24
- data/tpl/aws/docs/prometheus.md +0 -31
- data/tpl/aws/docs/vault.md +0 -35
- data/tpl/aws/terraform/kite_bucket.tf +0 -8
- data/tpl/aws/terraform/main.tf.tt +0 -36
- data/tpl/aws/terraform/network.tf.tt +0 -252
- data/tpl/aws/terraform/outputs.tf +0 -19
- data/tpl/aws/terraform/terraform.tfvars.tt +0 -21
- data/tpl/aws/terraform/variables.tf +0 -73
- data/tpl/gcp/README.md +0 -54
- data/tpl/gcp/bin/base/bootstrap.sh +0 -35
- data/tpl/gcp/bin/base/cleanup.sh.tt +0 -20
- data/tpl/gcp/bin/base/set-env.sh.tt +0 -10
- data/tpl/gcp/bin/base/setup-tunnel.sh.tt +0 -13
- data/tpl/gcp/bin/bosh-install.sh.tt +0 -22
- data/tpl/gcp/bin/concourse-deploy.sh.tt +0 -14
- data/tpl/gcp/bin/ingress-deploy.sh.tt +0 -7
- data/tpl/gcp/bin/ingress-update.sh.tt +0 -7
- data/tpl/gcp/bin/oauth-deploy.sh.tt +0 -19
- data/tpl/gcp/bin/prometheus-deploy.sh.tt +0 -23
- data/tpl/gcp/bin/vault-deploy.sh.tt +0 -10
- data/tpl/gcp/bosh-vars.yml.erb +0 -9
- data/tpl/gcp/config/oauth.yml +0 -59
- data/tpl/gcp/deployments/bosh/bosh.yml +0 -144
- data/tpl/gcp/deployments/bosh/cloud-config.yml.tt +0 -73
- data/tpl/gcp/deployments/bosh/cpi.yml +0 -69
- data/tpl/gcp/deployments/bosh/jumpbox-user.yml +0 -27
- data/tpl/gcp/deployments/concourse/concourse.yml.tt +0 -104
- data/tpl/gcp/deployments/concourse/test/test-credentials.yml +0 -3
- data/tpl/gcp/deployments/concourse/test/test-pipeline.yml +0 -24
- data/tpl/gcp/deployments/ingress/ingress.yml.erb +0 -111
- data/tpl/gcp/deployments/oauth/oauth.yml.tt +0 -95
- data/tpl/gcp/deployments/prometheus/monitor-bosh.yml +0 -518
- data/tpl/gcp/deployments/prometheus/monitor-kubernetes.yml +0 -30
- data/tpl/gcp/deployments/prometheus/prometheus.yml +0 -183
- data/tpl/gcp/deployments/vault/vault.yml.erb +0 -37
- data/tpl/gcp/docs/bosh.md +0 -36
- data/tpl/gcp/docs/concourse.md +0 -41
- data/tpl/gcp/docs/ingress.md +0 -12
- data/tpl/gcp/docs/oauth.md +0 -24
- data/tpl/gcp/docs/prometheus.md +0 -27
- data/tpl/gcp/docs/vault.md +0 -36
- data/tpl/gcp/terraform/gcs.tf.tt +0 -18
- data/tpl/gcp/terraform/main.tf +0 -70
- data/tpl/gcp/terraform/network.tf +0 -52
- data/tpl/gcp/terraform/outputs.tf +0 -7
- data/tpl/gcp/terraform/terraform.tfvars.tt +0 -15
- data/tpl/gcp/terraform/variables.tf +0 -37
- data/tpl/service/%output_path%/pipelines/tasks/helm-deploy.yml.tt +0 -22
- data/tpl/service/%output_path%/pipelines/tasks/run-master-tests.yml.tt +0 -12
- data/tpl/service/%output_path%/pipelines/tasks/run-pr-tests.yml.tt +0 -12
- data/tpl/skel/docs/index.md.tt +0 -0
- data/tpl/skel/docs/quickstart.md.tt +0 -0
data/lib/kite/version.rb
CHANGED
|
@@ -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
|
+
}
|
|
@@ -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
|
-
|
|
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.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
-
|
|
145
|
-
|
|
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
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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:
|
|
186
|
+
- name: master-deploy
|
|
170
187
|
serial: true
|
|
171
188
|
plan:
|
|
172
189
|
- get: <%= @name %>-repository
|
|
173
|
-
|
|
174
|
-
|
|
190
|
+
passed: [master-unit]
|
|
191
|
+
trigger: true
|
|
192
|
+
- put: k8s
|
|
175
193
|
params:
|
|
176
|
-
|
|
177
|
-
|
|
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
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
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 -%>
|
data/tpl/service/Makefile.tt
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
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 '>
|
|
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 "
|
|
24
|
+
@echo '> Starting "$(SERVICE)" container...'
|
|
21
25
|
@docker run -d $(IMAGE)
|
|
22
26
|
|
|
23
27
|
ci:
|
|
24
|
-
@fly -t ci set-pipeline -p
|
|
25
|
-
@fly -t ci unpause-pipeline -p
|
|
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:
|
|
28
|
-
@helm install ./<%= @output %>/charts
|
|
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
|