Sha256: daff5e05e5a8afad04f7d56f499abbd40c8fa43438f21ce97510c2ac58f55417

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 KB

Contents

#!/usr/bin/env ruby

#
# This script creates a file 'after_deploy.rb' in your config directory.   
# You should run it inside of your project directory.
#                                                      

Dir.mkdir "./config" if !File.directory? './config'
                                                    
config_file = File.open "./config/after_deploy.rb", "w"
raise "A error has been occured while trying to write to $(pwd)/config/after_deploy.rb. Not enough permission?" if config_file.nil?  

config_file.write %{#!/usr/bin/env ruby

#
# This script is launched by post-receive hook when push is completed.
# The general purpose of this script is to run bundler, migration and
# other commands that you want to launch after deployment.
#
require 'rubygems'
require 'pushdeploy'

PushDeploy.new(ARGV) do
    bundle   
    migrate   
    run "touch #{@deploy_to}/tmp/restart.txt" 
end
}

puts "\n*************************************"
puts "\e[00;32mConfig has been successfully created!\e[00m"
puts "*************************************\n"

puts "You can edit " + `pwd`.chop + "/config/after_deploy.rb to add commands that you want to run after deployment.\n\n"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pushdeploy-0.0.18 bin/pushdeploy_create_config