labdb_manager 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 909b21cc1ddbba3c422a33191657951acbf636da
4
- data.tar.gz: e96a44db487b6f1e77fcdecd74c840aa073daf4d
3
+ metadata.gz: 97d1a0638f7a688ff1554a0962a5db313597139b
4
+ data.tar.gz: ee3280d3345b1143863f2cee178924c8308f1d75
5
5
  SHA512:
6
- metadata.gz: 6b178845e45f09eb9784d02e41ed17a1171525e7ace255d2f2f75aa037402971dbdbcd210ea3e695c6352c3c56ca4d56d5fe4c1d069d5d16d6d46e2e59adb913
7
- data.tar.gz: f785e8ad00ade7fa8687f278705453162fff86748085bbcf25fe40048f0c89705974db5a2926bd37833215826e22e5f17cc60e9286a2e219a3d5d00ea047a3b0
6
+ metadata.gz: 1e53decd2b337c37d2d94982645cff84689cd35a115ebda1848c48face23e86efbd4776812399548e87eb2a04de2e583d782047f153a7ca62b3deea188046804
7
+ data.tar.gz: f21d7c1d7cd1c9aeb569f5dae61bc0018bc265e460bdb6a3c272855b8a93797c29fde1cd841672267ff917200f49da4c795bc0b063815a4f8b2750dbf7230dd4
data/README.md CHANGED
@@ -1,24 +1,38 @@
1
1
  # LabdbManager
2
2
 
3
- TODO: Write a gem description
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
- Add this line to your application's Gemfile:
7
+ $ gem install labdb_manager
8
8
 
9
- gem 'labdb_manager'
9
+ ## Usage
10
10
 
11
- And then execute:
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
- $ bundle
13
+ Usage: `labdb [--dry-run] <command>`
14
14
 
15
- Or install it yourself as:
15
+ Several of the commands assume that they're being run from the root of the labdb installation.
16
16
 
17
- $ gem install labdb_manager
17
+ Command should be one of:
18
18
 
19
- ## Usage
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
- TODO: Write usage instructions here
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
- puts (CONFIRM_PREFIX + cmd).yellow
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
@@ -1,3 +1,3 @@
1
1
  module LabdbManager
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: labdb_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin J. Fuller