-
-
Save jayshreeanand/ab8a3837adcd7e7461e1c0759685501c to your computer and use it in GitHub Desktop.
Revisions
-
abhionlyone revised this gist
May 24, 2018 . No changes.There are no files selected for viewing
-
abhionlyone created this gist
May 24, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ require "capistrano/setup" require "capistrano/deploy" require "capistrano/scm/git" require 'capistrano/npm' install_plugin Capistrano::SCM::Git Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ # frozen_string_literal: true source "https://rubygems.org" git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } gem 'capistrano', '~> 3.10', '>= 3.10.2' gem 'capistrano-npm' This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ # config/deploy.rb # config valid for current version and patch releases of Capistrano lock "~> 3.10.2" set :application, "app-name" set :repo_url, "[email protected]:username/app-name.git" set :ssh_options, { :forward_agent => true } set :npm_flags, '--silent --no-progress' namespace :deploy do desc 'Restart application' task :restart do invoke 'react:build' end end after 'deploy:publishing', 'deploy:restart' This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ # lib/capistrano/tasks/react.rake namespace :react do desc 'RUN NPM BUILD' task :build do on roles(:app) do execute "sh -c \"cd #{deploy_to}/current/ && #{fetch(:build_command)}\"" end end end
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ # config/deploy/staging.rb set :branch, 'staging' set :deploy_to, 'path_to_staging' server 'your-server-ip-here', user: 'user', port: 22, roles: %w{web app db} set :build_command, 'npm run build'