Class: DPL::Provider::Nodejitsu
Constant Summary
collapse
- CONFIG_FILE =
'.dpl/jitsu.json'
Instance Attribute Summary
#context, #options
Instance Method Summary
collapse
#create_key, #deploy, #error, experimental, #initialize, #log, new, npm_g, #option, pip, requires, #run, #setup_git_ssh
Constructor Details
This class inherits a constructor from DPL::Provider
Instance Method Details
#check_app ⇒ Object
22
23
24
25
26
27
28
29
30
|
# File 'lib/dpl/provider/nodejitsu.rb', line 22
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
18
19
20
|
# File 'lib/dpl/provider/nodejitsu.rb', line 18
def check_auth
File.open(CONFIG_FILE, 'w') { |f| f << config.to_json }
end
|
#config ⇒ Object
10
11
12
13
14
15
16
|
# File 'lib/dpl/provider/nodejitsu.rb', line 10
def config
{
"username" => option(:username),
"apiToken" => option(:api_key),
"apiTokenName" => "travis"
}
end
|
#needs_key? ⇒ Boolean
32
33
34
|
# File 'lib/dpl/provider/nodejitsu.rb', line 32
def needs_key?
false
end
|
#push_app ⇒ Object
36
37
38
|
# File 'lib/dpl/provider/nodejitsu.rb', line 36
def push_app
system "jitsu deploy -j #{CONFIG_FILE}"
end
|