factor 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/commands/workflows.rb +14 -20
- data/lib/factor.rb +1 -1
- data/lib/factor/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9b26a00f37b7806ed314cb0c1b5facb3e62ae96
|
4
|
+
data.tar.gz: 842281a638e5b05a856d30d465ac06b15df906fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad7b2c27f8afe87f0a5c90634a54cbf51d6a9c0b1a5c4caaaed08538fe702af54e077eaf1d83bac864274252620df0283528f551f6d2be1ec43bedcfadc64403
|
7
|
+
data.tar.gz: 9344a5f686527bc413bdbf0cc9e81333813a7a0a11a07dddf31098dd1e2ade0f63a39d39a6180be63dbd4c693fb674f328dd66f49bd21b080487a7667a1736ab
|
data/lib/commands/workflows.rb
CHANGED
@@ -30,6 +30,7 @@ module Factor
|
|
30
30
|
account_id = args[0]
|
31
31
|
workflow_id = args[1]
|
32
32
|
api_key = args[2]
|
33
|
+
host = (options.host || "https://factor.io").sub(/(\/)+$/,'')
|
33
34
|
|
34
35
|
if !api_key || !workflow_id || !account_id
|
35
36
|
error "API Key, Worklfow ID and Acount ID are all required"
|
@@ -38,7 +39,7 @@ module Factor
|
|
38
39
|
|
39
40
|
info "Getting workflow (#{workflow_id}) from Factor.io Cloud"
|
40
41
|
begin
|
41
|
-
workflow_url = "
|
42
|
+
workflow_url = "#{host}/#{account_id}/workflows/#{workflow_id}.json?auth_token=#{api_key}"
|
42
43
|
raw_content = RestClient.get(workflow_url)
|
43
44
|
workflow_info = JSON.parse(raw_content)
|
44
45
|
rescue => ex
|
@@ -50,36 +51,29 @@ module Factor
|
|
50
51
|
|
51
52
|
info "Getting credentials from Factor.io Cloud"
|
52
53
|
begin
|
53
|
-
credential_url = "
|
54
|
+
credential_url = "#{host}/#{account_id}/credentials.json?auth_token=#{api_key}"
|
54
55
|
raw_content = RestClient.get(credential_url)
|
55
|
-
|
56
|
+
credentials = JSON.parse(raw_content)
|
56
57
|
rescue => ex
|
57
58
|
error "Couldn't retreive workflow: #{ex.message}"
|
58
59
|
exit
|
59
60
|
end
|
60
61
|
|
61
|
-
credentials = {}
|
62
|
-
credential_info.each do |credential|
|
63
|
-
credentials[credential['service']] ||= {}
|
64
|
-
credentials[credential['service']][credential['name']] = credential['value']
|
65
|
-
end
|
66
|
-
|
67
62
|
configatron[:credentials].configure_from_hash(credentials)
|
68
63
|
|
69
|
-
info "Getting
|
64
|
+
info "Getting connectors from Factor.io Cloud"
|
65
|
+
connectors = {}
|
70
66
|
begin
|
71
|
-
connectors_url =
|
72
|
-
connectors_url ||= 'https://raw.githubusercontent.com/factor-io/index/master/connectors.yml'
|
67
|
+
connectors_url = "#{host}/#{account_id}/connectors.json?auth_token=#{api_key}"
|
73
68
|
raw_content = RestClient.get(connectors_url)
|
74
|
-
|
75
|
-
rescue
|
76
|
-
error "Couldn't retreive connectors info"
|
77
|
-
exit
|
78
|
-
end
|
69
|
+
raw_connectors = JSON.parse(raw_content)
|
79
70
|
|
80
|
-
|
81
|
-
|
82
|
-
|
71
|
+
raw_connectors.each do |connector_id,connector_info|
|
72
|
+
connectors[connector_id] = connector_info['connectors'].values.first
|
73
|
+
end
|
74
|
+
rescue => ex
|
75
|
+
error "Couldn't retreive workflow: #{ex.message}"
|
76
|
+
exit
|
83
77
|
end
|
84
78
|
|
85
79
|
configatron[:connectors].configure_from_hash(connectors)
|
data/lib/factor.rb
CHANGED
@@ -23,7 +23,7 @@ end
|
|
23
23
|
command 'cloud' do |c|
|
24
24
|
c.syntax = 'factor host <account id> <workflow id> <api key>'
|
25
25
|
c.description = 'Start the Factor.io Server using your workflows and credentials from Factor.io Cloud'
|
26
|
-
c.option '--
|
26
|
+
c.option '--host URL', String, 'Use non-default Cloud service provider (e.g. pro server)'
|
27
27
|
c.when_called Factor::Commands::Workflow, :cloud
|
28
28
|
end
|
29
29
|
|
data/lib/factor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: factor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maciej Skierkowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 4.2.
|
61
|
+
version: 4.2.1
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 4.2.
|
68
|
+
version: 4.2.1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rest-client
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|