kubernetes_helper 1.12.2 → 1.12.5
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 -0
- data/lib/kubernetes_helper/version.rb +1 -1
- data/lib/kubernetes_helper.rb +2 -2
- data/lib/templates/cd.sh +3 -2
- data/lib/templates/deployment.yml +1 -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: 671e4935f2fa146de59fab6b0bedc9a994fb061c106d14ecad194360b4433a7e
|
4
|
+
data.tar.gz: 5deea0563a57c83b31c38870548c43ed8f97400187b83d4166e2879cb83904da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cea87bbc5e92dbf20c4cabd3f6bfc88e78027bb1b349abaa43b39335e4a3aa4da7a57d4260e6415fdd3934e845282859062943d292ef63807fe48fb678aad6c2
|
7
|
+
data.tar.gz: b767e7a995c1b8c4300e11df0c1df928b6865beffb320810864a504b94e39b27820e7fffc5da0cc2e25a349535f9583bbd07112eb36b023ea84268e181e10892
|
data/README.md
CHANGED
@@ -61,6 +61,8 @@ Below settings are used when running Continuous Deployment
|
|
61
61
|
- `continuous_deployment.cluster_region`: Cluster region name. Sample: `europe-west4-a`
|
62
62
|
- `continuous_deployment.docker_build_cmd`: Docker command to build the corresponding image. Sample: `build --target production -f Dockerfile `
|
63
63
|
- `continuous_deployment.update_deployment` (Boolean, default: false): If true permits to re-generate and update the k8s deployment(s) before applying the new version (new docker image)
|
64
|
+
- `continuous_deployment.before_building_image` (String, default: empty): Add the ability to enter commands before building docker image
|
65
|
+
- `continuous_deployment.after_building_image` (String, default: empty): Add the ability to enter commands after building docker image
|
64
66
|
|
65
67
|
Below settings are used when configuring the application in the k8s environment
|
66
68
|
- `deployment.name` (String): Web deployment name (Note: Underscores are not accepted). Sample: `my-app`
|
data/lib/kubernetes_helper.rb
CHANGED
@@ -14,7 +14,7 @@ module KubernetesHelper
|
|
14
14
|
|
15
15
|
# @param env_name (String)
|
16
16
|
# @return [Hash]
|
17
|
-
def self.load_settings
|
17
|
+
def self.load_settings # rubocop:disable Metrics/MethodLength:
|
18
18
|
config_file = File.join(settings_path, 'settings.rb')
|
19
19
|
load config_file
|
20
20
|
|
@@ -30,7 +30,7 @@ module KubernetesHelper
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def self.deep_merge(hash1, hash2)
|
33
|
-
merger = proc { |_key, v1, v2| v1.
|
33
|
+
merger = proc { |_key, v1, v2| v1.is_a?(Hash) && v2.is_a?(Hash) ? v1.merge(v2, &merger) : v2 }
|
34
34
|
hash1.merge(hash2, &merger)
|
35
35
|
end
|
36
36
|
|
data/lib/templates/cd.sh
CHANGED
@@ -42,15 +42,16 @@ if [ -z $ALREADY_DEPLOYED ]
|
|
42
42
|
then
|
43
43
|
## Build and push containers
|
44
44
|
echo "****** image not created yet, building image..."
|
45
|
+
<%=continuous_deployment.before_building_image || ''%>
|
45
46
|
docker $DOCKER_BUILD_CMD -t $DEPLOY_NAME .
|
47
|
+
<%=continuous_deployment.after_building_image || ''%>
|
46
48
|
docker push $DEPLOY_NAME
|
47
49
|
else
|
48
50
|
echo "****** image was already created: $ALREADY_DEPLOYED"
|
49
51
|
fi
|
50
52
|
|
51
53
|
echo "****** tagging image $DEPLOY_NAME as $LATEST_NAME"
|
52
|
-
|
53
|
-
docker push $LATEST_NAME
|
54
|
+
gcloud container images add-tag --quiet $DEPLOY_NAME $LATEST_NAME
|
54
55
|
|
55
56
|
## Update new secrets defined in secrets.yml as ENV vars for deployments
|
56
57
|
<% if continuous_deployment.update_deployment %>
|
@@ -30,7 +30,7 @@ documents:
|
|
30
30
|
import_secrets: ['secrets.yml', '<%=secrets.name%>']
|
31
31
|
ports:
|
32
32
|
- containerPort: &port <%= deployment.app_port || 3000 %>
|
33
|
-
name: '<%=service.backend_port_name%>'
|
33
|
+
name: '<%=service.backend_port_name || 'b-port'%>'
|
34
34
|
|
35
35
|
<% if deployment.liveness_path %>
|
36
36
|
livenessProbe: &liveness_probe
|
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.12.
|
4
|
+
version: 1.12.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- owen2345
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: erb
|