From 10ed79e242de1e7fe56568f7fc46b46e8b50f11a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Figueiredo?= Date: Fri, 24 Mar 2017 12:01:49 +0100 Subject: [PATCH 1/8] Capistrano Initial Config --- Capfile | 14 +++++++++++ Gemfile | 9 +++++++ config/deploy.rb | 65 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 Capfile create mode 100644 Gemfile create mode 100644 config/deploy.rb diff --git a/Capfile b/Capfile new file mode 100644 index 0000000..c501a97 --- /dev/null +++ b/Capfile @@ -0,0 +1,14 @@ +# Load DSL and Setup Up Stages +require 'capistrano/setup' +# Includes default deployment tasks +require 'capistrano/deploy' +# Load tasks from gems +require 'capistrano/composer' +# Loads custom tasks from `lib/capistrano/tasks' if you have any defined. +# Customize this path to change the location of your custom tasks. +Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r } +require 'capistrano-nc/nc' +load 'config/deploy/cap_notify.rb' +require 'capistrano/memcached' +require 'slackistrano' +require 'capistrano/npm' diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..175a9ba --- /dev/null +++ b/Gemfile @@ -0,0 +1,9 @@ +source 'https://rubygems.org' +gem 'capistrano', '~> 3.3.5' +gem 'capistrano-composer' +gem 'capistrano-wpcli' +gem 'capistrano-nc', '~> 0.1' +gem 'actionmailer', '~> 4.2.0' +gem 'capistrano-memcached', '~> 1.0' +gem 'slackistrano', require: false +gem 'capistrano-npm' diff --git a/config/deploy.rb b/config/deploy.rb new file mode 100644 index 0000000..3e9c68d --- /dev/null +++ b/config/deploy.rb @@ -0,0 +1,65 @@ +set :application, 'gientta-skeleton' +set :repo_url, 'git@github.com:ginetta/skeleton.git' +set :default_env, { path: "/usr/local/bin:$PATH" } + +set :keep_releases, 2 + +set :nc_terminal, 'com.googlecode.iterm2' + +set :cap_notify_emails, [ 'tech@ttss.ch' ] +set :cap_notify_from, 'support@ginetta.net' +set :cap_notify_callsign, 'GINETTA' +set :cap_notify_latest_commit, proc { `git rev-parse HEAD`.strip } + +# ttss channel +# set :slack_webhook, "https://hooks.slack.com/services/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" +# ginetta channel +set :slack_webhook, "https://hooks.slack.com/services/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" + +# Maybe required for restarting memcached but fails +# set :pty, true + +# Branch options +# Prompts for the branch name (defaults to current branch) +#ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp } + +# Sets branch to current one +#set :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp } + +# Hardcodes branch to always be master +# This could be overridden in a stage config file +set :branch, :master + +set :deploy_to, -> { "/var/www/vhosts/#{fetch(:application)}" } + +set :log_level, :info +# set :log_level, :debug + +set :linked_files, %w{.env web/.htaccess} +set :linked_dirs, %w{web/app/uploads web/app/ewww} + +namespace :deploy do + desc "Send email notification" + task :send_notification do + Notifier.deploy_notification(self).deliver_now + end + + desc 'Update WordPress translations' + task :update_wp_translations do + on roles(:app) do + within fetch(:release_path) do + execute "wp core language update --path='#{fetch(:release_path)}/web/wp' --debug" + end + end + end +end + + +set :npm_target_path, -> { release_path.join('subdir') } # default not set +set :npm_flags, '--silent --no-progress' # default +set :npm_roles, :all # default +set :npm_env_variables, {} # default + +after :deploy, 'deploy:send_notification' +# after 'deploy:finishing', 'deploy:update_wp_translations' +# after 'deploy:publishing', 'memcached:restart' From 39272fd8ac37fad8c50228903382bd5ffa8b7157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Figueiredo?= Date: Fri, 24 Mar 2017 12:06:59 +0100 Subject: [PATCH 2/8] Add public symlink --- public | 1 + 1 file changed, 1 insertion(+) create mode 120000 public diff --git a/public b/public new file mode 120000 index 0000000..c795b05 --- /dev/null +++ b/public @@ -0,0 +1 @@ +build \ No newline at end of file From 9de0ddc44212dc1b1c77b1530a449c3dff63ee8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Figueiredo?= Date: Fri, 24 Mar 2017 12:13:27 +0100 Subject: [PATCH 3/8] Change capistrano task --- config/deploy.rb | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/config/deploy.rb b/config/deploy.rb index 3e9c68d..86871fd 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -35,31 +35,29 @@ set :log_level, :info # set :log_level, :debug -set :linked_files, %w{.env web/.htaccess} -set :linked_dirs, %w{web/app/uploads web/app/ewww} +# set :linked_files, %w{.env web/.htaccess} +set :linked_files, %w{.env} +# set :linked_dirs, %w{web/app/uploads web/app/ewww} namespace :deploy do - desc "Send email notification" - task :send_notification do - Notifier.deploy_notification(self).deliver_now - end - - desc 'Update WordPress translations' - task :update_wp_translations do - on roles(:app) do - within fetch(:release_path) do - execute "wp core language update --path='#{fetch(:release_path)}/web/wp' --debug" - end - end - end + desc "Installs npm dependencies" + task :npm_install, :roles => :app, :except => { :no_release => true } do + run "npm install" + end + + desc "Build source code into static assets" + task :npm_build, :roles => :app, :except => { :no_release => true } do + run "npm run build" + end end +# by default it only installs dependencies. We remove the --production flag +# so it also installs devDependencies +set :npm_flags, '--silent --no-progress' -set :npm_target_path, -> { release_path.join('subdir') } # default not set -set :npm_flags, '--silent --no-progress' # default -set :npm_roles, :all # default -set :npm_env_variables, {} # default after :deploy, 'deploy:send_notification' +before 'deploy', 'deploy:npm_install' +before 'deploy', 'deploy:npm_build' # after 'deploy:finishing', 'deploy:update_wp_translations' # after 'deploy:publishing', 'memcached:restart' From 73814786026a8670cd94d86cc50b9744d98efef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Figueiredo?= Date: Fri, 24 Mar 2017 12:28:30 +0100 Subject: [PATCH 4/8] Setting up Capistrano deployment --- config/deploy/cap_notify.rb | 67 ++++++++++++++++++++++++++++++++++++ config/deploy/development.rb | 23 +++++++++++++ config/deploy/production.rb | 26 ++++++++++++++ config/deploy/staging.rb | 27 +++++++++++++++ 4 files changed, 143 insertions(+) create mode 100644 config/deploy/cap_notify.rb create mode 100644 config/deploy/development.rb create mode 100644 config/deploy/production.rb create mode 100644 config/deploy/staging.rb diff --git a/config/deploy/cap_notify.rb b/config/deploy/cap_notify.rb new file mode 100644 index 0000000..85ab28c --- /dev/null +++ b/config/deploy/cap_notify.rb @@ -0,0 +1,67 @@ +=begin +Capistrano deployment email notifier for Rails 3 + +Do you need to send email notifications after application deployments? + +Christopher Sexton developed a Simple Capistrano email notifier for rails. You can find details at http://www.codeography.com/2010/03/24/simple-capistrano-email-notifier-for-rails.html. + +Here is Rails 3 port of the notifier. + +The notifier sends an email after application deployment has been completed. + +How to use it? + + 1. Add this file to config/deploy folder. + 2. Update the file with your google credentials and from email address. + 3. Add the following content to config/deploy.rb. + + require 'config/deploy/cap_notify.rb' + + # add email addresses for people who should receive deployment notifications + set :notify_emails, ['EMAIL1@YOURDOMAIN.COM', 'EMAIL2@YOURDOMAIN.COM'] + + after :deploy, 'deploy:send_notification' + + # Create task to send a notification + namespace :deploy do + desc 'Send email notification' + task :send_notification do + Notifier.deploy_notification(self).deliver + end + end + + 4. Update deploy.rb with destination email addresses for the notifications. + 5. To test run this command: + + cap deploy:send_notification + bundle exec cap production deploy:send_notification + +=end + +require 'action_mailer' + +ActionMailer::Base.delivery_method = :smtp +ActionMailer::Base.smtp_settings = { + :enable_starttls_auto => false, + :tls => false, + :ssl => true, + :address => '', + :port => 465, + :domain => '', + :authentication => '', + :user_name => '', + :password => '' +} + +class Notifier < ActionMailer::Base + default :from => '' + def deploy_notification(cap_vars) + now = Time.now + + mail(:to => fetch(:cap_notify_emails), + :subject => "") do |format| + format.text { render :text => msg} + format.html { render :text => "

