Class: Dpl::Providers::Snap
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, #description, #env, #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
51
52
53
|
# File 'lib/dpl/providers/snap.rb', line 51
def deploy
shell :deploy
end
|
#install ⇒ Object
33
34
35
36
37
38
39
40
|
# File 'lib/dpl/providers/snap.rb', line 33
def install
return if which 'snapcraft'
shell :apt_get_update
shell :update_snapd
shell :install
ENV['PATH'] += ':/snap/bin'
end
|
#login ⇒ Object
42
43
44
|
# File 'lib/dpl/providers/snap.rb', line 42
def login
shell :login, assert: 'Failed to authenticate: %{err}', success: '%{out}', capture: true
end
|
#snap_path ⇒ Object
55
56
57
|
# File 'lib/dpl/providers/snap.rb', line 55
def snap_path
snaps.first
end
|
#snap_paths ⇒ Object
59
60
61
|
# File 'lib/dpl/providers/snap.rb', line 59
def snap_paths
snaps.join(', ')
end
|
#snaps ⇒ Object
63
64
65
|
# File 'lib/dpl/providers/snap.rb', line 63
def snaps
@snaps ||= Dir[snap].sort
end
|
#validate ⇒ Object
46
47
48
49
|
# File 'lib/dpl/providers/snap.rb', line 46
def validate
error :no_snaps if snaps.empty?
error :multiple_snaps if snaps.size > 1
end
|