gmortar 0.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 +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +34 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +39 -0
- data/LICENSE.txt +21 -0
- data/README.md +14 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/gmortar +12 -0
- data/gmortar.gemspec +31 -0
- data/lib/gmortar/describe_command.rb +21 -0
- data/lib/gmortar/fire_command.rb +26 -0
- data/lib/gmortar/list_command.rb +21 -0
- data/lib/gmortar/root_command.rb +24 -0
- data/lib/gmortar/template.rb +19 -0
- data/lib/gmortar/version.rb +3 -0
- data/lib/gmortar/yank_command.rb +21 -0
- data/lib/gmortar.rb +62 -0
- data/templates/describe.yaml +9 -0
- data/templates/fire.yaml +18 -0
- data/templates/list.yaml +8 -0
- data/templates/yank.yaml +10 -0
- metadata +140 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: e199ba40b7755f86f57b8d2c986f7e1a5a7502c5d8ae66fde27e356ac9d37ddf
|
|
4
|
+
data.tar.gz: b9c4afb3c035b22fbeced80cdff91d3cf1f1d1ba1d03699ab1c1abada7c8d9db
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: ac8a5408b4b66e4524f54d1095917aef19895b043e656d299c3922f577c5651b3c6592c58f3f701d19c3de44164bf83ae8279e04d799297b16da33a15eb08438
|
|
7
|
+
data.tar.gz: b8ecc3aba75ec07cf59ea31389d91df5c66261535f5afffd8c0184e53bc109a504c11cf1f364183202721c48478161837f79dbffa0dcbdaf5ec7febe4ae6819c
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.ruby-gemset
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gmortar
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.6.0
|
data/.travis.yml
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
stages:
|
|
2
|
+
- name: binary
|
|
3
|
+
if: tag IS present
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
include:
|
|
7
|
+
- stage: binary
|
|
8
|
+
os: osx
|
|
9
|
+
sudo: required
|
|
10
|
+
rvm:
|
|
11
|
+
- "2.6"
|
|
12
|
+
before_install:
|
|
13
|
+
- curl -L https://github.com/matti/gem2exe/releases/download/v0.3.2/gem2exe-darwin-amd64-v0.3.2.gz | gunzip - > gem2exe
|
|
14
|
+
- chmod a+x gem2exe
|
|
15
|
+
- sudo mv gem2exe /usr/local/bin/gem2exe
|
|
16
|
+
- gem2exe setup
|
|
17
|
+
script:
|
|
18
|
+
- mkdir releases
|
|
19
|
+
- gem2exe local --out releases/gmortar-darwin-amd64-${TRAVIS_TAG} gmortar
|
|
20
|
+
|
|
21
|
+
deploy:
|
|
22
|
+
- provider: releases
|
|
23
|
+
api_key:
|
|
24
|
+
secure: "DfeplChvxXvUFwm4cTlzh4L+BIXOhOH+kGR+50fBA/iQl1EK2EpQqvsIezHI/qyEFYu68FTAsF00HQZ2R3gmSg75JGxMo0AWw/Aoqh013E87HjvaCk3kW5Gf6pDbPprHy36Z5phmK98gf5SC+WIf2nKwPo+lhkQ1AHoxUUddW9PHjJKgLpny/kJ8O6jIw00CgcQZHxpH9k70B92pFOfmW6K1DP92FrenKmHGyub+D5kdeKbOuDH3CI4Xvl7kGTp06KNagDYIozoB3UMWmd9kgIZIpysP5ALLx79Nbm9z7aEwDRC5ICD268PdgeDEtxdwyEP9+kSUq13DxIDYjexRnJaUmaTH+jbRT/ZxJ7p7ATXEUFap+MPinHGIxg0JheIAw1AxS8mnOVp2gU4r6I43diIia+JdW6hm6dJzknXf1S1NRaA8dD3mSbM4eaZSHhzyXzkIHFnCfFAvIH6YKO/7RaE4YtWV3Bezw18wI66bsreDPviZGWM0UCcGRRJ7PFLr+AW6U21GVKwpyrlJXUYFMaat/TfUHGml9dAtVi/JmrfMxRwTcOpgmN6lkN2/UDQ44Mtv/1upgGYS0HDPzPBdpCwQsjt+m8/VeH61HaYvvGMRqOjNMP4wvTXpgB21L3aifYTQgrMl6w6hpw420jyxw6J+o3AuIzKwvFXPUaVrjQk="
|
|
25
|
+
file_glob: true
|
|
26
|
+
file: releases/*
|
|
27
|
+
skip_cleanup: true
|
|
28
|
+
on:
|
|
29
|
+
tags: true
|
|
30
|
+
- provider: rubygems
|
|
31
|
+
api_key:
|
|
32
|
+
secure: "dwuwaBtcqJf0gd2ZpNTYp7hsoN5wT25K8XcM3sfesDY5HZ7T0RfDSRjZ1zyoFRuC/DfSZx09IHYwjBr3ieHqVVflitrrnScgWIahi3HI0HtsZOZiBL0diqm/PC8ODjLsIaD3Ny4B9yYDh4jvd4mB8HpU+KHe5iKHpnbnPhKpHxF4HRq9gwl2/C3cD5nfwq6Wmn/IEArrZ4VOH8NdjHRXbhYoDN+t4wIILrgA3axE0+t7GWot3Oe25UQehfNCdLotQWY7cgJWUYSQ6VwODft3xrMzur+sxra8Blk7NrJm3nmCh5Si0DeEFgist/KHj1rA2sh1UKgMaT9lgm4NyTaLlXsgi492OwuT1piLfiQTOS3yXvz+FGCE0mQEdSIBTTocg8gWtUjRIH/TcbkeZmFY1m0vZT1cX9Lpo7GEGpfabg6a8YkcaTw6mpdt7evNBJ2ckYuP0DePsJHlKcGG4MtBbh15BwLlHiNJeTY9TE5LVAUpaFcdwIq/rPvtM/J2VTP7xKuxTj8b2nx9ianJFTE6XW+QTthRh8K9UlBOizpYyOt0kpJi+Fd3o5p0ZrtS6zGZwja4WcwYHk7WRHdq4kZ6WTmIfk2dBa6x0qkzpA64EJy0McW5YXoeQc+yPkEKkikuFdZnVt0zIiShNvTjkMdMouS1WsMchYROwNwyt5mzG4w="
|
|
33
|
+
on:
|
|
34
|
+
branch: master
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
gmortar (0.1.0)
|
|
5
|
+
clamp
|
|
6
|
+
kommando
|
|
7
|
+
|
|
8
|
+
GEM
|
|
9
|
+
remote: https://rubygems.org/
|
|
10
|
+
specs:
|
|
11
|
+
clamp (1.3.0)
|
|
12
|
+
diff-lcs (1.3)
|
|
13
|
+
kommando (0.1.2)
|
|
14
|
+
rake (10.5.0)
|
|
15
|
+
rspec (3.8.0)
|
|
16
|
+
rspec-core (~> 3.8.0)
|
|
17
|
+
rspec-expectations (~> 3.8.0)
|
|
18
|
+
rspec-mocks (~> 3.8.0)
|
|
19
|
+
rspec-core (3.8.0)
|
|
20
|
+
rspec-support (~> 3.8.0)
|
|
21
|
+
rspec-expectations (3.8.2)
|
|
22
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
23
|
+
rspec-support (~> 3.8.0)
|
|
24
|
+
rspec-mocks (3.8.0)
|
|
25
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
26
|
+
rspec-support (~> 3.8.0)
|
|
27
|
+
rspec-support (3.8.0)
|
|
28
|
+
|
|
29
|
+
PLATFORMS
|
|
30
|
+
ruby
|
|
31
|
+
|
|
32
|
+
DEPENDENCIES
|
|
33
|
+
bundler (~> 1.16)
|
|
34
|
+
gmortar!
|
|
35
|
+
rake (~> 10.0)
|
|
36
|
+
rspec (~> 3.0)
|
|
37
|
+
|
|
38
|
+
BUNDLED WITH
|
|
39
|
+
1.17.2
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Matti Paksula
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# gmortar
|
|
2
|
+
|
|
3
|
+
(Optionally) use https://www.github.com/matti/gbuild to build your image
|
|
4
|
+
|
|
5
|
+
gbuild build gcr.io/project/name
|
|
6
|
+
|
|
7
|
+
Then
|
|
8
|
+
|
|
9
|
+
gmortar fire gcloud_project europe-north1 gke_name k8smanifests shotname \
|
|
10
|
+
--var some=value --var another=value
|
|
11
|
+
|
|
12
|
+
gmortar list gcloud_project europe-north1 gke_name
|
|
13
|
+
gmortar describe gcloud_project europe-north1 gke_name shotname
|
|
14
|
+
gmortar yank gcloud_project europe-north1 gke_name shotname
|
data/Rakefile
ADDED
data/bin/console
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "gmortar"
|
|
5
|
+
|
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
+
|
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
+
# require "pry"
|
|
11
|
+
# Pry.start
|
|
12
|
+
|
|
13
|
+
require "irb"
|
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/exe/gmortar
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
# add lib to libpath (only needed when running from the sources)
|
|
5
|
+
require 'pathname'
|
|
6
|
+
lib_path = File.expand_path('../../lib', Pathname.new(__FILE__).realpath)
|
|
7
|
+
$LOAD_PATH.unshift lib_path unless $LOAD_PATH.include?(lib_path)
|
|
8
|
+
|
|
9
|
+
STDOUT.sync = true
|
|
10
|
+
|
|
11
|
+
require 'gmortar'
|
|
12
|
+
Gmortar::RootCommand.run
|
data/gmortar.gemspec
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require "gmortar/version"
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "gmortar"
|
|
8
|
+
spec.version = Gmortar::VERSION
|
|
9
|
+
spec.authors = ["Matti Paksula"]
|
|
10
|
+
spec.email = ["matti.paksula@iki.fi"]
|
|
11
|
+
|
|
12
|
+
spec.summary = "gmortar"
|
|
13
|
+
spec.homepage = "https://github.com/matti/gmortar"
|
|
14
|
+
spec.license = "MIT"
|
|
15
|
+
|
|
16
|
+
# Specify which files should be added to the gem when it is released.
|
|
17
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
18
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
|
19
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
20
|
+
end
|
|
21
|
+
spec.bindir = "exe"
|
|
22
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
23
|
+
spec.require_paths = ["lib"]
|
|
24
|
+
|
|
25
|
+
spec.add_dependency "clamp"
|
|
26
|
+
spec.add_dependency "kommando"
|
|
27
|
+
|
|
28
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
|
29
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
|
30
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
|
31
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
require "tempfile"
|
|
3
|
+
|
|
4
|
+
module Gmortar
|
|
5
|
+
class DescribeCommand < Clamp::Command
|
|
6
|
+
parameter "PROJECT", "gcloud project"
|
|
7
|
+
parameter "GKE_REGION", "GKE Region"
|
|
8
|
+
parameter "GKE_NAME", "GKE Name"
|
|
9
|
+
parameter "NAME", "shot name"
|
|
10
|
+
|
|
11
|
+
option "--debug", :flag, "debug", default: false
|
|
12
|
+
|
|
13
|
+
def execute
|
|
14
|
+
variables = [
|
|
15
|
+
[:gke_region, gke_region],
|
|
16
|
+
[:gke_name, gke_name],
|
|
17
|
+
]
|
|
18
|
+
Gmortar.run project, "describe.yaml", variables: variables, name: name, debug: debug?
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
require "tempfile"
|
|
3
|
+
|
|
4
|
+
module Gmortar
|
|
5
|
+
class FireCommand < Clamp::Command
|
|
6
|
+
parameter "PROJECT", "gcloud project"
|
|
7
|
+
parameter "GKE_REGION", "GKE Region"
|
|
8
|
+
parameter "GKE_NAME", "GKE Name"
|
|
9
|
+
parameter "SOURCE", "source"
|
|
10
|
+
parameter "NAME", "shot name"
|
|
11
|
+
|
|
12
|
+
option "--var", "VAR", "mortar variable, can be given multiple times", multivalued: true
|
|
13
|
+
option "--debug", :flag, "debug", default: false
|
|
14
|
+
|
|
15
|
+
def execute
|
|
16
|
+
variables = [
|
|
17
|
+
[:gke_region, gke_region],
|
|
18
|
+
[:gke_name, gke_name],
|
|
19
|
+
[:variables, var_list],
|
|
20
|
+
[:shot, name],
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
Gmortar.run project, "fire.yaml", source: source, variables: variables, name: name, debug: debug
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
require "tempfile"
|
|
3
|
+
|
|
4
|
+
module Gmortar
|
|
5
|
+
class ListCommand < Clamp::Command
|
|
6
|
+
parameter "PROJECT", "gcloud project"
|
|
7
|
+
parameter "GKE_REGION", "GKE Region"
|
|
8
|
+
parameter "GKE_NAME", "GKE Name"
|
|
9
|
+
|
|
10
|
+
option "--debug", :flag, "debug", default: false
|
|
11
|
+
|
|
12
|
+
def execute
|
|
13
|
+
variables = [
|
|
14
|
+
[:gke_region, gke_region],
|
|
15
|
+
[:gke_name, gke_name],
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
Gmortar.run project, "list.yaml", variables: variables, debug: debug?
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Gmortar
|
|
4
|
+
class RootCommand < Clamp::Command
|
|
5
|
+
banner "💥 gmortar #{Gmortar::VERSION}"
|
|
6
|
+
|
|
7
|
+
option ['-v', '--version'], :flag, "Show version information" do
|
|
8
|
+
puts Gmortar::VERSION
|
|
9
|
+
exit 0
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
subcommand ["fire"], "fire", FireCommand
|
|
13
|
+
subcommand ["yank"], "yank", YankCommand
|
|
14
|
+
subcommand ["list"], "list", ListCommand
|
|
15
|
+
subcommand ["describe"], "describe", DescribeCommand
|
|
16
|
+
|
|
17
|
+
def self.run
|
|
18
|
+
super
|
|
19
|
+
rescue StandardError => exc
|
|
20
|
+
warn exc.message
|
|
21
|
+
warn exc.backtrace.join("\n")
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module Gmortar
|
|
2
|
+
class Template
|
|
3
|
+
def initialize(name)
|
|
4
|
+
path = File.expand_path(
|
|
5
|
+
File.join(__dir__, "..","..", "templates", name)
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
@__erb = ERB.new File.read(path)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def set(key, value)
|
|
12
|
+
instance_variable_set "@#{key}", value
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def result
|
|
16
|
+
@__erb.result binding
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
require "tempfile"
|
|
3
|
+
|
|
4
|
+
module Gmortar
|
|
5
|
+
class YankCommand < Clamp::Command
|
|
6
|
+
parameter "PROJECT", "gcloud project"
|
|
7
|
+
parameter "GKE_REGION", "GKE Region"
|
|
8
|
+
parameter "GKE_NAME", "GKE Name"
|
|
9
|
+
parameter "NAME", "shot name"
|
|
10
|
+
|
|
11
|
+
option "--debug", :flag, "debug", default: false
|
|
12
|
+
|
|
13
|
+
def execute
|
|
14
|
+
variables = [
|
|
15
|
+
[:gke_region, gke_region],
|
|
16
|
+
[:gke_name, gke_name],
|
|
17
|
+
]
|
|
18
|
+
Gmortar.run project, "yank.yaml", variables: variables, name: name, debug: debug?
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
data/lib/gmortar.rb
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
require "clamp"
|
|
2
|
+
if Clamp.respond_to? :allow_options_after_parameters
|
|
3
|
+
Clamp.allow_options_after_parameters = true
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
require "kommando"
|
|
7
|
+
require "erb"
|
|
8
|
+
require "securerandom"
|
|
9
|
+
|
|
10
|
+
module Gmortar
|
|
11
|
+
def self.run(project, template, source:nil, variables:[], name: nil, debug:)
|
|
12
|
+
t = Template.new template
|
|
13
|
+
for pair in variables
|
|
14
|
+
t.set pair.first, pair.last
|
|
15
|
+
end
|
|
16
|
+
t.set :name, name if name
|
|
17
|
+
|
|
18
|
+
gcloud_config = Tempfile.new
|
|
19
|
+
File.write gcloud_config.path, t.result
|
|
20
|
+
|
|
21
|
+
puts t.result if debug
|
|
22
|
+
|
|
23
|
+
log_bucket = "gs://#{project}_cloudbuild/gmortar-logs/#{SecureRandom.uuid}"
|
|
24
|
+
source_bucket = "gs://#{project}_cloudbuild/gmortar-sources/#{SecureRandom.uuid}"
|
|
25
|
+
|
|
26
|
+
cmd = ["gcloud","builds","submit"]
|
|
27
|
+
if source
|
|
28
|
+
cmd << source
|
|
29
|
+
cmd += ["--gcs-log-dir", log_bucket]
|
|
30
|
+
cmd += ["--gcs-source-staging-dir", source_bucket]
|
|
31
|
+
else
|
|
32
|
+
cmd << "--no-source"
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
cmd += ["--config", gcloud_config.path]
|
|
36
|
+
cmd += ["--project", project]
|
|
37
|
+
|
|
38
|
+
puts cmd.join(" ") if debug
|
|
39
|
+
k = Kommando.new cmd.join(" "), output: true
|
|
40
|
+
k.run
|
|
41
|
+
|
|
42
|
+
waits = []
|
|
43
|
+
if source
|
|
44
|
+
puts "removing source from #{source_bucket}"
|
|
45
|
+
waits << (Kommando.run_async "gsutil rm -r #{source_bucket}")
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
puts "removing logs from #{log_bucket}"
|
|
49
|
+
waits << (Kommando.run_async "gsutil rm -r #{log_bucket}")
|
|
50
|
+
waits.each { |k| k.wait }
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
require_relative "gmortar/version"
|
|
55
|
+
require_relative "gmortar/template"
|
|
56
|
+
|
|
57
|
+
require_relative "gmortar/fire_command"
|
|
58
|
+
require_relative "gmortar/yank_command"
|
|
59
|
+
require_relative "gmortar/list_command"
|
|
60
|
+
require_relative "gmortar/describe_command"
|
|
61
|
+
|
|
62
|
+
require_relative "gmortar/root_command"
|
data/templates/fire.yaml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
steps:
|
|
2
|
+
- name: 'gcr.io/$PROJECT_ID/mortar'
|
|
3
|
+
env:
|
|
4
|
+
- CLOUDSDK_COMPUTE_REGION=<%= @gke_region %>
|
|
5
|
+
- CLOUDSDK_CONTAINER_CLUSTER=<%= @gke_name %>
|
|
6
|
+
args:
|
|
7
|
+
- fire
|
|
8
|
+
- -d
|
|
9
|
+
- --var
|
|
10
|
+
- build_id=$BUILD_ID
|
|
11
|
+
- --var
|
|
12
|
+
- project_id=$PROJECT_ID
|
|
13
|
+
<% @variables.each do |var| %>
|
|
14
|
+
- --var
|
|
15
|
+
- <%= var %>
|
|
16
|
+
<% end %>
|
|
17
|
+
- .
|
|
18
|
+
- <%= @name %>
|
data/templates/list.yaml
ADDED
data/templates/yank.yaml
ADDED
metadata
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: gmortar
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Matti Paksula
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2019-02-03 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: clamp
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: kommando
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: bundler
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '1.16'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '1.16'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: rake
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '10.0'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '10.0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: rspec
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "~>"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '3.0'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - "~>"
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '3.0'
|
|
83
|
+
description:
|
|
84
|
+
email:
|
|
85
|
+
- matti.paksula@iki.fi
|
|
86
|
+
executables:
|
|
87
|
+
- gmortar
|
|
88
|
+
extensions: []
|
|
89
|
+
extra_rdoc_files: []
|
|
90
|
+
files:
|
|
91
|
+
- ".gitignore"
|
|
92
|
+
- ".rspec"
|
|
93
|
+
- ".ruby-gemset"
|
|
94
|
+
- ".ruby-version"
|
|
95
|
+
- ".travis.yml"
|
|
96
|
+
- Gemfile
|
|
97
|
+
- Gemfile.lock
|
|
98
|
+
- LICENSE.txt
|
|
99
|
+
- README.md
|
|
100
|
+
- Rakefile
|
|
101
|
+
- bin/console
|
|
102
|
+
- bin/setup
|
|
103
|
+
- exe/gmortar
|
|
104
|
+
- gmortar.gemspec
|
|
105
|
+
- lib/gmortar.rb
|
|
106
|
+
- lib/gmortar/describe_command.rb
|
|
107
|
+
- lib/gmortar/fire_command.rb
|
|
108
|
+
- lib/gmortar/list_command.rb
|
|
109
|
+
- lib/gmortar/root_command.rb
|
|
110
|
+
- lib/gmortar/template.rb
|
|
111
|
+
- lib/gmortar/version.rb
|
|
112
|
+
- lib/gmortar/yank_command.rb
|
|
113
|
+
- templates/describe.yaml
|
|
114
|
+
- templates/fire.yaml
|
|
115
|
+
- templates/list.yaml
|
|
116
|
+
- templates/yank.yaml
|
|
117
|
+
homepage: https://github.com/matti/gmortar
|
|
118
|
+
licenses:
|
|
119
|
+
- MIT
|
|
120
|
+
metadata: {}
|
|
121
|
+
post_install_message:
|
|
122
|
+
rdoc_options: []
|
|
123
|
+
require_paths:
|
|
124
|
+
- lib
|
|
125
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
|
+
requirements:
|
|
127
|
+
- - ">="
|
|
128
|
+
- !ruby/object:Gem::Version
|
|
129
|
+
version: '0'
|
|
130
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
|
+
requirements:
|
|
132
|
+
- - ">="
|
|
133
|
+
- !ruby/object:Gem::Version
|
|
134
|
+
version: '0'
|
|
135
|
+
requirements: []
|
|
136
|
+
rubygems_version: 3.0.1
|
|
137
|
+
signing_key:
|
|
138
|
+
specification_version: 4
|
|
139
|
+
summary: gmortar
|
|
140
|
+
test_files: []
|