Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: osbridge/osbp_automateit
base: c9f06d07f0
...
head fork: osbridge/osbp_automateit
compare: a5f8958517
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
Commits on May 09, 2012
@igal igal my_bridgepdx_wiki_2009: Don't move aside /var/www/bridgepdx_wiki. 5cb8896
@igal igal my_bridgepdx_wiki: Switch to a unified wiki.
In the past there was a wiki per year. Now there's a single unified wiki.
* All old recipes are replaced with a single one.
* New rewrite rules retain access to old URLs.
* Update cronjobs to add new dumper and remove old dumpers.
* Recipe abandons old wiki files and removes all access to them, but the
  old files are left behind for manual removal.
a5f8958
View
26 dist/etc/apache2/sites-available/bridgepdx_wordpress.erb
@@ -39,21 +39,17 @@
# Stats
Alias /stats /var/www/bridgepdx_stats
- # Attendee wiki redirect
- RewriteRule ^/w(/.*)?$ /2011/w$1 [L,R]
- RewriteRule ^/wiki(/.*)?$ /2011/wiki$1 [L,R]
-
- # Attendee wiki's scripts
- Alias /2009/w /var/www/bridgepdx_wiki_2009
- Alias /2010/w /var/www/bridgepdx_wiki_2010
- Alias /2011/w /var/www/bridgepdx_wiki_2011
-
- # Attendee wiki's pages
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule ^/2009/wiki(/.*)?$ /var/www/bridgepdx_wiki_2009/index.php?title=$1 [L,QSA]
- RewriteRule ^/2010/wiki(/.*)?$ /var/www/bridgepdx_wiki_2010/index.php?title=$1 [L,QSA]
- RewriteRule ^/2011/wiki(/.*)?$ /var/www/bridgepdx_wiki_2011/index.php?title=$1 [L,QSA]
+ ### Unified MediaWiki
+ # Redirect old pages
+ RewriteRule ^/(\d{4})/wiki(/.*)?$ /wiki/$1$2 [L,R]
+ # Redirect base requests
+ RewriteRule ^/wiki/?$ /wiki/Main_Page [R]
+ # Redirect year requests
+ RewriteRule ^/wiki/(\d{4})/?$ /wiki/$1/Main_Page [R]
+ # Render pages
+ RewriteRule ^/wiki/(.+)$ /var/www/bridgepdx_wiki/index.php?title=$1 [L,QSA]
+ # Serve API requests
+ RewriteRule ^/wiki-raw/(.+)$ /var/www/bridgepdx_wiki/$1 [L,QSA]
# Proxy
ProxyRequests off
View
4 recipes/all.rb
@@ -60,9 +60,7 @@
invoke 'my_bridgepdx_user'
invoke 'my_bridgepdx_common' # Relies on my_apache, my_bridgepdx_user
invoke 'my_bridgepdx_wordpress' # Relies on my_bridgepdx_common, my_apache, base_php5, base_mysql, my_bridgepdx_user
- invoke 'my_bridgepdx_wiki_2009' # Relies on my_bridgepdx_wordpress, my_apache, base_php5, base_mysql
- invoke 'my_bridgepdx_wiki_2010' # Relies on my_bridgepdx_wordpress, my_apache, base_php5, base_mysql
- invoke 'my_bridgepdx_wiki_2011' # Relies on my_bridgepdx_wordpress, my_apache, base_php5, base_mysql
+ invoke 'my_bridgepdx_wiki' # Relies on my_bridgepdx_wordpress, my_apache, base_php5, base_mysql
invoke 'my_bridgepdx_ocw' # Relies on my_apache, my_ruby, my_bridgepdx_user
invoke 'my_bridgepdx_secrets' # Relies on my_apache, base_php5, my_bridgepdx_user
invoke 'my_bridgepdx_stats' # Relies on my_apache, base_php5, my_bridgepdx_user
View
5 recipes/my_bridgepdx_wiki_2010.rb → recipes/my_bridgepdx_wiki.rb
@@ -2,11 +2,14 @@
# NOTE Apache site is managed by the 'my_bridgepdx_wordpress' recipe.
# Create directory
-sitedir = "/var/www/bridgepdx_wiki_2010"
+sitedir = "/var/www/bridgepdx_wiki"
mkdir_p(sitedir) and chperm(sitedir, :user => default_user, :group => default_group)
# Add task to dump database to file
cronedit(default_user) do
append "18 * * * * if test -f #{sitedir}/LocalSettings.php; then (cd #{sitedir} && rake --silent dump); fi"
+
+ # Delete previous cronjobs from back when there was a wiki per year
+ delete %r{18 \* \* \* \* if test -f #{sitedir}_\d{4}/LocalSettings.php; then \(cd #{sitedir}_\d{4} \&\& rake --silent dump\); fi}
end
View
22 recipes/my_bridgepdx_wiki_2009.rb
@@ -1,22 +0,0 @@
-# Setup attendee wiki.
-# NOTE Apache site is managed by the 'my_bridgepdx_wordpress' recipe.
-
-# The app used to live at another directory
-old_dir = "/var/www/bridgepdx_wiki"
-sitedir = "/var/www/bridgepdx_wiki_2009"
-
-# Move directory over if found
-if mv(old_dir, sitedir)
- service_manager.tell "apache2", "reload"
-end
-
-# Create directory
-mkdir_p(sitedir) and chperm(sitedir, :user => default_user, :group => default_group)
-
-# Add task to dump database to file
-cronedit(default_user) do
- delete "17 * * * * (cd #{old_dir} && rake --silent dump)"
- delete "18 * * * * if test -f #{old_dir}/Rakefile; then (cd #{old_dir} && rake --silent dump); fi"
- delete "18 * * * * if test -f #{old_dir}/LocalSettings.php; then (cd #{old_dir} && rake --silent dump); fi"
- append "18 * * * * if test -f #{sitedir}/LocalSettings.php; then (cd #{sitedir} && rake --silent dump); fi"
-end
View
12 recipes/my_bridgepdx_wiki_2011.rb
@@ -1,12 +0,0 @@
-# Setup attendee wiki.
-# NOTE Apache site is managed by the 'my_bridgepdx_wordpress' recipe.
-
-# Create directory
-sitedir = "/var/www/bridgepdx_wiki_2011"
-mkdir_p(sitedir) and chperm(sitedir, :user => default_user, :group => default_group)
-
-# Add task to dump database to file
-cronedit(default_user) do
- append "18 * * * * if test -f #{sitedir}/LocalSettings.php; then (cd #{sitedir} && rake --silent dump); fi"
-end
-

No commit comments for this range

Something went wrong with that request. Please try again.