Class: Dpl::Providers::Convox
Constant Summary
Dpl::Provider::FOLDS, Dpl::Provider::STAGES
Instance Attribute Summary
#key_name, #repo_name
Instance Method Summary
collapse
#before_finish, #before_init, #before_install, #before_prepare, #before_setup, #chmod, #cleanup, #cmd, #compact, #err, #error, #escape, examples, #expand, #file?, #finish?, #fold, #fold?, #info, #initialize, install_deps, install_deps?, #mkdir_p, move_files, #msg, #mv, #only, #open, #opt_for, #opt_key, #opts_for, #print, #quote, #read, #remove_dpl_dir, #rm_rf, #run, #run_cmd, #run_cmds, #run_stage, #run_stage?, #script, #setup_dpl_dir, #setup_git_config, #setup_git_http_user_agent, #setup_git_ssh, #setup_ssh_key, #shell, #sq, #ssh_keygen, #symbolize, #try_ssh_access, #uncleanup, unmove_files, validate_runtimes, #wait_for_ssh_access, #warn
#apt, #apt?, #cmds, #errs, #full_name, #gem, #gem?, #keep, #move, #msgs, #needs, #needs?, #node_js, #npm, #npm?, #opt, #path, #pip, #pip?, #python, #ruby_pre?, #ruby_version, #runtimes, #status, #strs, #summary, #user_agent, #vars
Methods included from Squiggle
#sq
Methods included from Assets
#asset
Methods included from Env
included, #opts
Methods included from ConfigFile
included, #opts
#interpolate, #obfuscate, #vars
Methods included from Memoize
included
Constructor Details
This class inherits a constructor from Dpl::Provider
Instance Method Details
#deploy ⇒ Object
73
74
75
76
|
# File 'lib/dpl/providers/convox.rb', line 73
def deploy
shell :set_env, echo: false unless env.empty?
shell promote? ? :deploy : :build, echo: false
end
|
#description ⇒ Object
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
# File 'lib/dpl/providers/convox.rb', line 97
def description
if description?
super
else
JSON.dump(
repo_slug:,
git_commit_sha: git_sha,
git_commit_message: git_commit_msg,
git_commit_author: git_author_name,
git_tag:,
branch: git_branch,
travis_build_id: ENV['TRAVIS_BUILD_ID'],
travis_build_number: ENV['TRAVIS_BUILD_NUMBER'],
pull_request: ENV['TRAVIS_PULL_REQUEST']
)
end
end
|
#env ⇒ Object
84
85
86
87
|
# File 'lib/dpl/providers/convox.rb', line 84
def env
env = env_names.concat(super || [])
env.map { |str| escape(str) }.join(' ')
end
|
#env_file ⇒ Object
89
90
91
92
93
94
95
|
# File 'lib/dpl/providers/convox.rb', line 89
def env_file
return [] unless env_file?
error :env_file unless file?(super)
lines = read(super).split("\n").map(&:strip)
lines.reject(&:empty?)
end
|
#env_names ⇒ Object
78
79
80
81
82
|
# File 'lib/dpl/providers/convox.rb', line 78
def env_names
env = super || []
env = env.map { |str| "#{str}=#{ENV[str]}" }
env_file.concat(env)
end
|
#env_vars ⇒ Object
119
120
121
122
123
124
125
126
127
|
# File 'lib/dpl/providers/convox.rb', line 119
def env_vars
{
CONVOX_HOST: host,
CONVOX_PASSWORD: password,
CONVOX_APP: app,
CONVOX_RACK: rack,
CONVOX_CLI: 'convox'
}
end
|
#export ⇒ Object
115
116
117
|
# File 'lib/dpl/providers/convox.rb', line 115
def export
env_vars.each { |key, value| ENV[key.to_s] = value.to_s }
end
|
#install ⇒ Object
51
52
53
54
55
|
# File 'lib/dpl/providers/convox.rb', line 51
def install
script :install
shell :update if update_cli?
export
end
|
#login ⇒ Object
57
58
59
|
# File 'lib/dpl/providers/convox.rb', line 57
def login
shell :login
end
|
#prepare ⇒ Object
67
68
69
70
71
|
# File 'lib/dpl/providers/convox.rb', line 67
def prepare
Array(super).each do |cmd|
cmd.casecmp('restart').zero? ? restart : run_cmd(cmd)
end
end
|
#validate ⇒ Object
61
62
63
64
65
|
# File 'lib/dpl/providers/convox.rb', line 61
def validate
shell :validate, assert: false and return
error :missing unless create?
shell :create
end
|