kubernetes_helper 1.10.0 → 1.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/kubernetes_helper/version.rb +1 -1
- data/lib/templates/cd.sh +9 -6
- data/lib/templates/deployment.yml +1 -6
- data/lib/templates/settings.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0b83d896c9cffe12e38bd7c7ed4ecf56ed2eaa45836338c00d387655bd4f451
|
4
|
+
data.tar.gz: 9b8e19cb71692e6ea90066c3cb5120786a85e6402e0ae9e156bdbf75d0f3de31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b60c04186e29c3a729244b669385f7614b6812b2bbf5aeb8418a86f739737e56ee1e19e4de9eb202218e763492a76c14b7128a64f702d4a1288b0d8f1a0ffaa
|
7
|
+
data.tar.gz: e39bfd0335359f746ad66f5791f636c056f3749c7abe2405c0e17f72475935bc03a3b7fc41faec095f030cfe8e0b8785a6369eea479953de6e02f8795de76061
|
data/README.md
CHANGED
@@ -54,8 +54,8 @@ it looks for the file inside kubernetes_helper template folder.
|
|
54
54
|
|
55
55
|
## Settings API
|
56
56
|
Below settings are used when running Continuous Deployment
|
57
|
-
- `continuous_deployment.image_name` (String
|
58
|
-
- `continuous_deployment.
|
57
|
+
- `continuous_deployment.image_name` (String): Partial docker image url. Sample: `gcr.io/my-account/my_app_name`
|
58
|
+
- `continuous_deployment.image_tag` (String, default 'latest'): Image tag to be used for this application
|
59
59
|
- `continuous_deployment.project_name`: Cloud project name. Sample: `my-project-name`
|
60
60
|
- `continuous_deployment.cluster_name`: Cluster cluster name. Sample: `my-cluster-name`
|
61
61
|
- `continuous_deployment.cluster_region`: Cluster region name. Sample: `europe-west4-a`
|
data/lib/templates/cd.sh
CHANGED
@@ -15,7 +15,7 @@ DOCKER_BUILD_CMD="<%=continuous_deployment.docker_build_cmd || 'build -f Dockerf
|
|
15
15
|
CI_COMMIT_SHA=$(git rev-parse --verify HEAD || :)
|
16
16
|
CI_COMMIT_SHA=${CI_COMMIT_SHA:-$(date +%s) }
|
17
17
|
DEPLOY_NAME="${IMAGE_NAME}:${CI_COMMIT_SHA}"
|
18
|
-
LATEST_NAME="${IMAGE_NAME}
|
18
|
+
LATEST_NAME="${IMAGE_NAME}:<%= continuous_deployment.image_tag || 'latest' %>"
|
19
19
|
|
20
20
|
if [ ! -z "$KB_AUTH_TOKEN" ]
|
21
21
|
then
|
@@ -37,10 +37,14 @@ then
|
|
37
37
|
fi
|
38
38
|
|
39
39
|
|
40
|
-
|
41
|
-
|
40
|
+
ALREADY_DEPLOYED="$(gcloud container images list-tags --format='get(tags)' $IMAGE_NAME | grep $CI_COMMIT_SHA)"
|
41
|
+
if [ -z $ALREADY_DEPLOYED ]
|
42
|
+
then
|
43
|
+
## Build and push containers
|
44
|
+
docker $DOCKER_BUILD_CMD -t $DEPLOY_NAME .
|
45
|
+
docker push $DEPLOY_NAME
|
46
|
+
fi
|
42
47
|
docker tag $DEPLOY_NAME $LATEST_NAME
|
43
|
-
docker push $DEPLOY_NAME
|
44
48
|
docker push $LATEST_NAME
|
45
49
|
|
46
50
|
## Update new secrets defined in secrets.yml as ENV vars for deployments
|
@@ -54,5 +58,4 @@ for deployment in "${deployments[@]}"; do
|
|
54
58
|
[ -z "$deployment" ] && continue # if empty value
|
55
59
|
|
56
60
|
<%= include_template "_cd_apply_images.sh" %>
|
57
|
-
done
|
58
|
-
|
61
|
+
done
|
@@ -21,12 +21,7 @@ documents:
|
|
21
21
|
spec: &template_spec
|
22
22
|
containers:
|
23
23
|
- &app_container
|
24
|
-
|
25
|
-
image: '<%= continuous_deployment.image_name %>:latest'
|
26
|
-
<% else %>
|
27
|
-
image: '<%= continuous_deployment.image %>'
|
28
|
-
<% end %>
|
29
|
-
|
24
|
+
image: '<%= continuous_deployment.image_name %>:<%= continuous_deployment.image_tag || "latest" %>'
|
30
25
|
<% if deployment.command %>
|
31
26
|
command: ["/bin/bash", "-c", "<%= deployment.command %>"]
|
32
27
|
<% end %>
|
data/lib/templates/settings.rb
CHANGED
@@ -24,7 +24,8 @@ settings = {
|
|
24
24
|
certificate_domain: is_production ? 'myapp.com' : 'beta.myapp.com' # nil if domain is not required
|
25
25
|
},
|
26
26
|
continuous_deployment: {
|
27
|
-
|
27
|
+
image_name: "gcr.io/my-account/#{app_name}",
|
28
|
+
image_tag: 'latest',
|
28
29
|
project_name: 'my-project-name',
|
29
30
|
cluster_name: 'my-cluster-name',
|
30
31
|
cluster_region: 'europe-west4-a',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kubernetes_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- owen2345
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: erb
|