" + msg + "<\p>"} + end + end +end diff --git a/config/deploy/development.rb b/config/deploy/development.rb new file mode 100644 index 0000000..82de793 --- /dev/null +++ b/config/deploy/development.rb @@ -0,0 +1,23 @@ +set :stage, :development + +# Simple Role Syntax +# ================== +#role :app, %w{deploy@example.com} +#role :web, %w{deploy@example.com} +#role :db, %w{deploy@example.com} + +# Extended Server Syntax +# ====================== +server 'atlantis', user: 'deploy', roles: %w{web app db} + +# you can set custom ssh options +# it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options +# you can see them in [net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start) +# set it globally +# set :ssh_options, { +# keys: %w(~/.ssh/id_rsa), +# forward_agent: false, +# auth_methods: %w(password) +# } + +fetch(:default_env).merge!(wp_env: :production) diff --git a/config/deploy/production.rb b/config/deploy/production.rb new file mode 100644 index 0000000..731d137 --- /dev/null +++ b/config/deploy/production.rb @@ -0,0 +1,26 @@ +set :stage, :production + +set :deploy_to, -> { "/var/www/vhosts/#{fetch(:application)}" } + +# Simple Role Syntax +# ================== +#role :app, %w{deploy@example.com} +#role :web, %w{deploy@example.com} +#role :db, %w{deploy@example.com} + +# Extended Server Syntax +# ====================== +server 'compute-01.stage.ginetta.net', user: 'deploy', roles: %w{web app db} +#server 'DUMMY.LINK.DUM', user: 'deploy', roles: %w{web app db} + +# you can set custom ssh options +# it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options +# you can see them in [net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start) +# set it globally +# set :ssh_options, { +# keys: %w(~/.ssh/id_rsa), +# forward_agent: false, +# auth_methods: %w(password) +# } + +fetch(:default_env).merge!(wp_env: :production) diff --git a/config/deploy/staging.rb b/config/deploy/staging.rb new file mode 100644 index 0000000..686f0bf --- /dev/null +++ b/config/deploy/staging.rb @@ -0,0 +1,27 @@ +set :stage, :staging + +set :deploy_to, -> { "/var/www/vhosts/#{fetch(:application)}" } + +# Simple Role Syntax +# ================== +#role :app, %w{deploy@example.com} +#role :web, %w{deploy@example.com} +#role :db, %w{deploy@example.com} + +# Extended Server Syntax +# ====================== +# server 'endeavour', user: 'deploy', roles: %w{web app db} +# server 'www-ch.stage.ttss.ch', user: 'deploy', roles: %w{web app db} +server 'compute-01.stage.ginetta.net', user: 'deploy', roles: %w{web app db}, port: 2232 + +# you can set custom ssh options +# it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options +# you can see them in [net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start) +# set it globally +# set :ssh_options, { +# keys: %w(~/.ssh/id_rsa), +# forward_agent: false, +# auth_methods: %w(password) +# } + +fetch(:default_env).merge!(wp_env: :staging) From 8a5739a9ad80bc7d7426b84a3d25cb1cd3343e40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Figueiredo?= Date: Fri, 24 Mar 2017 15:29:40 +0100 Subject: [PATCH 5/8] Initial import. --- Makefile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..725e70f --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +# +# a Makefile for node based vhosts +# + +include .env + +all: + +# +# NDEPLOY +# +ndeploy_stage: + bundle exec cap -n staging deploy + +ndeploy_prod: + bundle exec cap -n production deploy + +# +# DEPLOY +# +deploy_stage: + bundle exec cap staging deploy + +deploy_prod: + bundle exec cap production deploy + # bundle exec cap -z node-x.foo.ch production deploy + +# +# DEPLOY ROLLBACK +# +deploy_stage_rollback: + bundle exec cap staging deploy:rollback + +deploy_prod_rollback: + bundle exec cap production deploy:rollback From c55e6172c33199948cdad157647b217ae3fb724c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Figueiredo?= Date: Fri, 24 Mar 2017 16:03:24 +0100 Subject: [PATCH 6/8] Initial import. --- .gitignore | 6 +++ Capfile | 38 ++++++++++++--- Gemfile | 32 +++++++++---- Makefile | 14 +++--- config/deploy.rb | 92 +++++++++++++++++++------------------ config/deploy/production.rb | 2 +- 6 files changed, 117 insertions(+), 67 deletions(-) diff --git a/.gitignore b/.gitignore index 7940c4c..b14e3ff 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,9 @@ node_modules *.orig .tmp npm-debug.log +.DS_Store +/.env +/log + +# AppFlow +/web/.htaccess diff --git a/Capfile b/Capfile index c501a97..4db04e1 100644 --- a/Capfile +++ b/Capfile @@ -1,14 +1,40 @@ +# Load DSL and Setup Up Stages +#require 'capistrano/setup' +# Includes default deployment tasks +#require 'capistrano/deploy' +# Load tasks from gems +#require 'capistrano/composer' +# Loads custom tasks from `lib/capistrano/tasks' if you have any defined. +# Customize this path to change the location of your custom tasks. +#Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r } +#require 'capistrano-nc/nc' +# load 'config/deploy/cap_notify.rb' +#require 'capistrano/memcached' +#require 'slackistrano' +#require 'capistrano/npm' + # Load DSL and Setup Up Stages require 'capistrano/setup' + # Includes default deployment tasks require 'capistrano/deploy' + # Load tasks from gems -require 'capistrano/composer' +# require 'capistrano/composer' + +require "capistrano/scm/git" +install_plugin Capistrano::SCM::Git + # Loads custom tasks from `lib/capistrano/tasks' if you have any defined. # Customize this path to change the location of your custom tasks. Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r } -require 'capistrano-nc/nc' -load 'config/deploy/cap_notify.rb' -require 'capistrano/memcached' -require 'slackistrano' -require 'capistrano/npm' + +# require 'capistrano-nc/nc' + +#load 'config/deploy/cap_notify.rb' + +require 'slackistrano/capistrano' + +#require 'capistrano/file-permissions' + +#require 'capistrano/npm' diff --git a/Gemfile b/Gemfile index 175a9ba..dc35d83 100644 --- a/Gemfile +++ b/Gemfile @@ -1,9 +1,25 @@ +#source 'https://rubygems.org' +#gem 'capistrano', '~> 3.3.5' +#gem 'capistrano-composer' +#gem 'capistrano-wpcli' +#gem 'capistrano-nc', '~> 0.1' +#gem 'actionmailer', '~> 4.2.0' +#gem 'capistrano-memcached', '~> 1.0' +#gem 'slackistrano', require: false +#gem 'capistrano-npm' + source 'https://rubygems.org' -gem 'capistrano', '~> 3.3.5' -gem 'capistrano-composer' -gem 'capistrano-wpcli' -gem 'capistrano-nc', '~> 0.1' -gem 'actionmailer', '~> 4.2.0' -gem 'capistrano-memcached', '~> 1.0' -gem 'slackistrano', require: false -gem 'capistrano-npm' + +gem "capistrano", "~> 3.6" + +#gem 'capistrano-composer' + +#gem 'capistrano-nc', '~> 0.1' + +#gem 'actionmailer', '~> 4.2.0' + +gem 'slackistrano' + +#gem 'capistrano-file-permissions' + +#gem 'capistrano-npm' diff --git a/Makefile b/Makefile index 725e70f..b4e9350 100644 --- a/Makefile +++ b/Makefile @@ -10,26 +10,26 @@ all: # NDEPLOY # ndeploy_stage: - bundle exec cap -n staging deploy + cap -n staging deploy ndeploy_prod: - bundle exec cap -n production deploy + cap -n production deploy # # DEPLOY # deploy_stage: - bundle exec cap staging deploy + cap staging deploy deploy_prod: - bundle exec cap production deploy - # bundle exec cap -z node-x.foo.ch production deploy + cap production deploy + # cap -z node-x.foo.ch production deploy # # DEPLOY ROLLBACK # deploy_stage_rollback: - bundle exec cap staging deploy:rollback + cap staging deploy:rollback deploy_prod_rollback: - bundle exec cap production deploy:rollback + cap production deploy:rollback diff --git a/config/deploy.rb b/config/deploy.rb index 86871fd..53485b1 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,63 +1,65 @@ -set :application, 'gientta-skeleton' -set :repo_url, 'git@github.com:ginetta/skeleton.git' -set :default_env, { path: "/usr/local/bin:$PATH" } +# config valid only for current version of Capistrano +lock "3.8.0" -set :keep_releases, 2 +set :application, "ginetta-skeleton" +set :repo_url, 'git@github.com:ginetta/skeleton.git' set :nc_terminal, 'com.googlecode.iterm2' -set :cap_notify_emails, [ 'tech@ttss.ch' ] -set :cap_notify_from, 'support@ginetta.net' -set :cap_notify_callsign, 'GINETTA' -set :cap_notify_latest_commit, proc { `git rev-parse HEAD`.strip } +# set :file_permissions_paths, [ ] +# set :file_permissions_groups, ["www-data"] -# ttss channel -# set :slack_webhook, "https://hooks.slack.com/services/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" -# ginetta channel -set :slack_webhook, "https://hooks.slack.com/services/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" +# set :cap_notify_emails, [ 'tech@ttss.ch' ] +# set :cap_notify_from, 'deploy@frontal.ch' +# set :cap_notify_callsign, 'EXAMPLE' +# set :cap_notify_latest_commit, proc { `git rev-parse HEAD`.strip } -# Maybe required for restarting memcached but fails -# set :pty, true +set :slackistrano, { + channel: '#s-ginetta-ttss', + webhook: 'https://hooks.slack.com/services/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' +} -# Branch options -# Prompts for the branch name (defaults to current branch) -#ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp } +# Default branch is :master +# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp -# Sets branch to current one -#set :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp } +# Default deploy_to directory is /var/www/my_app_name +set :deploy_to, -> { "/var/www/vhosts/#{fetch(:application)}" } -# Hardcodes branch to always be master -# This could be overridden in a stage config file -set :branch, :master +# set :log_level, :info +set :log_level, :debug -set :deploy_to, -> { "/var/www/vhosts/#{fetch(:application)}" } +# Default value for :format is :airbrussh. +# set :format, :airbrussh -set :log_level, :info -# set :log_level, :debug +# You can configure the Airbrussh format using :format_options. +# These are the defaults. +# set :format_options, command_output: true, log_file: "log/capistrano.log", color: :auto, truncate: :auto +# Default value for :pty is false +# set :pty, true + +# Default value for :linked_files is [] +# append :linked_files, "config/database.yml", "config/secrets.yml" # set :linked_files, %w{.env web/.htaccess} -set :linked_files, %w{.env} -# set :linked_dirs, %w{web/app/uploads web/app/ewww} -namespace :deploy do - desc "Installs npm dependencies" - task :npm_install, :roles => :app, :except => { :no_release => true } do - run "npm install" - end +# Default value for linked_dirs is [] +# append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/system" +# set :linked_dirs, %w{web/app/uploads web/app/ewww} - desc "Build source code into static assets" - task :npm_build, :roles => :app, :except => { :no_release => true } do - run "npm run build" - end -end +# Default value for default_env is {} +# set :default_env, { path: "/opt/ruby/bin:$PATH" } +set :default_env, { path: "/usr/local/bin:$PATH" } -# by default it only installs dependencies. We remove the --production flag -# so it also installs devDependencies -set :npm_flags, '--silent --no-progress' +# Default value for keep_releases is 5 +set :keep_releases, 2 +# before "deploy:updated", "deploy:set_permissions:acl" -after :deploy, 'deploy:send_notification' -before 'deploy', 'deploy:npm_install' -before 'deploy', 'deploy:npm_build' -# after 'deploy:finishing', 'deploy:update_wp_translations' -# after 'deploy:publishing', 'memcached:restart' +# namespace :deploy do +# desc "Send email notification" +# task :send_notification do +# Notifier.deploy_notification(self).deliver_now +# end +# end +# +# after :deploy, 'deploy:send_notification' diff --git a/config/deploy/production.rb b/config/deploy/production.rb index 731d137..b4a3627 100644 --- a/config/deploy/production.rb +++ b/config/deploy/production.rb @@ -23,4 +23,4 @@ # auth_methods: %w(password) # } -fetch(:default_env).merge!(wp_env: :production) +# fetch(:default_env).merge!(wp_env: :production) From 8b123287c00926ea67d83b32a7ad59ff404edd61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Figueiredo?= Date: Fri, 24 Mar 2017 16:14:02 +0100 Subject: [PATCH 7/8] npm install. --- Capfile | 23 +++-------------------- Gemfile | 19 ++++--------------- Gemfile.lock | 33 +++++++++++++++++++++++++++++++++ config/deploy.rb | 4 ++-- config/deploy/staging.rb | 6 ++---- 5 files changed, 44 insertions(+), 41 deletions(-) create mode 100644 Gemfile.lock diff --git a/Capfile b/Capfile index 4db04e1..e0e3bd9 100644 --- a/Capfile +++ b/Capfile @@ -1,18 +1,3 @@ -# Load DSL and Setup Up Stages -#require 'capistrano/setup' -# Includes default deployment tasks -#require 'capistrano/deploy' -# Load tasks from gems -#require 'capistrano/composer' -# Loads custom tasks from `lib/capistrano/tasks' if you have any defined. -# Customize this path to change the location of your custom tasks. -#Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r } -#require 'capistrano-nc/nc' -# load 'config/deploy/cap_notify.rb' -#require 'capistrano/memcached' -#require 'slackistrano' -#require 'capistrano/npm' - # Load DSL and Setup Up Stages require 'capistrano/setup' @@ -20,7 +5,7 @@ require 'capistrano/setup' require 'capistrano/deploy' # Load tasks from gems -# require 'capistrano/composer' +require 'capistrano/npm' require "capistrano/scm/git" install_plugin Capistrano::SCM::Git @@ -31,10 +16,8 @@ Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r } # require 'capistrano-nc/nc' -#load 'config/deploy/cap_notify.rb' +# load 'config/deploy/cap_notify.rb' require 'slackistrano/capistrano' -#require 'capistrano/file-permissions' - -#require 'capistrano/npm' +# require 'capistrano/file-permissions' diff --git a/Gemfile b/Gemfile index dc35d83..f84b980 100644 --- a/Gemfile +++ b/Gemfile @@ -1,25 +1,14 @@ -#source 'https://rubygems.org' -#gem 'capistrano', '~> 3.3.5' -#gem 'capistrano-composer' -#gem 'capistrano-wpcli' -#gem 'capistrano-nc', '~> 0.1' -#gem 'actionmailer', '~> 4.2.0' -#gem 'capistrano-memcached', '~> 1.0' -#gem 'slackistrano', require: false -#gem 'capistrano-npm' - source 'https://rubygems.org' gem "capistrano", "~> 3.6" -#gem 'capistrano-composer' +gem 'capistrano-npm' -#gem 'capistrano-nc', '~> 0.1' +# gem 'capistrano-nc', '~> 0.1' -#gem 'actionmailer', '~> 4.2.0' +# gem 'actionmailer', '~> 4.2.0' gem 'slackistrano' -#gem 'capistrano-file-permissions' +# gem 'capistrano-file-permissions' -#gem 'capistrano-npm' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..927e411 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,33 @@ +GEM + remote: https://rubygems.org/ + specs: + airbrussh (1.1.2) + sshkit (>= 1.6.1, != 1.7.0) + capistrano (3.8.0) + airbrussh (>= 1.0.0) + i18n + rake (>= 10.0.0) + sshkit (>= 1.9.0) + capistrano-npm (1.0.2) + capistrano (>= 3.0.0) + i18n (0.8.1) + net-scp (1.2.1) + net-ssh (>= 2.6.5) + net-ssh (4.1.0) + rake (12.0.0) + slackistrano (3.1.0) + capistrano (>= 3.5.0) + sshkit (1.12.0) + net-scp (>= 1.1.2) + net-ssh (>= 2.8.0) + +PLATFORMS + ruby + +DEPENDENCIES + capistrano (~> 3.6) + capistrano-npm + slackistrano + +BUNDLED WITH + 1.14.6 diff --git a/config/deploy.rb b/config/deploy.rb index 53485b1..5f67e17 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -10,8 +10,8 @@ # set :file_permissions_groups, ["www-data"] # set :cap_notify_emails, [ 'tech@ttss.ch' ] -# set :cap_notify_from, 'deploy@frontal.ch' -# set :cap_notify_callsign, 'EXAMPLE' +# set :cap_notify_from, 'deploy@ginetta.net' +# set :cap_notify_callsign, 'GINETTA' # set :cap_notify_latest_commit, proc { `git rev-parse HEAD`.strip } set :slackistrano, { diff --git a/config/deploy/staging.rb b/config/deploy/staging.rb index 686f0bf..8a1e9b7 100644 --- a/config/deploy/staging.rb +++ b/config/deploy/staging.rb @@ -10,9 +10,7 @@ # Extended Server Syntax # ====================== -# server 'endeavour', user: 'deploy', roles: %w{web app db} -# server 'www-ch.stage.ttss.ch', user: 'deploy', roles: %w{web app db} -server 'compute-01.stage.ginetta.net', user: 'deploy', roles: %w{web app db}, port: 2232 +server 'compute-01.stage.ginetta.net', user: 'deploy', roles: %w{web app db} # you can set custom ssh options # it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options @@ -24,4 +22,4 @@ # auth_methods: %w(password) # } -fetch(:default_env).merge!(wp_env: :staging) +# fetch(:default_env).merge!(wp_env: :staging) From ce8e73512e30b21192fe88c3e8d5ec4c4b785c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Figueiredo?= Date: Fri, 24 Mar 2017 17:33:09 +0100 Subject: [PATCH 8/8] changes build to public.wq --- .gitignore | 2 +- gulp/config.js | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index b14e3ff..732bfd4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -build +public node_modules .sass-cache .DS_Store diff --git a/gulp/config.js b/gulp/config.js index 943ac18..8a8a892 100644 --- a/gulp/config.js +++ b/gulp/config.js @@ -50,14 +50,14 @@ module.exports = () => { }; const destPaths = { - root: 'build/', - scripts: 'build/js/', - styles: 'build/css/', - pages: 'build/', - content: 'build/content/', - assets: 'build/assets/', - meta: 'build/', - revManifest: 'build/rev-manifest.json', + root: 'public/', + scripts: 'public/js/', + styles: 'public/css/', + pages: 'public/', + content: 'public/content/', + assets: 'public/assets/', + meta: 'public/', + revManifest: 'public/rev-manifest.json', }; return {