Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tillräckligt bra

  • Loading branch information...
commit 7b91c9641223a859890ac71a9e50bbd98b99f82d 1 parent ec8292e
@dvrensk authored
View
2  .gitignore
@@ -1 +1 @@
-wordpressmall.zip
+/build/
View
23 projektnamn/config/deploy.rb
@@ -5,12 +5,12 @@
# fs-data :-)
set :home, "/home/#{user[0,1]}/#{user}"
-set :scm, "git"
set :scm_command, "#{home}/bin/git"
-set :local_scm_command, :default
# Inget att ändra efter den här raden.
+set :scm, "git"
+set :local_scm_command, :default
set :scm_verbose, true # eftersom git-reset inte tar -q i den här versionen...
set :branch, "master"
set :deploy_via, :remote_cache
@@ -37,13 +37,22 @@
run <<-CMD
rm -rf #{latest_release}/wordpress/wp-config.php \
#{latest_release}/wordpress/.htaccess \
- #{latest_release}/wordpress/wp-content/uploads &&
- cp #{shared_path}/system/wp-config.php #{latest_release}/wordpress &&
- cp #{shared_path}/system/dot_htaccess #{latest_release}/wordpress/.htaccess &&
+ #{latest_release}/wordpress/wp-content/uploads \
+ #{latest_release}/.git &&
ln -s #{shared_path}/uploads #{latest_release}/wordpress/wp-content &&
- chmod -R u-w #{latest_release}/wordpress/wp-content/themes/nos2008
+ chmod -R u-w #{latest_release}/wordpress/wp-content/themes
CMD
+ # Prefer files from the repo but use files in system/ otherwise
+ [%w(wp-config.php wp-config.php), %w(dot_htaccess .htaccess)].each do |(source, target)|
+ if File.exists?(File.join(File.dirname(__FILE__), source))
+ dir = "#{latest_release}/config"
+ else
+ dir = "#{shared_path}/system"
+ end
+ run "cp #{dir}/#{source} #{latest_release}/wordpress/#{target}"
+ end
+
if fetch(:normalize_asset_timestamps, true)
stamp = Time.now.utc.strftime("%Y%m%d%H%M.%S")
run "find #{latest_release}/wordpress/wp-content/themes -exec touch -t #{stamp} {} ';'; true", :env => { "TZ" => "UTC" }
@@ -68,8 +77,6 @@
after 'deploy:setup', 'deploy:warn_about_known_hosts'
end
-# Plockat från http://www.madebymany.co.uk/using-capistrano-with-php-specifically-wordpress-0087
-# och http://www.whomwah.com/2006/05/21/deploying-wordpress-using-capistrano/
namespace :wordpress do
task :setup do
run "touch #{shared_path}/system/dot_htaccess"
View
10 projektnamn/double_click_to_install
@@ -140,11 +140,11 @@ class WpProjectInstaller
File.open conf_file, "a" do |f|
str = <<-EOT
- <VirtualHost *:80 *:8000>
- ServerAdmin webmaster.#{vhost.sub(/\..+/,'')}@#{hostname}
- DocumentRoot #{path}
- ServerAlias #{vhost}
- </VirtualHost>
+<VirtualHost *:80 *:8000>
+ ServerAdmin webmaster.#{vhost.sub(/\..+/,'')}@#{hostname}
+ DocumentRoot #{path}
+ ServerAlias #{vhost}
+</VirtualHost>
EOT
f.puts str
end
Please sign in to comment.
Something went wrong with that request. Please try again.