capistrano-olympus 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/CHANGELOG.md +2 -0
- data/LICENSE +21 -0
- data/README.md +63 -0
- data/capistrano-olympus.gemspec +27 -0
- data/lib/capistrano-olympus.rb +0 -0
- data/lib/capistrano/capistrano-olympus.rb +11 -0
- data/lib/capistrano/tasks/capistrano-deploy.rake +48 -0
- data/lib/capistrano/tasks/database.rake +100 -0
- data/lib/capistrano/tasks/directories.rake +31 -0
- data/lib/capistrano/tasks/files.rake +25 -0
- data/lib/capistrano/tasks/htaccess.rake +35 -0
- data/lib/capistrano/tasks/pagespeed.rake +11 -0
- data/lib/capistrano/tasks/php.rake +37 -0
- data/lib/capistrano/tasks/redis.rake +19 -0
- data/lib/capistrano/tasks/robots.rake +60 -0
- data/lib/capistrano/tasks/server.rake +37 -0
- data/lib/capistrano/tasks/varnish.rake +11 -0
- data/lib/capistrano/vars/defaults.rb +39 -0
- metadata +106 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1b6fb26fc2208fdd0d630569d8235abf08708abb
|
4
|
+
data.tar.gz: 82159cff48c798f9607cb6159d02a1f09b9fb330
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a2ada5f75daf5386bd90b26bb53356b2ca144524bf46e9bef379e86aba5f86a08798bd6865c1373a15c3c0aeebbfeca171450a7e4756536a954afbda1f35faae
|
7
|
+
data.tar.gz: 7343e6d5517a76cff830601cfb41b379b075d4e274518f3102e1cb5250f95f36f1c9a50f02f0b3f8cb76b5ff7d028f4989c4186bd224eebe4489818264225b02
|
data/.gitignore
ADDED
data/CHANGELOG.md
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (C) 2016, Achraf Chouk - achrafchouk@gmail.com
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# Capistrano Olympus
|
2
|
+
|
3
|
+
---
|
4
|
+
|
5
|
+
_in progress_
|
6
|
+
|
7
|
+
---
|
8
|
+
|
9
|
+
[](https://packagist.org/packages/crewstyle/capistrano-olympus)
|
10
|
+
[](https://github.com/crewstyle/capistrano-olympus)
|
11
|
+

|
12
|
+
|
13
|
+
---
|
14
|
+
|
15
|
+
To follow more about the project and help if you want:
|
16
|
+
|
17
|
+
[Github project repository](https://github.com/crewstyle/Olympus)
|
18
|
+
[Salt Bountysource page](https://salt.bountysource.com/teams/olympus)
|
19
|
+
[Bountysource page](https://www.bountysource.com/teams/olympus)
|
20
|
+
[Documentation](https://olympus.readme.io/)
|
21
|
+
|
22
|
+
---
|
23
|
+
|
24
|
+
### Installation
|
25
|
+
|
26
|
+
```
|
27
|
+
# Gemfile
|
28
|
+
gem 'capistrano', '~> 3.4'
|
29
|
+
gem 'capistrano-olympus', '~> 0.0.1'
|
30
|
+
```
|
31
|
+
|
32
|
+
### Usage
|
33
|
+
|
34
|
+
Require capistrano-olympus in your cap file
|
35
|
+
|
36
|
+
```
|
37
|
+
# Capfile
|
38
|
+
require 'capistrano/olympus'
|
39
|
+
```
|
40
|
+
|
41
|
+
---
|
42
|
+
|
43
|
+
### All we need is looooooooooooove :)
|
44
|
+
|
45
|
+
[](https://salt.bountysource.com/teams/olympus) [](https://www.bountysource.com/teams/olympus)
|
46
|
+
Guys, do **not** hesitate to spread your love about the **Olympus WordPress framework** and **all its packages** ;)
|
47
|
+
|
48
|
+
---
|
49
|
+
|
50
|
+
### Authors and Copyright
|
51
|
+
|
52
|
+
**Achraf Chouk**
|
53
|
+
|
54
|
+
+ http://fr.linkedin.com/in/achrafchouk/
|
55
|
+
+ http://twitter.com/crewstyle
|
56
|
+
+ http://github.com/crewstyle
|
57
|
+
|
58
|
+
Please, read [LICENSE](https://github.com/crewstyle/capistrano-olympus/blob/master/LICENSE "LICENSE") for more details.
|
59
|
+
[](http://opensource.org/licenses/MIT "MIT")
|
60
|
+
|
61
|
+
---
|
62
|
+
|
63
|
+
**Built with ♥ by [Achraf Chouk](http://github.com/crewstyle "Achraf Chouk") ~ (c) since 2015.**
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gem.name = 'capistrano-olympus'
|
7
|
+
gem.version = '0.0.1'
|
8
|
+
gem.date = '2016-03-31'
|
9
|
+
gem.authors = ['Achraf Chouk']
|
10
|
+
gem.email = ['achrafchouk@gmail.com']
|
11
|
+
gem.description = "Capistrano 3.x deployment processes for WordPress and Olympus framework"
|
12
|
+
gem.summary = "Gem especially made to build WordPress and Olympus framework websites with Capistrano 3.x"
|
13
|
+
gem.homepage = 'http://github.com/crewstyle/capistrano-olympus'
|
14
|
+
gem.license = 'MIT'
|
15
|
+
|
16
|
+
gem.files = `git ls-files`.split($/)
|
17
|
+
gem.executables = gem.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
|
19
|
+
# no tests as of yet
|
20
|
+
#gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
21
|
+
|
22
|
+
gem.require_paths = ['lib']
|
23
|
+
|
24
|
+
gem.add_dependency 'capistrano', '~> 3.4'
|
25
|
+
gem.add_dependency 'capistrano-composer', '~> 0.0.6'
|
26
|
+
gem.add_dependency 'sshkit-sudo', '~> 0.1.0'
|
27
|
+
end
|
File without changes
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module Capistrano
|
2
|
+
class FileNotFound < StandardError
|
3
|
+
end
|
4
|
+
end
|
5
|
+
|
6
|
+
# Deploy
|
7
|
+
namespace :deploy do
|
8
|
+
|
9
|
+
desc "Create files and dirs when its needed"
|
10
|
+
task :setup do
|
11
|
+
on release_roles(:all) do
|
12
|
+
|
13
|
+
# Check the very last action made: it means all setup processes are done!
|
14
|
+
if test "[ ! -f \"#{shared_path}/web/robots.txt\" ]"
|
15
|
+
puts "Create directories"
|
16
|
+
invoke "directories:do_actions"
|
17
|
+
|
18
|
+
puts "Create files"
|
19
|
+
invoke "files:do_actions"
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
desc "Restart services and clear caches"
|
26
|
+
task :clear do
|
27
|
+
on release_roles(:all) do
|
28
|
+
|
29
|
+
puts "Restart all services"
|
30
|
+
invoke "server:stop"
|
31
|
+
invoke "php:restart"
|
32
|
+
invoke "server:start"
|
33
|
+
|
34
|
+
puts "Clear all caches"
|
35
|
+
invoke "redis:flushall"
|
36
|
+
invoke "pagespeed:flushall"
|
37
|
+
invoke "varnish:restart"
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# Create files and dirs when its needed
|
43
|
+
before 'deploy:starting', 'deploy:setup'
|
44
|
+
|
45
|
+
# Restart services and clear caches
|
46
|
+
after :publishing, 'deploy:clear'
|
47
|
+
|
48
|
+
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
# Database
|
2
|
+
namespace :database do
|
3
|
+
|
4
|
+
desc "Creates files"
|
5
|
+
task :do_actions do
|
6
|
+
on release_roles(:all) do
|
7
|
+
|
8
|
+
# Ask configs
|
9
|
+
set :database_host, ask('Enter the database hostname:', 'localhost')
|
10
|
+
set :database_name, ask('Enter the database name:', 'database_name_here')
|
11
|
+
set :database_user, ask('Enter the database user:', 'username_here')
|
12
|
+
set :database_pass, ask('Enter the database password:', 'username_here', echo: false)
|
13
|
+
|
14
|
+
set :wordpress_name, ask('Enter the admin username:', 'admin')
|
15
|
+
set :wordpress_mail, ask('Enter the admin email address:', 'admin@domain.tld')
|
16
|
+
set :wordpress_pass, ask('Enter the admin password:', 'password', echo: false)
|
17
|
+
|
18
|
+
|
19
|
+
if File.exists?("#{release_path}/tmp/database.sql")
|
20
|
+
puts "Copy database.sql file"
|
21
|
+
upload! StringIO.new(File.read("#{release_path}/tmp/database.sql")), "#{shared_path}/tmp/database.sql"
|
22
|
+
else
|
23
|
+
puts "Create database.sql file"
|
24
|
+
io = StringIO.new("CREATE DATABASE IF NOT EXISTS `#{fetch(:database_name)}`")
|
25
|
+
upload! io, File.join(shared_path, "database.sql")
|
26
|
+
execute :chmod, "644 #{shared_path}/database.sql"
|
27
|
+
|
28
|
+
# Execute SQL request and remove temporary file
|
29
|
+
execute :mysql, "-u #{fetch(:database_user)} -p#{fetch(:database_pass)} -h #{fetch(:database_host)} < #{shared_path}/database.sql"
|
30
|
+
execute :rm, "#{shared_path}/database.sql"
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
if File.exists?("#{release_path}/app/config/env.php")
|
35
|
+
puts "Copy env.php file"
|
36
|
+
upload! StringIO.new(File.read("#{release_path}/app/config/env.php")), "#{shared_path}/app/config/env.php"
|
37
|
+
else
|
38
|
+
puts "Create env.php file"
|
39
|
+
|
40
|
+
if fetch(:stage) == :production then
|
41
|
+
debug = StringIO.new(" 'debug' => false,")
|
42
|
+
else
|
43
|
+
debug = StringIO.new(" 'debug' => [
|
44
|
+
'savequeries' => true,
|
45
|
+
'script_debug' => true,
|
46
|
+
'wp_debug_display' => true,
|
47
|
+
'wp_debug' => true,
|
48
|
+
],")
|
49
|
+
end
|
50
|
+
|
51
|
+
io = StringIO.new("<?php
|
52
|
+
|
53
|
+
/**
|
54
|
+
* File auto-generated while first deploy.
|
55
|
+
*/
|
56
|
+
return [
|
57
|
+
//Database
|
58
|
+
'database' => [
|
59
|
+
'host' => '#{fetch(:database_host)}',
|
60
|
+
'name' => '#{fetch(:database_name)}',
|
61
|
+
'user' => '#{fetch(:database_user)}',
|
62
|
+
'pass' => '#{fetch(:database_pass)}',
|
63
|
+
],
|
64
|
+
|
65
|
+
//WordPress URLs
|
66
|
+
'wordpress' => [
|
67
|
+
'home' => '#{fetch(:localurl)}',
|
68
|
+
'siteurl' => '#{fetch(:localurl)}/cms',
|
69
|
+
],
|
70
|
+
|
71
|
+
//Secure?
|
72
|
+
'https' => false,
|
73
|
+
|
74
|
+
//Debug
|
75
|
+
#{fetch(:debug)}
|
76
|
+
];
|
77
|
+
|
78
|
+
")
|
79
|
+
upload! io, File.join(shared_path, "env.php")
|
80
|
+
execute :chmod, "644 #{shared_path}/env.php"
|
81
|
+
execute :mv, "#{shared_path}/env.php", "#{shared_path}/app/config/"
|
82
|
+
end
|
83
|
+
|
84
|
+
|
85
|
+
puts "Execute wp-cli commands to create database"
|
86
|
+
execute :mkdir, '-p', "#{shared_path}/tmp/wpcli"
|
87
|
+
execute "wp core download --path=#{shared_path}/tmp/wpcli --force"
|
88
|
+
|
89
|
+
unless File.exists?("#{shared_path}/tmp/wpcli/wp-config.php")
|
90
|
+
execute "wp core config --path=#{shared_path}/tmp/wpcli --dbname=#{fetch(:database_name)} --dbuser=#{fetch(:database_user)} --dbpass=#{fetch(:database_pass)}"
|
91
|
+
end
|
92
|
+
|
93
|
+
execute "wp core install --path=#{shared_path}/tmp/wpcli --url=#{fetch(:localurl)} --title=#{fetch(:application)} --admin_user=#{fetch(:wordpress_name)} --admin_password=#{fetch(:wordpress_pass)} --admin_email=#{fetch(:wordpress_mail)}"
|
94
|
+
|
95
|
+
execute :rm, '-rf', "#{shared_path}/tmp"
|
96
|
+
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# Directories
|
2
|
+
namespace :directories do
|
3
|
+
|
4
|
+
desc "Creates directories"
|
5
|
+
task :do_actions do
|
6
|
+
on release_roles(:all) do
|
7
|
+
|
8
|
+
if test "[ ! -d \"#{shared_path}/tmp\" ]"
|
9
|
+
execute :mkdir, '-p', "#{shared_path}/tmp"
|
10
|
+
end
|
11
|
+
|
12
|
+
if test "[ ! -d \"#{shared_path}/app/config/env\" ]"
|
13
|
+
execute :mkdir, '-p', "#{shared_path}/app/config/env"
|
14
|
+
end
|
15
|
+
|
16
|
+
if test "[ ! -d \"#{shared_path}/web/statics/languages\" ]"
|
17
|
+
execute :mkdir, '-p', "#{shared_path}/web/statics/languages"
|
18
|
+
end
|
19
|
+
|
20
|
+
if test "[ ! -d \"#{shared_path}/web/statics/plugins\" ]"
|
21
|
+
execute :mkdir, '-p', "#{shared_path}/web/statics/plugins"
|
22
|
+
end
|
23
|
+
|
24
|
+
if test "[ ! -d \"#{shared_path}/web/statics/uploads\" ]"
|
25
|
+
execute :mkdir, '-p', "#{shared_path}/web/statics/uploads"
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Files
|
2
|
+
namespace :files do
|
3
|
+
|
4
|
+
desc "Creates files"
|
5
|
+
task :do_actions do
|
6
|
+
on release_roles(:all) do
|
7
|
+
|
8
|
+
if File.exists?("#{release_path}/app/config/common.php")
|
9
|
+
puts "Copy common.php file"
|
10
|
+
upload! StringIO.new(File.read("#{release_path}/app/config/common.php")), "#{shared_path}/app/config/common.php"
|
11
|
+
end
|
12
|
+
|
13
|
+
# Create DB files, and install data
|
14
|
+
invoke "database:do_actions"
|
15
|
+
|
16
|
+
# Create .htaccess
|
17
|
+
invoke "htaccess:do_actions"
|
18
|
+
|
19
|
+
# Create robots.txt
|
20
|
+
invoke "robots:do_actions"
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# Htaccess
|
2
|
+
namespace :htaccess do
|
3
|
+
|
4
|
+
desc "Creates files"
|
5
|
+
task :do_actions do
|
6
|
+
on release_roles(:all) do
|
7
|
+
|
8
|
+
if File.exists?("#{release_path}/web/.htaccess")
|
9
|
+
puts "Copy .htaccess file"
|
10
|
+
upload! StringIO.new(File.read("#{release_path}/web/.htaccess")), "#{shared_path}/web/.htaccess"
|
11
|
+
else
|
12
|
+
puts "Create .htaccess file"
|
13
|
+
io = StringIO.new("
|
14
|
+
# BEGIN WordPress
|
15
|
+
|
16
|
+
<IfModule mod_rewrite.c>
|
17
|
+
RewriteEngine On
|
18
|
+
RewriteBase /
|
19
|
+
RewriteRule ^index\.php$ - [L]
|
20
|
+
RewriteCond %{REQUEST_FILENAME} !-f
|
21
|
+
RewriteCond %{REQUEST_FILENAME} !-d
|
22
|
+
RewriteRule . /index.php [L]
|
23
|
+
</IfModule>
|
24
|
+
|
25
|
+
# END WordPress
|
26
|
+
")
|
27
|
+
upload! io, File.join(shared_path, ".htaccess")
|
28
|
+
execute :chmod, "644 #{shared_path}/.htaccess"
|
29
|
+
execute :mv, "#{shared_path}/.htaccess", "#{shared_path}/web/"
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# PHP
|
2
|
+
namespace :php do
|
3
|
+
|
4
|
+
desc "PHP restart"
|
5
|
+
task :restart do
|
6
|
+
on roles(:app) do
|
7
|
+
if test("[ -f /etc/init.d/php7.0-fpm ]")
|
8
|
+
sudo :service, 'php7.0-fpm', :restart
|
9
|
+
elsif test("[ -f /etc/init.d/php5-fpm ]")
|
10
|
+
sudo :service, 'php5-fpm', :restart
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "PHP start"
|
16
|
+
task :start do
|
17
|
+
on roles(:app) do
|
18
|
+
if test("[ -f /etc/init.d/php7.0-fpm ]")
|
19
|
+
sudo :service, 'php7.0-fpm', :start
|
20
|
+
elsif test("[ -f /etc/init.d/php5-fpm ]")
|
21
|
+
sudo :service, 'php5-fpm', :start
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
desc "PHP stop"
|
27
|
+
task :stop do
|
28
|
+
on roles(:app) do
|
29
|
+
if test("[ -f /etc/init.d/php7.0-fpm ]")
|
30
|
+
sudo :service, 'php7.0-fpm', :stop
|
31
|
+
elsif test("[ -f /etc/init.d/php5-fpm ]")
|
32
|
+
sudo :service, 'php5-fpm', :stop
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Redis
|
2
|
+
namespace :redis do
|
3
|
+
|
4
|
+
desc "Redis data flush"
|
5
|
+
task :flushall do
|
6
|
+
on roles(:app) do
|
7
|
+
sudo 'redis-cli', 'flushall'
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
desc "Redis restart"
|
12
|
+
task :restart do
|
13
|
+
on roles(:app) do
|
14
|
+
sudo '/etc/init.d/redis-server', 'stop'
|
15
|
+
sudo '/etc/init.d/redis-server', 'start'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# Robots
|
2
|
+
namespace :robots do
|
3
|
+
|
4
|
+
desc "Creates files"
|
5
|
+
task :do_actions do
|
6
|
+
on release_roles(:all) do
|
7
|
+
|
8
|
+
if File.exists?("#{release_path}/web/robots.txt")
|
9
|
+
puts "Copy robots.txt file"
|
10
|
+
upload! StringIO.new(File.read("#{release_path}/web/robots.txt")), "#{shared_path}/web/robots.txt"
|
11
|
+
else
|
12
|
+
puts "Create robots.txt file"
|
13
|
+
if fetch(:stage) == :production then
|
14
|
+
io = StringIO.new("Sitemap: #{fetch(:localurl)}/sitemap.xml
|
15
|
+
|
16
|
+
User-agent: *
|
17
|
+
Disallow: /*?
|
18
|
+
|
19
|
+
User-agent: Googlebot
|
20
|
+
User-agent: Googlebot-News
|
21
|
+
User-agent: Googlebot-Image
|
22
|
+
User-agent: Googlebot-Video
|
23
|
+
User-agent: Googlebot-Mobile
|
24
|
+
User-agent: Mediapartners-Google
|
25
|
+
User-agent: Mediapartners
|
26
|
+
User-agent: AdsBot-Google
|
27
|
+
User-agent: Bingbot
|
28
|
+
User-agent: Twitterbot
|
29
|
+
Crawl-delay: 5
|
30
|
+
|
31
|
+
User-agent: CCBot
|
32
|
+
Crawl-delay: 10
|
33
|
+
|
34
|
+
User-agent: Yandex
|
35
|
+
Crawl-delay: 10
|
36
|
+
|
37
|
+
User-agent: Applebot
|
38
|
+
Crawl-delay: 10
|
39
|
+
|
40
|
+
User-agent: archive.org_bot
|
41
|
+
Crawl-delay: 10
|
42
|
+
|
43
|
+
User-agent: ia_archiver
|
44
|
+
Crawl-delay: 10
|
45
|
+
")
|
46
|
+
else
|
47
|
+
io = StringIO.new("User-agent: *
|
48
|
+
Disallow: /
|
49
|
+
")
|
50
|
+
end
|
51
|
+
|
52
|
+
upload! io, File.join(shared_path, "robots.txt")
|
53
|
+
execute :chmod, "644 #{shared_path}/robots.txt"
|
54
|
+
execute :mv, "#{shared_path}/robots.txt", "#{shared_path}/web/robots.txt"
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# Server Nginx or Apache
|
2
|
+
namespace :server do
|
3
|
+
|
4
|
+
desc "Server restart"
|
5
|
+
task :restart do
|
6
|
+
on roles(:app) do
|
7
|
+
if test("[ -f /etc/init.d/nginx ]")
|
8
|
+
sudo :service, :nginx, :restart
|
9
|
+
elsif test("[ -f /etc/init.d/apache2 ]")
|
10
|
+
sudo :service, :apache2, :restart
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "Server start"
|
16
|
+
task :start do
|
17
|
+
on roles(:app) do
|
18
|
+
if test("[ -f /etc/init.d/nginx ]")
|
19
|
+
sudo :service, :nginx, :start
|
20
|
+
elsif test("[ -f /etc/init.d/apache2 ]")
|
21
|
+
sudo :service, :apache2, :start
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
desc "Server stop"
|
27
|
+
task :stop do
|
28
|
+
on roles(:app) do
|
29
|
+
if test("[ -f /etc/init.d/nginx ]")
|
30
|
+
sudo :service, :nginx, :stop
|
31
|
+
elsif test("[ -f /etc/init.d/apache2 ]")
|
32
|
+
sudo :service, :apache2, :stop
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# config valid only for current version of Capistrano
|
2
|
+
lock '3.4.0'
|
3
|
+
|
4
|
+
# ~~~~
|
5
|
+
|
6
|
+
# Setup Capistrano
|
7
|
+
set :log_level, :debug
|
8
|
+
set :keep_releases, 3
|
9
|
+
|
10
|
+
# Setup Project ~ Update these settings
|
11
|
+
set :application, 'olympus-capified'
|
12
|
+
set :localurl, 'http://www.domain.tld'
|
13
|
+
|
14
|
+
# Setup Git
|
15
|
+
set :repo_url, 'git@github.com:crewstyle/Olympus.git'
|
16
|
+
set :scm, :git
|
17
|
+
set :git_enable_submodules, true
|
18
|
+
|
19
|
+
# Setup SSH
|
20
|
+
set :copy_exclude, ['.git', '.DS_Store', '.gitignore', '.gitmodules']
|
21
|
+
set :use_sudo, false
|
22
|
+
set :ssh_options, {
|
23
|
+
forward_agent: true
|
24
|
+
}
|
25
|
+
|
26
|
+
# ~~~~
|
27
|
+
|
28
|
+
# Setup Composer
|
29
|
+
set :composer_install_flags, '--no-dev --no-interaction --quiet --optimize-autoloader'
|
30
|
+
set :composer_roles, :all
|
31
|
+
set :composer_working_dir, -> { fetch(:release_path) }
|
32
|
+
set :composer_dump_autoload_flags, '--optimize'
|
33
|
+
set :composer_download_url, 'https://getcomposer.org/installer'
|
34
|
+
|
35
|
+
# ~~~~
|
36
|
+
|
37
|
+
# Setup Symlinks
|
38
|
+
set :linked_files, ["app/config/env.php", "web/.htaccess", "web/robots.txt"]
|
39
|
+
set :linked_dirs, ["web/statics/languages", "web/statics/plugins", "web/statics/uploads"]
|
metadata
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano-olympus
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Achraf Chouk
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-03-31 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: capistrano
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.4'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.4'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: capistrano-composer
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.0.6
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.0.6
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: sshkit-sudo
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.1.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.1.0
|
55
|
+
description: Capistrano 3.x deployment processes for WordPress and Olympus framework
|
56
|
+
email:
|
57
|
+
- achrafchouk@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- CHANGELOG.md
|
64
|
+
- LICENSE
|
65
|
+
- README.md
|
66
|
+
- capistrano-olympus.gemspec
|
67
|
+
- lib/capistrano-olympus.rb
|
68
|
+
- lib/capistrano/capistrano-olympus.rb
|
69
|
+
- lib/capistrano/tasks/capistrano-deploy.rake
|
70
|
+
- lib/capistrano/tasks/database.rake
|
71
|
+
- lib/capistrano/tasks/directories.rake
|
72
|
+
- lib/capistrano/tasks/files.rake
|
73
|
+
- lib/capistrano/tasks/htaccess.rake
|
74
|
+
- lib/capistrano/tasks/pagespeed.rake
|
75
|
+
- lib/capistrano/tasks/php.rake
|
76
|
+
- lib/capistrano/tasks/redis.rake
|
77
|
+
- lib/capistrano/tasks/robots.rake
|
78
|
+
- lib/capistrano/tasks/server.rake
|
79
|
+
- lib/capistrano/tasks/varnish.rake
|
80
|
+
- lib/capistrano/vars/defaults.rb
|
81
|
+
homepage: http://github.com/crewstyle/capistrano-olympus
|
82
|
+
licenses:
|
83
|
+
- MIT
|
84
|
+
metadata: {}
|
85
|
+
post_install_message:
|
86
|
+
rdoc_options: []
|
87
|
+
require_paths:
|
88
|
+
- lib
|
89
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
requirements: []
|
100
|
+
rubyforge_project:
|
101
|
+
rubygems_version: 2.4.6
|
102
|
+
signing_key:
|
103
|
+
specification_version: 4
|
104
|
+
summary: Gem especially made to build WordPress and Olympus framework websites with
|
105
|
+
Capistrano 3.x
|
106
|
+
test_files: []
|