kran 1.0.0 → 1.1.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/README.md +5 -3
- data/lib/kran/commands/docker.rb +2 -3
- data/lib/kran/commands/krane.rb +4 -4
- data/lib/kran/commands/kubectl.rb +2 -2
- data/lib/kran/configuration.rb +4 -0
- data/lib/kran/shell.rb +5 -0
- data/lib/kran/templates/kran.yml +6 -0
- data/lib/kran/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cadcace7c5bf8d83aa3ab9007caba40361fef547a91a7d9016a4707c92daa813
|
|
4
|
+
data.tar.gz: f9b29ad876cbe00d2e4b47fb8143ac399243de3207c28f4e3c5c766747cb7bd1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 385f44dd50a3464299967fe2b85018a40d791a44c9272a7acb687e7a58be39324f03c4ad684097b0cc6259224746df737320f7b6a37ac7472362ac8e6ef6b3b2
|
|
7
|
+
data.tar.gz: eeb759046f23efeb8baa880e02aea5fb9bcca32e9542d243bf81b864f0ca37c76a0313ea74c6599033460642c0cfaa2547f2a179ca132b6fe774a0fdff509d2f
|
data/README.md
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
# kran
|
|
2
2
|
|
|
3
|
+
[](https://rubygems.org/gems/kran)
|
|
4
|
+
[](https://github.com/yfxie/kran/actions/workflows/ci.yml)
|
|
5
|
+
[](https://coveralls.io/github/yfxie/kran?branch=main)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
3
8
|
Deploy to Kubernetes with [krane](https://github.com/Shopify/krane), the simple way.
|
|
4
9
|
One command builds the image, pushes it, renders the krane templates and deploys them. A few more
|
|
5
10
|
commands cover the daily work: logs, exec, details, audit.
|
|
6
11
|
|
|
7
|
-
Kran is the German word for crane.
|
|
8
|
-
|
|
9
12
|
## Install
|
|
10
13
|
|
|
11
14
|
```sh
|
|
@@ -34,7 +37,6 @@ If you have used [kamal](https://kamal-deploy.org), this will feel just as simpl
|
|
|
34
37
|
one config file, one command to deploy.
|
|
35
38
|
|
|
36
39
|
Documentation: https://kran.bincode.tw
|
|
37
|
-
Source: https://github.com/yfxie/kran
|
|
38
40
|
|
|
39
41
|
## Develop
|
|
40
42
|
|
data/lib/kran/commands/docker.rb
CHANGED
|
@@ -28,9 +28,8 @@ module Kran
|
|
|
28
28
|
private
|
|
29
29
|
|
|
30
30
|
def docker(*args)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
remote ? "DOCKER_HOST=#{Shell.escape(remote)} #{command}" : command
|
|
31
|
+
env = @config.env.merge({ "DOCKER_HOST" => @config.builder.remote }.compact)
|
|
32
|
+
Shell.with_env(env, Shell.join(["docker", *args.compact]))
|
|
34
33
|
end
|
|
35
34
|
|
|
36
35
|
def platform(archs)
|
data/lib/kran/commands/krane.rb
CHANGED
|
@@ -18,8 +18,7 @@ module Kran
|
|
|
18
18
|
# krane parses options with Thor, where a repeated -f replaces the earlier one
|
|
19
19
|
# instead of appending to it, so every file has to follow a single -f.
|
|
20
20
|
files = [@config.krane.secrets, "-"].compact
|
|
21
|
-
|
|
22
|
-
kubernetes.kubeconfig ? "KUBECONFIG=#{Shell.escape(kubernetes.kubeconfig)} #{command}" : command
|
|
21
|
+
krane("deploy", kubernetes.namespace, kubernetes.context, "-f", *files, kubeconfig: kubernetes.kubeconfig)
|
|
23
22
|
end
|
|
24
23
|
|
|
25
24
|
def pipeline(tag)
|
|
@@ -36,8 +35,9 @@ module Kran
|
|
|
36
35
|
|
|
37
36
|
private
|
|
38
37
|
|
|
39
|
-
def krane(*args)
|
|
40
|
-
|
|
38
|
+
def krane(*args, kubeconfig: nil)
|
|
39
|
+
env = @config.env.merge({ "KUBECONFIG" => kubeconfig }.compact)
|
|
40
|
+
Shell.with_env(env, "#{@config.krane.command} #{Shell.join(args)}")
|
|
41
41
|
end
|
|
42
42
|
end
|
|
43
43
|
end
|
|
@@ -46,8 +46,8 @@ module Kran
|
|
|
46
46
|
|
|
47
47
|
def kubectl(*args)
|
|
48
48
|
kubernetes = @config.kubernetes
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
env = @config.env.merge({ "KUBECONFIG" => kubernetes.kubeconfig }.compact)
|
|
50
|
+
Shell.with_env(env, Shell.join(["kubectl", "--context", kubernetes.context, "--namespace", kubernetes.namespace, *args.compact]))
|
|
51
51
|
end
|
|
52
52
|
end
|
|
53
53
|
end
|
data/lib/kran/configuration.rb
CHANGED
data/lib/kran/shell.rb
CHANGED
data/lib/kran/templates/kran.yml
CHANGED
|
@@ -46,6 +46,12 @@ app:
|
|
|
46
46
|
# Container inside the pod (kubectl -c). Defaults to the pod's default container.
|
|
47
47
|
# container: web
|
|
48
48
|
|
|
49
|
+
# Environment variables put in front of every docker, krane and kubectl command, for settings those
|
|
50
|
+
# tools read from the environment: which cloud account docker's credential helper and kubectl's
|
|
51
|
+
# auth plugin sign in with, for example.
|
|
52
|
+
# env:
|
|
53
|
+
# CLOUDSDK_ACTIVE_CONFIG_NAME: acme
|
|
54
|
+
|
|
49
55
|
# Shortcuts run with `kran <alias>`. Extra arguments are appended to the command.
|
|
50
56
|
aliases:
|
|
51
57
|
shell: exec --interactive bash
|
data/lib/kran/version.rb
CHANGED