diff options
| author | davidtsadler <davidtsadler@googlemail.com> | 2012-03-31 18:43:16 +0100 |
|---|---|---|
| committer | davidtsadler <davidtsadler@googlemail.com> | 2012-03-31 18:43:16 +0100 |
| commit | 4e3d62f7b78b8ba1efd26d33851083da1ea7f4bc (patch) | |
| tree | 0fd1da5e0a30863ea84a08da72f5b70852a0d5d9 | |
| parent | f8c49ac2c77cf53aeaf6cc9b9413532343cfa2bf (diff) | |
| parent | 17f53ef0628ace4c63909331243bf3a01a7c1944 (diff) | |
Merge remote-tracking branch 'upstream/master'
| -rw-r--r-- | Rakefile | 12 | ||||
| -rw-r--r-- | _config.yml.example | 11 |
2 files changed, 21 insertions, 2 deletions
@@ -9,8 +9,16 @@ namespace :site do desc 'Builds the site and deploys it locally using the built in server.' task :development => [:'env:development', :'build:development'] - desc 'Builds the site and deploys it to a remote server.' - task :production => [:'env:production', :'build:production'] + desc 'Builds the site and deploys it to a remote server using rsync over ssh.' + task :production => [:'env:production', :'build:production'] do + config = @config['deployment'] || {} + host = config['host'] || ask('Host?', nil, lambda { |answer| !answer.empty? }, 'You must enter a host') + user = config['user'] || ask('User?', nil, lambda { |answer| !answer.empty? }, 'You must enter a user') + port = config['port'] || ask('Port?', '22', lambda { |answer| !answer.empty? }, 'You must enter a port number') + dir = config['directory'] || ask('Directory?', nil, lambda { |answer| !answer.empty? }, 'You must enter a directory') + + system("rsync -avz --delete --rsh='ssh -p#{port}' #{@config['destination']}/ #{user}@#{host}:#{dir}") + end end namespace :build do diff --git a/_config.yml.example b/_config.yml.example index ee03a07..a74779b 100644 --- a/_config.yml.example +++ b/_config.yml.example @@ -101,3 +101,14 @@ plugins: _site_build/_plugins # *************************** # The number of test posts that will be generated by the task test_posts:create num_test_posts: 50 + +# *************************** +# DEPLOYMENT +# *************************** +# These options are used by the Rake task site:deploy:production. +# The task will prompt you for any values that you do not wish to specifiy within the configuration file. +#deployment: +# host: +# user: +# port: +# directory: |
