This repository has been archived by the owner on May 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCapfile
66 lines (42 loc) · 1.85 KB
/
Capfile
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
48
49
50
51
52
53
54
55
56
57
58
59
60
# This should be edited and renamed to Capfile before being able
# to use Capistrano
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
ssh_options[:forward_agent] = true
default_run_options[:pty] = true
set :application, "favrik.com"
set :repository, "git@github.com:favrik/favrik.com.git"
set :scm, :git
set :deploy_via, :remote_cache
set :user, "favio"
set :scm_username, "favrik"
set :use_sudo, false
set :jekyll, "/var/lib/gems/1.8/bin/jekyll --lsi --pygments --rdiscount --permalink /:year/:month/:day/:title"
namespace :deploy do
task :restart, :roles => :app, :except => { :no_release => true } do
# Do nothing!
end
task :website_setup do
run "cd #{current_release}/blog"
run "#{jekyll} #{current_release}/blog #{current_release}/blog/_site"
run "cp #{current_release}/blog/_site/recent_posts.html #{current_release}/website/_includes"
run "cd #{current_release}/website"
run "#{jekyll} #{current_release}/website #{current_release}/website/_site"
end
task :site_symlinks do
# Common CSS files for website and blog
run "ln -s #{current_release}/website/css #{current_release}/blog/_site/css"
#run "mv #{current_release}/blog/_site/recent_posts.html #{current_release}/blog/_site/recent_posts.js"
# Jobs symlink
run "mkdir -p #{current_release}/website/_site/projects"
run "ln -s /home/web/favrik.com/jobs #{current_release}/website/_site/projects/jobs"
run "ln -s /home/web/favrik.com/imgsite #{current_release}/website/_site/imgsite"
end
after "deploy:symlink", "deploy:website_setup"
after "deploy", "deploy:cleanup"
end
task :prod do
role :web, "74.207.249.87"
set :branch, "master"
set :deploy_to, "/home/web/favrik.com/deploy"
after "deploy:website_setup", "deploy:site_symlinks"
end