aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tasks/install.rake
blob: f32f3f240e4fc7c6a4165849bc5598bb6b35af6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
task :package do
  release_name = Time.now.strftime('%Y%m%d%H%M%S')

  rm_rf "tmp/package"
  mkdir_p "tmp/package"

  sh "git archive --format=tar --output=tmp/package/stif-boiv-release-#{release_name}.tar HEAD"

  sh "bundle package --all"
  sh "tar -rf tmp/package/stif-boiv-release-#{release_name}.tar vendor/cache"

  %w{deploy-helper.sh README sidekiq-stif-boiv.service stif-boiv.conf stif-boiv-setup.sh template-stif-boiv.sql}.each do |f|
    cp "install/#{f}", "tmp/package/#{f}"
  end

  sh "tar -czf stif-boiv-#{release_name}.tar.gz -C tmp/package ."
  sh "rm -rf tmp/package vendor/cache"
end