Skip to content

Instantly share code, notes, and snippets.

@0xF013
Created August 14, 2016 08:37
Show Gist options
  • Save 0xF013/838beedd7fd11ecf8df5ff00ee56cb51 to your computer and use it in GitHub Desktop.
Save 0xF013/838beedd7fd11ecf8df5ff00ee56cb51 to your computer and use it in GitHub Desktop.
namespace :npm do
desc 'setups frontend and deploys in to /public dir'
task :setup_frontend do
on roles(:all) do
within release_path do
api_env = fetch(:api_env, :dev)
execute "cd #{release_path}/frontend \
&& npm install --silent --no-spin \
&& API_ENV=#{api_env} npm run build-prod \
&& ln -s ../REVISION ../public/version.txt \
"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment