aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-08-14 21:26:14 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-08-17 15:36:27 +0200
commitceb79aa016becb91132c0a96405f40153f7da77a (patch)
tree284040213ea6b8e0a31c2f46f7e95868450d6964
parent80127e4fb1ce02825e9b2b985882b348e6f25ac2 (diff)
downloadwallabag-ceb79aa016becb91132c0a96405f40153f7da77a.tar.gz
wallabag-ceb79aa016becb91132c0a96405f40153f7da77a.tar.zst
wallabag-ceb79aa016becb91132c0a96405f40153f7da77a.zip
capistrano config
-rw-r--r--.gitignore5
-rw-r--r--Capfile29
-rw-r--r--Gemfile5
-rw-r--r--Gemfile.lock41
-rw-r--r--config/deploy.rb66
-rw-r--r--config/deploy/production.rb61
-rw-r--r--config/deploy/staging.rb64
7 files changed, 271 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 9bde27db..273b380f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,3 +36,8 @@
36# Data for wallabag 36# Data for wallabag
37data/assets/* 37data/assets/*
38data/db/wallabag*.sqlite 38data/db/wallabag*.sqlite
39
40# Capistrano
41/config/deploy.rb
42/config/deploy/production.rb
43/config/deploy/staging.rb
diff --git a/Capfile b/Capfile
new file mode 100644
index 00000000..d3273469
--- /dev/null
+++ b/Capfile
@@ -0,0 +1,29 @@
1# Load DSL and set up stages
2require 'capistrano/setup'
3
4# Include default deployment tasks
5require 'capistrano/deploy'
6
7require 'capistrano/symfony'
8
9# Include tasks from other gems included in your Gemfile
10#
11# For documentation on these, see for example:
12#
13# https://github.com/capistrano/rvm
14# https://github.com/capistrano/rbenv
15# https://github.com/capistrano/chruby
16# https://github.com/capistrano/bundler
17# https://github.com/capistrano/rails
18# https://github.com/capistrano/passenger
19#
20# require 'capistrano/rvm'
21# require 'capistrano/rbenv'
22# require 'capistrano/chruby'
23# require 'capistrano/bundler'
24# require 'capistrano/rails/assets'
25# require 'capistrano/rails/migrations'
26# require 'capistrano/passenger'
27
28# Load custom tasks from `lib/capistrano/tasks` if you have any defined
29Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 00000000..467db381
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,5 @@
1source "https://rubygems.org"
2
3gem 'capistrano', '~> 3.1'
4gem 'capistrano-symfony', '~> 0.1', :github => 'capistrano/symfony'
5gem 'capistrano-composer', '~> 0.0.3'
diff --git a/Gemfile.lock b/Gemfile.lock
new file mode 100644
index 00000000..72043868
--- /dev/null
+++ b/Gemfile.lock
@@ -0,0 +1,41 @@
1GIT
2 remote: git://github.com/capistrano/symfony.git
3 revision: ca56a01b817097d2831400ef9b1867fc8e07dcf8
4 specs:
5 capistrano-symfony (0.4.0)
6 capistrano (~> 3.1)
7 capistrano-composer (~> 0.0.3)
8 capistrano-file-permissions (~> 0.1.0)
9
10GEM
11 remote: https://rubygems.org/
12 specs:
13 capistrano (3.4.0)
14 i18n
15 rake (>= 10.0.0)
16 sshkit (~> 1.3)
17 capistrano-composer (0.0.6)
18 capistrano (>= 3.0.0.pre)
19 capistrano-file-permissions (0.1.1)
20 capistrano (~> 3.1)
21 colorize (0.7.7)
22 i18n (0.7.0)
23 net-scp (1.2.1)
24 net-ssh (>= 2.6.5)
25 net-ssh (2.9.2)
26 rake (10.4.2)
27 sshkit (1.7.1)
28 colorize (>= 0.7.0)
29 net-scp (>= 1.1.2)
30 net-ssh (>= 2.8.0)
31
32PLATFORMS
33 ruby
34
35DEPENDENCIES
36 capistrano (~> 3.1)
37 capistrano-composer (~> 0.0.3)
38 capistrano-symfony (~> 0.1)!
39
40BUNDLED WITH
41 1.10.6
diff --git a/config/deploy.rb b/config/deploy.rb
new file mode 100644
index 00000000..67eb0c9c
--- /dev/null
+++ b/config/deploy.rb
@@ -0,0 +1,66 @@
1# config valid only for current version of Capistrano
2lock '3.4.0'
3
4set :application, 'wallabag'
5set :repo_url, 'git@github.com:wallabag/wallabag.git'
6
7set :ssh_user, 'ssh_user'
8server 'server_ip', user: fetch(:ssh_user), roles: %w{web app db}
9
10set :scm, :git
11
12set :format, :pretty
13set :log_level, :info
14# set :log_level, :debug
15
16set :composer_install_flags, '--no-dev --prefer-dist --no-interaction --optimize-autoloader'
17
18set :linked_files, %w{app/config/parameters.yml}
19set :linked_dirs, %w{app/logs web/uploads}
20
21set :keep_releases, 3
22
23after 'deploy:finishing', 'deploy:cleanup'
24
25# Default branch is :master
26# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
27
28# Default deploy_to directory is /var/www/my_app_name
29# set :deploy_to, '/var/www/my_app_name'
30
31# Default value for :scm is :git
32# set :scm, :git
33
34# Default value for :format is :pretty
35# set :format, :pretty
36
37# Default value for :log_level is :debug
38# set :log_level, :debug
39
40# Default value for :pty is false
41# set :pty, true
42
43# Default value for :linked_files is []
44# set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')
45
46# Default value for linked_dirs is []
47# set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'public/system')
48
49# Default value for default_env is {}
50# set :default_env, { path: "/opt/ruby/bin:$PATH" }
51
52# Default value for keep_releases is 5
53# set :keep_releases, 5
54
55namespace :deploy do
56
57 after :restart, :clear_cache do
58 on roles(:web), in: :groups, limit: 3, wait: 10 do
59 # Here we can do anything such as:
60 # within release_path do
61 # execute :rake, 'cache:clear'
62 # end
63 end
64 end
65
66end
diff --git a/config/deploy/production.rb b/config/deploy/production.rb
new file mode 100644
index 00000000..4fc06fa9
--- /dev/null
+++ b/config/deploy/production.rb
@@ -0,0 +1,61 @@
1# server-based syntax
2# ======================
3# Defines a single server with a list of roles and multiple properties.
4# You can define all roles on a single server, or split them:
5
6# server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value
7# server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
8# server 'db.example.com', user: 'deploy', roles: %w{db}
9
10
11
12# role-based syntax
13# ==================
14
15# Defines a role with one or multiple servers. The primary server in each
16# group is considered to be the first unless any hosts have the primary
17# property set. Specify the username and a domain or IP for the server.
18# Don't use `:all`, it's a meta role.
19
20# role :app, %w{deploy@example.com}, my_property: :my_value
21# role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
22# role :db, %w{deploy@example.com}
23
24
25
26# Configuration
27# =============
28# You can set any configuration variable like in config/deploy.rb
29# These variables are then only loaded and set in this stage.
30# For available Capistrano configuration variables see the documentation page.
31# http://capistranorb.com/documentation/getting-started/configuration/
32# Feel free to add new variables to customise your setup.
33
34
35
36# Custom SSH Options
37# ==================
38# You may pass any option but keep in mind that net/ssh understands a
39# limited set of options, consult the Net::SSH documentation.
40# http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
41#
42# Global options
43# --------------
44# set :ssh_options, {
45# keys: %w(/home/rlisowski/.ssh/id_rsa),
46# forward_agent: false,
47# auth_methods: %w(password)
48# }
49#
50# The server-based syntax can be used to override options:
51# ------------------------------------
52# server 'example.com',
53# user: 'user_name',
54# roles: %w{web app},
55# ssh_options: {
56# user: 'user_name', # overrides user setting above
57# keys: %w(/home/user_name/.ssh/id_rsa),
58# forward_agent: false,
59# auth_methods: %w(publickey password)
60# # password: 'please use keys'
61# }
diff --git a/config/deploy/staging.rb b/config/deploy/staging.rb
new file mode 100644
index 00000000..76e23bb7
--- /dev/null
+++ b/config/deploy/staging.rb
@@ -0,0 +1,64 @@
1# server-based syntax
2# ======================
3# Defines a single server with a list of roles and multiple properties.
4# You can define all roles on a single server, or split them:
5
6set :branch, 'v2'
7set :deploy_to, '/var/www/'
8
9# server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value
10# server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
11# server 'db.example.com', user: 'deploy', roles: %w{db}
12
13
14
15# role-based syntax
16# ==================
17
18# Defines a role with one or multiple servers. The primary server in each
19# group is considered to be the first unless any hosts have the primary
20# property set. Specify the username and a domain or IP for the server.
21# Don't use `:all`, it's a meta role.
22
23# role :app, %w{deploy@example.com}, my_property: :my_value
24# role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
25# role :db, %w{deploy@example.com}
26
27
28
29# Configuration
30# =============
31# You can set any configuration variable like in config/deploy.rb
32# These variables are then only loaded and set in this stage.
33# For available Capistrano configuration variables see the documentation page.
34# http://capistranorb.com/documentation/getting-started/configuration/
35# Feel free to add new variables to customise your setup.
36
37
38
39# Custom SSH Options
40# ==================
41# You may pass any option but keep in mind that net/ssh understands a
42# limited set of options, consult the Net::SSH documentation.
43# http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
44#
45# Global options
46# --------------
47# set :ssh_options, {
48# keys: %w(/home/rlisowski/.ssh/id_rsa),
49# forward_agent: false,
50# auth_methods: %w(password)
51# }
52#
53# The server-based syntax can be used to override options:
54# ------------------------------------
55# server 'example.com',
56# user: 'user_name',
57# roles: %w{web app},
58# ssh_options: {
59# user: 'user_name', # overrides user setting above
60# keys: %w(/home/user_name/.ssh/id_rsa),
61# forward_agent: false,
62# auth_methods: %w(publickey password)
63# # password: 'please use keys'
64# }