Skip to content

Instantly share code, notes, and snippets.

@DrewDahlman
Last active May 5, 2019 21:33
Show Gist options
  • Save DrewDahlman/9f86bbb320966e1fed84f85b1445628b to your computer and use it in GitHub Desktop.
Save DrewDahlman/9f86bbb320966e1fed84f85b1445628b to your computer and use it in GitHub Desktop.
Deploy.rb condfigured
set :application, "wordpress-workflow"
set :repo_url, "[email protected]:DrewDahlman/wordpress-workflow.git"
set :user, 'www-data'
# Default value for :scm is :git
set :scm, :git
# Default value for :format is :pretty
set :format, :pretty
# Default value for :log_level is :debug
set :log_level, :debug
# Default value for :pty is false
set :pty, true
# Set Sudo
set :use_sudo, false
set :linked_dirs, %w{node_modules wordpress/wp-content/uploads}
#--------------------------------------------------------------
#
# On Deploy run NPM and build.
#
#--------------------------------------------------------------
namespace :deploy do
desc 'Restart application'
task :build do
on roles(:app), in: :sequence, wait: 1 do
set :current_path, "#{fetch(:deploy_to)}/current"
execute "cd #{fetch(:current_path)} && mv build-files/* #{fetch(:current_path)}"
execute "cd #{fetch(:current_path)} && npm install"
execute "cd #{fetch(:current_path)} && gulp dist -e production"
end
end
after :updated, :restart
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment