labdb_manager 0.0.1 → 0.0.2
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/README.md +23 -9
- data/lib/labdb_manager.rb +4 -4
- data/lib/labdb_manager/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97d1a0638f7a688ff1554a0962a5db313597139b
|
4
|
+
data.tar.gz: ee3280d3345b1143863f2cee178924c8308f1d75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e53decd2b337c37d2d94982645cff84689cd35a115ebda1848c48face23e86efbd4776812399548e87eb2a04de2e583d782047f153a7ca62b3deea188046804
|
7
|
+
data.tar.gz: f21d7c1d7cd1c9aeb569f5dae61bc0018bc265e460bdb6a3c272855b8a93797c29fde1cd841672267ff917200f49da4c795bc0b063815a4f8b2750dbf7230dd4
|
data/README.md
CHANGED
@@ -1,24 +1,38 @@
|
|
1
1
|
# LabdbManager
|
2
2
|
|
3
|
-
|
3
|
+
Command line utility scripts for helping to manage a labdb installation. Intended to replace the manage.py script in that repository.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
|
7
|
+
$ gem install labdb_manager
|
8
8
|
|
9
|
-
|
9
|
+
## Usage
|
10
10
|
|
11
|
-
|
11
|
+
The gem will install a binary `labdb` that takes command line options for various management tasks. Prefix most commands with a --dry-run to show the commands that would be run but not actually run them. This does not work for hostname or secret.
|
12
12
|
|
13
|
-
|
13
|
+
Usage: `labdb [--dry-run] <command>`
|
14
14
|
|
15
|
-
|
15
|
+
Several of the commands assume that they're being run from the root of the labdb installation.
|
16
16
|
|
17
|
-
|
17
|
+
Command should be one of:
|
18
18
|
|
19
|
-
|
19
|
+
- `update`: Updates the labdb installation to the latest stable (master branch) commit. Makes a backup before doing this. Precompiles assets after updating.
|
20
|
+
|
21
|
+
- `backup`: Dumps the postgres database to a timestamped backup file.
|
22
|
+
|
23
|
+
- `hostname`: optionally, supply a hostname on the command line. If not provided, prompt the user for it. After requsting or reading from the command line, install into the appropriate file for use by the application.
|
24
|
+
|
25
|
+
- `secret`: generate a secure application secret (used for cookie signing) and install it into the appropriate location for use by the application. The umask will be set to 0600. Don't share the secret!
|
26
|
+
|
27
|
+
- `install`: create the database for production mode (kind of a misnomer at this point since it's not the complete install process...)
|
28
|
+
|
29
|
+
- `revert_failure`: if the update fails due to a merge conflict, running this command should bring you back to the last stable state.
|
30
|
+
|
31
|
+
- `devserver`: starts the server locally
|
32
|
+
|
33
|
+
- `force_update_deps`: updates all dependencies to the latest allowed versions. It's possible that this could break things.
|
20
34
|
|
21
|
-
|
35
|
+
- `restart`: restart an installation running under control of supervisord.
|
22
36
|
|
23
37
|
## Contributing
|
24
38
|
|
data/lib/labdb_manager.rb
CHANGED
@@ -48,9 +48,9 @@ def confirm(cmd)
|
|
48
48
|
#
|
49
49
|
# If confirmation is not given, exit the program immediately without running
|
50
50
|
# the command.
|
51
|
-
|
51
|
+
print (cmd + " (y/N) " + CONFIRM_PREFIX ).yellow
|
52
52
|
response = gets
|
53
|
-
unless ['yes', 'y'].include? response.downcase then
|
53
|
+
unless ['yes', 'y'].include? response.downcase.strip then
|
54
54
|
exit 0
|
55
55
|
end
|
56
56
|
cmd
|
@@ -204,7 +204,7 @@ def set_hostname(hostname: nil)
|
|
204
204
|
puts ("Please enter the full hostname of the machine.\n" +
|
205
205
|
'(i.e. the part that would appear including the https:// ' +
|
206
206
|
'in a url but before any other slashes):').yellow
|
207
|
-
CONFIRM_PREFIX.yellow
|
207
|
+
print CONFIRM_PREFIX.yellow
|
208
208
|
hostname = gets
|
209
209
|
File.open(HOSTNAME_CFG_FILE, 'w') do |f|
|
210
210
|
f.write hostname
|
@@ -251,7 +251,7 @@ def backup
|
|
251
251
|
end
|
252
252
|
|
253
253
|
def force_update_deps
|
254
|
-
queue_command bundle_update
|
254
|
+
queue_command {bundle_update}
|
255
255
|
end
|
256
256
|
|
257
257
|
def secret
|