itrigga-cap_deploy 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/itrigga/cap_deploy/cap_tasks.rb +10 -9
- data/lib/itrigga/cap_deploy/filesystem_utils.rb +16 -0
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
@@ -64,7 +64,7 @@ configuration.load do
|
|
64
64
|
|
65
65
|
task :symlink_site_cache_dir do
|
66
66
|
puts "Removing existing symlink from /tmp/cache/sites"
|
67
|
-
|
67
|
+
remove_dir_if_exists( "#{web_dir}/tmp/cache" )
|
68
68
|
|
69
69
|
puts "Creating /shared/cache/sites dir if needed"
|
70
70
|
run "mkdir -p #{shared_dir}/cache/sites && #{sudo} chown -R #{user} #{shared_dir}/cache"
|
@@ -75,11 +75,12 @@ configuration.load do
|
|
75
75
|
end
|
76
76
|
|
77
77
|
task :regenerate_monit do
|
78
|
-
puts "regenerating monit config file"
|
79
|
-
|
78
|
+
puts "regenerating monit config file(s)"
|
79
|
+
remove_dir_if_exists("#{web_dir}/config/monit")
|
80
|
+
run "mkdir -p #{web_dir}/config/monit"
|
80
81
|
run "cd #{web_dir} && ruby script/generate monit"
|
81
82
|
puts "setting permissions & ownership on monit config files"
|
82
|
-
|
83
|
+
set_permissions_on_files_in_dir( :dir=>"#{web_dir}/config/monit", :ownership=>"root", :permissions=>"0700")
|
83
84
|
end
|
84
85
|
|
85
86
|
task :resymlink_monit do
|
@@ -95,10 +96,10 @@ configuration.load do
|
|
95
96
|
|
96
97
|
task :regenerate_logrotate do
|
97
98
|
puts "regenerating logrotate config file"
|
98
|
-
|
99
|
+
remove_dir_if_exists( "#{web_dir}/config/log_rotate" )
|
99
100
|
run "cd #{web_dir} && ruby script/generate logrotate"
|
100
101
|
puts "setting permissions & ownership on logrotate config files"
|
101
|
-
|
102
|
+
set_permissions_on_files_in_dir( :dir=>"#{web_dir}/config/log_rotate", :ownership=>"root", :permissions=>"0700" )
|
102
103
|
end
|
103
104
|
|
104
105
|
task :resymlink_logrotate do
|
@@ -117,17 +118,17 @@ configuration.load do
|
|
117
118
|
task :regenerate_db_scripts do
|
118
119
|
puts "regenerating db scripts"
|
119
120
|
|
120
|
-
|
121
|
+
remove_dir_if_exists( "#{web_dir}/script/db" )
|
121
122
|
run "cd #{web_dir} && ruby script/generate db"
|
122
123
|
|
123
124
|
puts "setting permissions & ownership on cron and db scripts"
|
124
|
-
|
125
|
+
set_permissions_on_files_in_dir( :dir=>"#{web_dir}/script/db", :ownership=>"root", :permissions=>"0700" )
|
125
126
|
end
|
126
127
|
|
127
128
|
task :regenerate_cron_scripts do
|
128
129
|
puts "regenerating cron scripts"
|
129
130
|
|
130
|
-
|
131
|
+
remove_dir_if_exists( "#{web_dir}/script/cron" )
|
131
132
|
run "cd #{web_dir} && ruby script/generate cron"
|
132
133
|
|
133
134
|
puts "setting permissions & ownership on cron scripts"
|
@@ -25,3 +25,19 @@
|
|
25
25
|
run "test -d #{dir} || #{sudo} mkdir -p #{dir}"
|
26
26
|
end
|
27
27
|
|
28
|
+
def remove_file_if_exists( file )
|
29
|
+
run "(test -f #{file} && #{sudo} rm #{file}) || echo 'no existing #{file} file to remove'"
|
30
|
+
end
|
31
|
+
|
32
|
+
def remove_dir_if_exists( dir )
|
33
|
+
run "(test -d #{dir} && #{sudo} rm -rf #{dir}) || echo 'no existing #{dir} dir to remove'"
|
34
|
+
end
|
35
|
+
|
36
|
+
def set_permissions_on_files_in_dir( opts )
|
37
|
+
if opts[:ownership]
|
38
|
+
run "(test -d #{opts[:dir]} && #{sudo} chown #{opts[:ownership]} #{opts[:dir]}/* ) || echo couldnt find #{opts[:dir]}"
|
39
|
+
end
|
40
|
+
if opts[:permissions]
|
41
|
+
run "(test -d #{opts[:dir]} && #{sudo} chmod #{opts[:permissions]} #{opts[:dir]}/* ) || echo couldnt find #{opts[:dir]}"
|
42
|
+
end
|
43
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itrigga-cap_deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 4
|
10
|
+
version: 0.1.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Al Davidson
|