tidy_reset 0.1.14 → 0.1.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/tidy_reset.rb +18 -2
- data/lib/tidy_reset/tasks/tidy.rake +9 -7
- data/tidy_reset.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e0313e131ba96280fb6f3100d8ea0a5e4ed521a
|
4
|
+
data.tar.gz: f215bca5d14824c6681e4202fbc9775b7a9f2f49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8f6f024bb5aaf2ddb8ca12c6ab187178235a7cd59fb43957d122641455d8cbc46b4d4d4aa2d1c43b7379282f403663a6c24c4419b4d784e71d6b88356317baf
|
7
|
+
data.tar.gz: a650adcd02edabb81326b58ecff2b033603ce1a71320e57bce1d4b240e45208e29a717002d2322a9405417a988cc84a7a4c56c851cca081b9369b5d6962b36a4
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.17
|
data/lib/tidy_reset.rb
CHANGED
@@ -22,8 +22,24 @@ module TidyReset
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
def app_name(
|
26
|
-
"#{configuration.app}-#{
|
25
|
+
def app_name(stage)
|
26
|
+
"#{configuration.app}-#{stage}"
|
27
|
+
end
|
28
|
+
|
29
|
+
def dyno_config
|
30
|
+
YAML.load_file("#{Rails.root}/config/tidy/dynos.yml")
|
31
|
+
end
|
32
|
+
|
33
|
+
def app_stop(stage)
|
34
|
+
execute("heroku maintenance:on --app #{app_name(stage)}")
|
35
|
+
scale_command = dyno_config[stage].inject("") { |command, config| command += "#{config.first}='0' " }
|
36
|
+
execute("heroku ps:scale #{scale_command} --app #{app_name(stage)}")
|
37
|
+
end
|
38
|
+
|
39
|
+
def app_start(stage)
|
40
|
+
execute("heroku maintenance:off --app #{app_name(stage)}")
|
41
|
+
scale_command = dyno_config[stage].inject("") { |command, config| command += "#{config.first}='#{config.last}' " }
|
42
|
+
execute("heroku ps:scale #{scale_command} --app #{app_name(stage)}")
|
27
43
|
end
|
28
44
|
|
29
45
|
def master_connection_from_db_config(db_config)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
namespace :tidy do
|
2
2
|
desc "Makes application pristine."
|
3
|
-
task :all, [:stage] => [:validate, :
|
3
|
+
task :all, [:stage] => [:validate, :app_stop, :vars, :git, :db, :cache, :restart, :app_start] do |t, args|
|
4
4
|
# Executes all tasks
|
5
5
|
end
|
6
6
|
|
@@ -27,12 +27,14 @@ namespace :tidy do
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
desc "Scales
|
31
|
-
task :
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
30
|
+
desc "Enables maintenance mode. Scales all dynos to 0."
|
31
|
+
task :app_stop, [:stage] => [:validate] do |t, args|
|
32
|
+
TidyReset.app_stop(args.stage)
|
33
|
+
end
|
34
|
+
|
35
|
+
desc "Disables maintenance mode. Scales all dynos to configuration."
|
36
|
+
task :app_start, [:stage] => [:validate] do |t, args|
|
37
|
+
TidyReset.app_start(args.stage)
|
36
38
|
end
|
37
39
|
|
38
40
|
desc "Sets default environment variables."
|
data/tidy_reset.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: tidy_reset 0.1.
|
5
|
+
# stub: tidy_reset 0.1.17 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "tidy_reset"
|
9
|
-
s.version = "0.1.
|
9
|
+
s.version = "0.1.17"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Thinknear"]
|
14
|
-
s.date = "2014-08-
|
14
|
+
s.date = "2014-08-29"
|
15
15
|
s.description = "Reset dynos, environment variables, deploys master git branch, and purges the database."
|
16
16
|
s.email = "software@thinknear.com"
|
17
17
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tidy_reset
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thinknear
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|