osbro-git-deploy 0.5.7 → 0.5.8

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.
@@ -5,7 +5,19 @@ def run(cmd)
5
5
  exit($?.exitstatus) unless system "umask 002 && #{cmd}"
6
6
  end
7
7
 
8
- RAILS_ENV = ENV['RAILS_ENV'] || 'production'
8
+ def get_env
9
+ case `hostname`
10
+ when /obdev/
11
+ 'development'
12
+ when /.local$/
13
+ 'local'
14
+ else
15
+ 'production'
16
+ end
17
+ end
18
+
19
+ RACK_ENV = ENV['RACK_ENV'] || get_env
20
+
9
21
  use_bundler = File.file? 'Gemfile'
10
22
  rake_cmd = use_bundler ? 'bundle exec rake' : 'rake'
11
23
 
@@ -21,15 +33,15 @@ end
21
33
  if File.file? 'Rakefile'
22
34
  tasks = []
23
35
 
24
- num_migrations = `git diff #{oldrev} #{newrev} --diff-filter=A --name-only -z db/migrate`.split("\0").size
36
+ # num_migrations = `git diff #{oldrev} #{newrev} --diff-filter=A --name-only -z db/migrations`.split("\0").size
25
37
  # run migrations if new ones have been added
26
- tasks << "db:migrate" if num_migrations > 0
38
+ tasks << "db:migrate"
27
39
 
28
40
  # precompile assets
29
- changed_assets = `git diff #{oldrev} #{newrev} --name-only -z app/assets`.split("\0")
30
- tasks << "assets:precompile" if changed_assets.size > 0
41
+ # changed_assets = `git diff #{oldrev} #{newrev} --name-only -z app/assets`.split("\0")
42
+ # tasks << "assets:precompile" if changed_assets.size > 0
31
43
 
32
- run "#{rake_cmd} #{tasks.join(' ')} RAILS_ENV=#{RAILS_ENV}" if tasks.any?
44
+ run "#{rake_cmd} #{tasks.join(' ')} RACK_ENV=#{RACK_ENV}" if tasks.any?
33
45
  end
34
46
 
35
47
  # clear cached assets (unversioned/ignored files)
@@ -37,3 +49,4 @@ run "git clean -x -f -- public/stylesheets public/javascripts"
37
49
 
38
50
  # clean unversioned files from vendor/plugins (e.g. old submodules)
39
51
  run "git clean -d -f -- vendor/plugins"
52
+
@@ -25,9 +25,6 @@ done
25
25
  # abort if there's no update, or in case the branch is deleted
26
26
  [ -z "${newrev//0}" ] && exit
27
27
 
28
- export RAILS_ENV=production
29
- export RACK_ENV=production
30
-
31
28
  # check out the latest code into the working copy
32
29
  umask 002
33
30
  git reset --hard
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osbro-git-deploy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 7
10
- version: 0.5.7
9
+ - 8
10
+ version: 0.5.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Mislav Marohni\xC4\x87"