railsworks 0.0.2 → 0.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/.travis.yml +9 -0
- data/lib/railsworks/tasks/console.rake +25 -5
- data/lib/railsworks/version.rb +1 -1
- data/railsworks.gemspec +1 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3dae062115203e2a40db72f13168a6a67ca47ace
|
4
|
+
data.tar.gz: 175b79f94aeab40cf8b2341f24d0604cd76ae785
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e61b74f2b486872706922b43e841ff1f4e93f6adff8af5efbe804b00d2b641905c429a54ad959bcd713e3958922098eb8c23036512656d6a4be79afea4900456
|
7
|
+
data.tar.gz: f3ff545af7883e10cc18db619865b3c3b6ae6b2494148cca9f7039f8d6ecff1e993ccdc8f3171c8282827fa81f2a0995236cfada4e266874a74786d88ea45e0b
|
data/.travis.yml
ADDED
@@ -8,17 +8,18 @@ namespace :console do
|
|
8
8
|
task :staging do
|
9
9
|
regions = YAML.load_file('config/opsworks.yml')['staging']
|
10
10
|
ip = get_ip(regions)
|
11
|
-
path = '/srv/www/
|
12
|
-
|
11
|
+
path = '/srv/www/' + get_name(regions) + '/current'
|
12
|
+
environment = setup_environment(regions)
|
13
|
+
run_interactively("#{environment} bundle exec rails console --environment=production", ip, path)
|
13
14
|
end
|
14
15
|
|
15
16
|
desc "Connecting to production console"
|
16
17
|
task :production do
|
17
18
|
regions = YAML.load_file('config/opsworks.yml')['production']
|
18
19
|
ip = get_ip(regions)
|
19
|
-
|
20
|
-
|
21
|
-
run_interactively("
|
20
|
+
path = '/srv/www/' + get_name(regions) + '/current'
|
21
|
+
environment = setup_environment(regions)
|
22
|
+
run_interactively("#{environment} bundle exec rails console --environment=production", ip, path)
|
22
23
|
end
|
23
24
|
|
24
25
|
def get_ip(regions)
|
@@ -34,6 +35,25 @@ namespace :console do
|
|
34
35
|
ip
|
35
36
|
end
|
36
37
|
|
38
|
+
def setup_environment(regions)
|
39
|
+
cmd = []
|
40
|
+
regions.each do |region, value|
|
41
|
+
client = Aws::OpsWorks::Client.new(region: region)
|
42
|
+
env = client.describe_apps({app_ids: [value['app_id']]})[0][0].environment
|
43
|
+
env.each do |v|
|
44
|
+
cmd << v.key+'="'+v.value+'"' unless v.secure
|
45
|
+
end
|
46
|
+
end
|
47
|
+
cmd.join ' '
|
48
|
+
end
|
49
|
+
|
50
|
+
def get_name(regions)
|
51
|
+
regions.each do |region, value|
|
52
|
+
client = Aws::OpsWorks::Client.new(region: region)
|
53
|
+
return client.describe_apps({app_ids: [value['app_id']]})[0][0].shortname
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
37
57
|
def run_interactively(command, server, path)
|
38
58
|
exec %Q(ssh #{server} -t 'cd #{path} && sudo #{command}') if server && path
|
39
59
|
end
|
data/lib/railsworks/version.rb
CHANGED
data/railsworks.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: railsworks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kurt Nelson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
description: Console and deploy task for OpsWorks
|
56
70
|
email:
|
57
71
|
- kurtisnelson@gmail.com
|
@@ -60,6 +74,7 @@ extensions: []
|
|
60
74
|
extra_rdoc_files: []
|
61
75
|
files:
|
62
76
|
- ".gitignore"
|
77
|
+
- ".travis.yml"
|
63
78
|
- Gemfile
|
64
79
|
- LICENSE
|
65
80
|
- LICENSE.txt
|