Skip to content

Commit 041550f

Browse files
committed
Add Rakefile and update README.
1 parent cf98b3a commit 041550f

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@ You can use this as a start point for managing a WordPress install with git.
33
In it's current state, all you need to do is clone this repo, `git submodule update --init` then copy `wp-config-sample.php` to `wp-config.php`, update your database settings, and your default theme.
44

55
See '[Install and manage WordPress with Git](http://davidwinter.me/articles/2012/04/09/install-and-manage-wordpress-with-git/)' for more details.
6+
7+
## Updating WordPress
8+
9+
You can use the Rake helper task to upgrade WordPress to a specific version:
10+
11+
rake wordpress_update[3.7.1]

Rakefile

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
task :default => [:install]
2+
3+
desc 'Setup subrepository'
4+
task :install do
5+
system 'git submodule update --init'
6+
end
7+
8+
# Usage:
9+
#
10+
# rake wordpress_update[3.7.1]
11+
#
12+
desc 'Update Wordpress'
13+
task :wordpress_update, :version do |t, args|
14+
puts args[:version]
15+
commands = [
16+
'git pull',
17+
'cd wordpress',
18+
'git checkout master',
19+
'git fetch --tags',
20+
"git checkout #{args[:version]}",
21+
'cd ..',
22+
'git add wordpress',
23+
"git commit -m 'Update Wordpress to #{args[:version]}'",
24+
'git push',
25+
]
26+
27+
system commands.join(' && ')
28+
end

0 commit comments

Comments
 (0)