pvcglue 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +112 -15
- data/lib/pvcglue/manager.rb +18 -1
- data/lib/pvcglue/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTMzYjY3NjhjMjgwN2VlNGRhNDUwZGE4MzUzZDA0NjgwYjJlMWQwNg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjkwNGQ4ZjE1OGNiNWNmNmUwMmFlMTJhYzgxYTg1YzdmMTEzNzg4Mg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
N2JjMmE4MmRjMTMwYzM2OWVkYmZlMjhkZWRmZGUyZTM2ZTFkNjNhMTM1MDA0
|
10
|
+
ZjY2ZGU5M2NmZTVhMjUyN2U5ZjNmNGVlMGYzNDQ2ZGMzZGYyOTMwZWJkMzJk
|
11
|
+
NzBkNjBiYjAzOWUyNzkxNzgwN2ZhYjg4MmIxZWNiNzU1M2JhN2E=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGExYTQ3YjM5ZTFkZDEwZDQwMWEyZTRhYjQzOTY5YjVjOTU1YTRiMDM1MGYy
|
14
|
+
NGQ5NjU5MjdiNWY1NGI4YThkMDgwOTc3MzhlMzM1MTA2OWU2Y2ZjODVjMmY1
|
15
|
+
YmU1YmQxMjVmYWE3MWQwYTk2NzlhZTEzYjM0Mjc5YjM2MDAwODI=
|
data/README.md
CHANGED
@@ -1,15 +1,89 @@
|
|
1
|
-
#
|
1
|
+
# PVC Glue
|
2
2
|
|
3
|
-
|
4
|
-
pvc manger build # only once
|
5
|
-
# create or edit configuration
|
6
|
-
pvc manager push # save the config
|
7
|
-
pvc <stage> build # anytime the config is changed
|
8
|
-
pvc <stage> env set KEY=value[, KEY2=value]
|
9
|
-
pvc <stage> capify
|
10
|
-
pvc <stage> deploy
|
3
|
+
Pico Virtual Cloud
|
11
4
|
|
12
|
-
|
5
|
+
An opinionated cloud application manager for Rails applications using your own servers.
|
6
|
+
|
7
|
+
Currently supported stack:
|
8
|
+
|
9
|
+
* Ubuntu 12.04 (with plans for supporting 14.04)
|
10
|
+
* Ruby >= 1.9 (multiple versions supported on same server)
|
11
|
+
* Rails >= 3.2
|
12
|
+
* RVM
|
13
|
+
* Postgresql 9.1
|
14
|
+
* Nginx
|
15
|
+
* Passenger > 4.0
|
16
|
+
* Memcached
|
17
|
+
|
18
|
+
# This is a work in progress
|
19
|
+
|
20
|
+
Although this project is being used on productions sites, this should be considered "Alpha" code, as things my change without notice until version 1.0. :)
|
21
|
+
|
22
|
+
# First Time Set Up for Existing Project
|
23
|
+
|
24
|
+
Note: An existing authorized user must perform steps 1-3.
|
25
|
+
|
26
|
+
1. Add the new user's public key to the manager
|
27
|
+
|
28
|
+
pvc manager user /path/to/id_rsa.pub
|
29
|
+
|
30
|
+
2. Add the new user's public key to the project(s)
|
31
|
+
|
32
|
+
pvc manager pull # to ensure the latest data
|
33
|
+
|
34
|
+
Edit the file listed after "Saved as:" add public SSH key of new user to project(s)
|
35
|
+
|
36
|
+
pvc manager push
|
37
|
+
|
38
|
+
3. Update all environments to allow access
|
39
|
+
|
40
|
+
pvc alpha bootstrap
|
41
|
+
pvc beta bootstrap # if not the same set of servers as alpha
|
42
|
+
pvc preview bootstrap # if not the same set of servers as alpha/beta
|
43
|
+
pvc production bootstrap
|
44
|
+
|
45
|
+
4. Configure the manager (only once per developer machine, if set as the default).
|
46
|
+
|
47
|
+
pvc manager configure # only once per developer machine, if set as default
|
48
|
+
|
49
|
+
5. Test.
|
50
|
+
|
51
|
+
pvc alpha c # start a rails console on the alpha web server
|
52
|
+
|
53
|
+
## Common Usage
|
54
|
+
|
55
|
+
Always do a `pvc manager pull` once before making any changes to ensure you have the latest data. (Caching will be improved as time permitts.)
|
56
|
+
|
57
|
+
* Deploy a stage
|
58
|
+
|
59
|
+
pvc <stage> deploy
|
60
|
+
|
61
|
+
* Set an environment variable or variables
|
62
|
+
|
63
|
+
pvc <stage> env set XYZ=123 [ZZZ=321] # this will restart the app
|
64
|
+
|
65
|
+
* Pull down a copy of the production db
|
66
|
+
|
67
|
+
pvc production db pull
|
68
|
+
|
69
|
+
* Restore a db dump to you local development machine
|
70
|
+
|
71
|
+
pvc restore path/to/dump/file.dump
|
72
|
+
|
73
|
+
* edit configuration
|
74
|
+
|
75
|
+
pvc manager pull # to ensure the latest data
|
76
|
+
|
77
|
+
Edit the file listed after "Saved as:"
|
78
|
+
|
79
|
+
pvc manager push
|
80
|
+
|
81
|
+
* update deployment settings after making changes to the configuration
|
82
|
+
|
83
|
+
pvc <stage> capify # must be done on all stages!
|
84
|
+
|
85
|
+
|
86
|
+
# Help
|
13
87
|
|
14
88
|
Commands:
|
15
89
|
pvc bootstrap -s, --stage=STAGE # bootstrap...
|
@@ -18,17 +92,44 @@
|
|
18
92
|
pvc capify -s, --stage=STAGE # update capistrano configuration
|
19
93
|
pvc console -s, --stage=STAGE # open rails console
|
20
94
|
pvc db SUBCOMMAND ...ARGS # db utils
|
95
|
+
pvc db config # create/update database.yml
|
96
|
+
pvc db dump # dump
|
97
|
+
pvc db help [COMMAND] # Describe subcommands or one specific subcommand
|
98
|
+
pvc db info # info
|
99
|
+
pvc db pull # pull
|
100
|
+
pvc db push # push
|
101
|
+
pvc db restore # restore
|
21
102
|
pvc deploy -s, --stage=STAGE # deploy the app
|
22
103
|
pvc env SUBCOMMAND ...ARGS -s, --stage=STAGE # manage stage environment
|
104
|
+
pvc env default # reset env to default. Destructive!!!
|
105
|
+
pvc env help [COMMAND] # Describe subcommands or one specific subcommand
|
106
|
+
pvc env list # list
|
107
|
+
pvc env pull # pull
|
108
|
+
pvc env push # push
|
109
|
+
pvc env rm # alternative to unset
|
110
|
+
pvc env set # set environment variable(s) for the stage XYZ=123 [ZZZ=321]
|
111
|
+
pvc env unset # remove environment variable(s) for the stage XYZ [ZZZ]
|
23
112
|
pvc help [COMMAND] # Describe available commands or one specific c...
|
24
113
|
pvc info # show the pvcglue version and cloud settings
|
25
114
|
pvc m -s, --stage=STAGE # enable or disable maintenance mode
|
26
115
|
pvc maint -s, --stage=STAGE # enable or disable maintenance mode
|
27
116
|
pvc maintenance -s, --stage=STAGE # enable or disable maintenance mode
|
28
117
|
pvc manager SUBCOMMAND ...ARGS # manage manager
|
118
|
+
pvc manager bootstrap # bootstrap
|
119
|
+
pvc manager configure # configure
|
120
|
+
pvc manager help [COMMAND] # Describe subcommands or one specific subcommand
|
121
|
+
pvc manager info # show manager data
|
122
|
+
pvc manager pull # pull
|
123
|
+
pvc manager push # push
|
124
|
+
pvc manager s # run shell
|
125
|
+
pvc manager shell # run shell
|
126
|
+
pvc manager show # show manager data
|
29
127
|
pvc s -s, --stage=STAGE # shell
|
30
128
|
pvc sh -s, --stage=STAGE # run interactive shell on node
|
31
129
|
pvc ssl SUBCOMMAND ...ARGS -s, --stage=STAGE # manage ssl certificates
|
130
|
+
pvc ssl csr # create new csr
|
131
|
+
pvc ssl help [COMMAND] # Describe subcommands or one specific subcommand
|
132
|
+
pvc ssl import # import .key or .crt or both if no extension given (.crt must be 'pre...
|
32
133
|
pvc version # show the version of PVC...
|
33
134
|
|
34
135
|
https://github.com/radar/guides/blob/master/gem-development.md
|
@@ -49,10 +150,6 @@ Or install it yourself as:
|
|
49
150
|
|
50
151
|
$ gem install pvcglue
|
51
152
|
|
52
|
-
## Usage
|
53
|
-
|
54
|
-
TODO: Write usage instructions here
|
55
|
-
|
56
153
|
## Developing
|
57
154
|
|
58
155
|
To use locally committed gem, use
|
@@ -98,4 +195,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
98
195
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
99
196
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
100
197
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
101
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
198
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/pvcglue/manager.rb
CHANGED
@@ -49,7 +49,24 @@ module Pvcglue
|
|
49
49
|
user_name = self.class.user_name
|
50
50
|
cloud_name = Pvcglue.configuration.cloud_name
|
51
51
|
puts "Connection to #{cloud_name} cloud on manager at (#{cloud_manager}) as user '#{user_name}'..."
|
52
|
-
system(%(ssh #{Pvcglue.cloud.port_in_context(:manager)} -t #{user_name}@#{cloud_manager} "cd #{working_dir} && bash -i"))
|
52
|
+
system(%(ssh -p #{Pvcglue.cloud.port_in_context(:manager)} -t #{user_name}@#{cloud_manager} "cd #{working_dir} && bash -i"))
|
53
|
+
end
|
54
|
+
|
55
|
+
desc "user PATH_TO_FILE", "add or update user's ssh key to allow access to the manager"
|
56
|
+
|
57
|
+
def user(filename)
|
58
|
+
cloud_manager = Pvcglue.configuration.cloud_manager
|
59
|
+
user_name = self.class.user_name
|
60
|
+
cloud_name = Pvcglue.configuration.cloud_name
|
61
|
+
puts "Adding key to #{cloud_name} cloud on manager at (#{cloud_manager}) ..."
|
62
|
+
puts(%(ssh-copy-id -i "#{filename}" "#{user_name}@#{cloud_manager} -p #{Pvcglue.cloud.port_in_context(:manager)}"))
|
63
|
+
system(%(ssh-copy-id -i "#{filename}" "#{user_name}@#{cloud_manager} -p #{Pvcglue.cloud.port_in_context(:manager)}"))
|
64
|
+
end
|
65
|
+
|
66
|
+
desc "rm", "(not yet implemented) remove user's ssh key to disallow access to the manager"
|
67
|
+
|
68
|
+
def rm
|
69
|
+
raise(Thor::Error, "Sorry, not yet implemented. :(")
|
53
70
|
end
|
54
71
|
|
55
72
|
desc "configure", "configure"
|
data/lib/pvcglue/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pvcglue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Lyric
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|