Class: DPL::Provider::Nodejitsu
Constant Summary
collapse
- CONFIG_FILE =
'.dpl/jitsu.json'
Instance Attribute Summary
#context, #options
Instance Method Summary
collapse
apt_get, #cleanup, #commit_msg, context, #create_key, #deploy, #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
20
21
22
23
24
25
26
27
28
|
# File 'lib/dpl/provider/nodejitsu.rb', line 20
def check_app
error "missing package.json" unless File.exist? 'package.json'
package = JSON.parse File.read('package.json')
message = "missing %s in package.json, see https://www.nodejitsu.com/documentation/appendix/package-json/"
error message % "subdomain" unless package['subdomain']
error message % "node version" unless package['engines'] and package['engines']['node']
error message % "start script" unless package['scripts'] and package['scripts']['start']
end
|
#check_auth ⇒ Object
16
17
18
|
# File 'lib/dpl/provider/nodejitsu.rb', line 16
def check_auth
File.open(CONFIG_FILE, 'w') { |f| f << config.to_json }
end
|
#config ⇒ Object
8
9
10
11
12
13
14
|
# File 'lib/dpl/provider/nodejitsu.rb', line 8
def config
{
"username" => option(:username, :user_name, :user),
"apiToken" => option(:api_key),
"apiTokenName" => "travis"
}
end
|
#needs_key? ⇒ Boolean
30
31
32
|
# File 'lib/dpl/provider/nodejitsu.rb', line 30
def needs_key?
false
end
|
#push_app ⇒ Object
34
35
36
|
# File 'lib/dpl/provider/nodejitsu.rb', line 34
def push_app
context.shell "jitsu deploy --jitsuconf #{File.expand_path(CONFIG_FILE)} --release=yes"
end
|