This repository has been archived by the owner on Jun 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Rakefile
48 lines (40 loc) · 1.9 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require 'bundler'
Bundler.require :rake
begin
require "vlad"
Vlad.load(:app => nil, :scm => "git", :web => nil)
rescue LoadError
# do nothing
end
require File.expand_path('../config/application', __FILE__)
Propile::Application.load_tasks
desc "release version defined in VERSION to PROD + puts tag in git -fails if already released"
task "release" do
releaseline = File.readlines('VERSION').first.strip
p releaseline
version = releaseline[/[^\s]*/]
raise "Version #{version} has invalid format" unless version =~ /\d*\.\d*.\d*/
raise "Tag #{version} was released earlier" if `git tag`.split.include?(version)
message = "Released " + releaseline
sh "git tag -a -m '#{message}' #{version}"
sh 'rake vlad:deploy:migrate to=prod'
end
desc "Get the production database and copy to local development"
task "get_prod_db" do
sh 'scp [email protected]:propile-prod/data/production.sqlite3 data/development.sqlite3'
end
desc "Get the production database and copy to remote test"
task "get_prod_db_to_test" do
sh 'ssh [email protected] cp -v propile-test/data/development.sqlite3 propile-test/data/development.sqlite3.backup'
sh 'ssh [email protected] cp -v propile-prod/data/production.sqlite3 propile-test/data/development.sqlite3'
end
desc "extract public program from propile.xpday.net as static pages to publish on xpdays.net"
task "extract_public_program" do
sh 'ssh [email protected] rm -rf tmp/public_program'
sh 'ssh [email protected] wget -E -m -nH -k -P tmp/public_program http://localhost:3000/programs/public '
sh 'ssh [email protected] rm -rf public/public_program'
sh 'ssh [email protected] mv tmp/public_program public'
end