35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# File 'lib/linchpin/cli.rb', line 35
def deploy
app_name = discover_appname
short_app_name = discover_short_appname
app_type = discover_type(Dir.pwd)
version = get_version_hash
temp_dir = Dir.mktmpdir
command_output = false
begin
deploy_templates = Dir[File.join(File.join(File.join(File.dirname(File.expand_path(__FILE__)), 'k8s'), app_type),"*.erb")]
deploy_templates.each do |filename|
"LOL #{filename}"
FileUtils.cp(filename, "#{temp_dir}")
end
FileUtils.cp(File.join(File.join(File.join(Dir.pwd, 'config'), "deploy"), "secrets.ejson"), "#{temp_dir}")
expose = configs.fetch('expose', '')
escaped_command = Shellwords.escape("KUBECONFIG=~/.kube/config REVISION=#{version} kubernetes-deploy #{short_app_name} cicd-example --template-dir=#{temp_dir} --bindings=full_name=#{app_name},app_name=#{short_app_name},expose=#{expose}")
command_output = system({}, "bash -c #{escaped_command}")
ensure
FileUtils.remove_entry temp_dir
end
exit(1) unless command_output
end
|