Class: DPL::Provider::Catalyze
Instance Attribute Summary
#context, #options
Instance Method Summary
collapse
apt_get, #cleanup, #commit_msg, context, #create_key, #default_text_charset, #default_text_charset?, #deploy, deprecated, #detect_encoding?, #encoding_for, #error, experimental, #initialize, #log, new, npm_g, #option, pip, requires, #run, #setup_git_credentials, #setup_git_ssh, #sha, shell, #uncleanup, #user_agent, #warn
Constructor Details
This class inherits a constructor from DPL::Provider
Instance Method Details
#check_app ⇒ Object
17
18
|
# File 'lib/dpl/provider/catalyze.rb', line 17
def check_app
end
|
#check_auth ⇒ Object
20
21
22
|
# File 'lib/dpl/provider/catalyze.rb', line 20
def check_auth
error "Missing Catalyze target" unless config['target']
end
|
#config ⇒ Object
4
5
6
7
8
9
10
11
|
# File 'lib/dpl/provider/catalyze.rb', line 4
def config
{
"target" => options[:target] || context.env['CATALYZE_TARGET'],
"path" => options[:path] || context.env['CATALYZE_PATH'] || '.'
}
end
|
#needs_key? ⇒ Boolean
13
14
15
|
# File 'lib/dpl/provider/catalyze.rb', line 13
def needs_key?
false
end
|
#push_app ⇒ Object
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/dpl/provider/catalyze.rb', line 24
def push_app
log "Deploying to Catalyze '#{config['target']}'"
if options[:skip_cleanup]
build_num = context.env["TRAVIS_BUILD_NUMBER"]
commit = context.env["TRAVIS_COMMIT"]
repo_slug = context.env["TRAVIS_REPO_SLUG"]
branch = context.env["TRAVIS_BRANCH"]
if build_num && commit && repo_slug && branch
commit_message = "Build ##{build_num} (#{commit}) of #{repo_slug}@#{branch}"
else
commit_message = "Local build"
end
log "Using build files for deployment"
context.shell "git checkout HEAD"
context.shell "git add #{config["path"]} --all --force"
context.shell "git commit -m \"#{commit_message}\" --quiet"
end
context.shell "git push --force #{config['target']} HEAD:master"
end
|