vidar 0.6.0 → 0.7.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 +4 -4
- data/Gemfile.lock +3 -3
- data/README.md +6 -5
- data/lib/vidar/cli.rb +21 -27
- data/lib/vidar/version.rb +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: c1fad26944e3d247be67c2960ab9a5e9a1a4c1f62198402da0bb0be68fe54b33
|
4
|
+
data.tar.gz: '0922fe3cde0313197502911809e4a4c82887aa112c1f59c520fe59e486423704'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3446b289c207ec313eacb76a54d0180688c698adb3e08d99122ba818ca191629a6066a9e24b7add5d135f58f89483ba54f57391854341777e38188fd4c213bb9
|
7
|
+
data.tar.gz: 17dc608f5273631d9d7d49a4919452c7d1a340eaa70933e84d4fa9a6c4d42573b59951e24be0848fdae204731a87c86f24cb4138c9174191d715892e105d4f3e
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
vidar (0.
|
4
|
+
vidar (0.7.0)
|
5
5
|
colorize
|
6
6
|
faraday
|
7
7
|
thor (~> 0.20)
|
@@ -16,7 +16,7 @@ GEM
|
|
16
16
|
diff-lcs (1.3)
|
17
17
|
faraday (0.17.0)
|
18
18
|
multipart-post (>= 1.2, < 3)
|
19
|
-
jaro_winkler (1.5.
|
19
|
+
jaro_winkler (1.5.4)
|
20
20
|
method_source (0.9.2)
|
21
21
|
multipart-post (2.1.1)
|
22
22
|
parallel (1.18.0)
|
@@ -40,7 +40,7 @@ GEM
|
|
40
40
|
diff-lcs (>= 1.2.0, < 2.0)
|
41
41
|
rspec-support (~> 3.9.0)
|
42
42
|
rspec-support (3.9.0)
|
43
|
-
rubocop (0.
|
43
|
+
rubocop (0.76.0)
|
44
44
|
jaro_winkler (~> 1.5.1)
|
45
45
|
parallel (~> 1.10)
|
46
46
|
parser (>= 2.6)
|
data/README.md
CHANGED
@@ -24,8 +24,8 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
#### Requirements :
|
26
26
|
|
27
|
-
* multistage `Dockerfile`, with
|
28
|
-
* `docker-compose.ci.yml` file with defined services for all
|
27
|
+
* multistage `Dockerfile`, with at least 2 stages defined: `runner`, `release`.
|
28
|
+
* `docker-compose.ci.yml` file with defined services for all mentioned stages
|
29
29
|
* `vidar.yml` file to the project root directory, which following content:
|
30
30
|
|
31
31
|
```yml
|
@@ -47,9 +47,10 @@ deployments:
|
|
47
47
|
# Deployment url, e.g. url to gke cluster workloads filtered by namespace
|
48
48
|
# Similar to all other values it may contain references to others using mustache-like interpolation.
|
49
49
|
url: "https://console.cloud.google.com/kubernetes/workload?project=project&namespace={{namespace}}"
|
50
|
-
# Sentry webhook url
|
51
|
-
|
52
|
-
|
50
|
+
# Sentry webhook url used to send deploy notifications
|
51
|
+
# (make sure you use the exact url with trailing slash provided by sentry), optional
|
52
|
+
sentry_webhook_url: https://sentry.io/api/hooks/release/builtin/123/asdf/
|
53
|
+
# Slack webhook url used to send deploy notifications, optional
|
53
54
|
slack_webhook_url: https://hooks.slack.com/services/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
|
54
55
|
# docker-compose file, optional, default value: docker-compose.ci.yml
|
55
56
|
compose_file: docker-compose.ci.yml
|
data/lib/vidar/cli.rb
CHANGED
@@ -6,63 +6,57 @@ module Vidar
|
|
6
6
|
true
|
7
7
|
end
|
8
8
|
|
9
|
-
desc "
|
9
|
+
desc "exec", "Run any command in given docker-compose target, default target is `runner`"
|
10
10
|
option :command
|
11
|
-
|
11
|
+
option :target, default: "runner"
|
12
|
+
def exec
|
12
13
|
Run.docker_compose("run runner #{options[:command]}") || exit(1)
|
13
14
|
end
|
14
15
|
|
15
|
-
desc "pull", "
|
16
|
+
desc "pull", "Pull existing docker images to leverage docker caching"
|
16
17
|
def pull
|
17
18
|
Log.info "Pulling #{Config.get!(:image)} tags"
|
18
|
-
Run.docker "pull #{Config.get!(:image)}:
|
19
|
-
Run.docker "pull #{Config.get!(:image)}:
|
19
|
+
Run.docker "pull #{Config.get!(:image)}:runner-#{Config.get!(:current_branch)} 2> /dev/null || true"
|
20
|
+
Run.docker "pull #{Config.get!(:image)}:runner-#{Config.get!(:default_branch)} 2> /dev/null || true"
|
20
21
|
Run.docker "pull #{Config.get!(:image)}:release 2> /dev/null || true"
|
21
22
|
Log.info "Docker images:"
|
22
|
-
|
23
|
+
Run.docker("images")
|
23
24
|
end
|
24
25
|
|
25
|
-
desc "build", "
|
26
|
+
desc "build", "Build docker stages"
|
26
27
|
def build
|
27
|
-
Log.info "Building
|
28
|
-
Run.docker_compose "build builder"
|
29
|
-
|
30
|
-
Log.info "Building #{Config.get!(:image)}:runner-#{Config.get!(:current_branch)}"
|
28
|
+
Log.info "Building runner image"
|
31
29
|
Run.docker_compose "build runner"
|
32
30
|
|
33
|
-
Log.info "Building
|
31
|
+
Log.info "Building release image"
|
34
32
|
Run.docker_compose "build release"
|
35
33
|
end
|
36
34
|
|
37
35
|
desc "cache", "Caches intermediate docker stages"
|
38
36
|
def cache
|
39
|
-
Log.info "
|
40
|
-
Run.docker "push #{Config.get!(:image)}:
|
37
|
+
Log.info "Publishing runner image"
|
38
|
+
Run.docker "push #{Config.get!(:image)}:runner-#{Config.get!(:current_branch)}"
|
41
39
|
end
|
42
40
|
|
43
|
-
desc "publish", "
|
41
|
+
desc "publish", "Publish docker images on docker registry"
|
44
42
|
def publish
|
45
|
-
Log.info "
|
43
|
+
Log.info "Publishing #{Config.get!(:image)}:#{Config.get!(:revision)}"
|
46
44
|
Run.docker "tag #{Config.get!(:image)}:release #{Config.get!(:image)}:#{Config.get!(:revision)}"
|
47
45
|
Run.docker "push #{Config.get!(:image)}:#{Config.get!(:revision)}"
|
48
46
|
|
49
47
|
return unless Config.get!(:current_branch) == Config.get!(:default_branch)
|
50
48
|
|
51
|
-
Log.info "
|
52
|
-
Run.docker "tag #{Config.get!(:image)}:builder-#{Config.get!(:current_branch)} #{Config.get!(:image)}:builder"
|
53
|
-
Run.docker "push #{Config.get!(:image)}:builder"
|
54
|
-
|
55
|
-
Log.info "Publish #{Config.get!(:image)}:latest"
|
49
|
+
Log.info "Publishing #{Config.get!(:image)}:release"
|
56
50
|
Run.docker "tag #{Config.get!(:image)}:release #{Config.get!(:image)}:latest"
|
57
51
|
Run.docker "push #{Config.get!(:image)}:release"
|
58
52
|
Run.docker "push #{Config.get!(:image)}:latest"
|
59
53
|
end
|
60
54
|
|
61
|
-
desc "deploy", "
|
55
|
+
desc "deploy", "Perform k8s deployment with deploy hook"
|
62
56
|
method_option :revision, required: false
|
63
57
|
def deploy
|
64
58
|
revision = options[:revision] || Config.get!(:revision)
|
65
|
-
Log.info "Current kubectl context: #{Config.get!(:kubectl_context)}
|
59
|
+
Log.info "Current kubectl context: #{Config.get!(:kubectl_context)}"
|
66
60
|
|
67
61
|
Log.info "Looking for deploy hook..."
|
68
62
|
template_name, error, status = Open3.capture3 "kubectl get cronjob deploy-hook-template -n #{Config.get!(:namespace)} -o name --ignore-not-found=true"
|
@@ -94,18 +88,18 @@ module Vidar
|
|
94
88
|
Run.kubectl "set image deployments,cronjobs *=#{Config.get!(:image)}:#{revision} --all"
|
95
89
|
end
|
96
90
|
|
97
|
-
desc "release", "
|
91
|
+
desc "release", "Build and publish docker images"
|
98
92
|
def release
|
99
|
-
Log.info "
|
93
|
+
Log.info "Build and release #{Config.get!(:image)}:#{Config.get!(:revision)}"
|
100
94
|
pull
|
101
95
|
build
|
102
96
|
cache
|
103
97
|
publish
|
104
98
|
end
|
105
99
|
|
106
|
-
desc "monitor_deploy_status", "
|
100
|
+
desc "monitor_deploy_status", "Check is deployment has finished and sends post-deploy notification"
|
107
101
|
def monitor_deploy_status
|
108
|
-
Log.info "Current kubectl context: #{Config.get!(:kubectl_context)}
|
102
|
+
Log.info "Current kubectl context: #{Config.get!(:kubectl_context)}"
|
109
103
|
Log.info "Checking if all containers in #{Config.get!(:namespace)} namespace(s) are ready..."
|
110
104
|
|
111
105
|
deploy_config = Config.deploy_config
|
data/lib/vidar/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vidar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Krzysztof Knapik
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-10-
|
12
|
+
date: 2019-10-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colorize
|