-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
1,524 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "wordpress"] | ||
path = wordpress | ||
url = https://github.com/WordPress/WordPress |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Load DSL and Setup Up Stages | ||
require 'capistrano/setup' | ||
|
||
# Includes default deployment tasks | ||
require 'capistrano/deploy' | ||
|
||
# Include the git capistrano module | ||
require "capistrano/scm/git" | ||
install_plugin Capistrano::SCM::Git | ||
|
||
# Include the git submodule strategy for capistrano | ||
require "capistrano/scm/git-with-submodules" | ||
install_plugin Capistrano::SCM::Git::WithSubmodules | ||
|
||
# Includes everything else | ||
require 'yaml' | ||
|
||
require 'capistrano/file-permissions' | ||
|
||
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined. | ||
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } | ||
|
||
|
||
set :services, [:apache2] | ||
require 'capistrano/service' |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'capistrano', '3.11.0' | ||
gem 'capistrano-git-with-submodules', '2.0.3' | ||
gem 'capistrano-file-permissions' | ||
gem 'capistrano-service' |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
airbrussh (1.4.0) | ||
sshkit (>= 1.6.1, != 1.7.0) | ||
capistrano (3.11.0) | ||
airbrussh (>= 1.0.0) | ||
i18n | ||
rake (>= 10.0.0) | ||
sshkit (>= 1.9.0) | ||
capistrano-file-permissions (1.0.0) | ||
capistrano (~> 3.0) | ||
capistrano-git-with-submodules (2.0.3) | ||
capistrano (~> 3.7) | ||
capistrano-service (0.0.2) | ||
capistrano (>= 3.0.0.pre) | ||
concurrent-ruby (1.1.6) | ||
i18n (1.8.2) | ||
concurrent-ruby (~> 1.0) | ||
net-scp (2.0.0) | ||
net-ssh (>= 2.6.5, < 6.0.0) | ||
net-ssh (5.2.0) | ||
rake (13.0.1) | ||
sshkit (1.21.0) | ||
net-scp (>= 1.1.2) | ||
net-ssh (>= 2.8.0) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
capistrano (= 3.11.0) | ||
capistrano-file-permissions | ||
capistrano-git-with-submodules (= 2.0.3) | ||
capistrano-service | ||
|
||
BUNDLED WITH | ||
2.1.4 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# wordpress_elearning | ||
# ecosystemassessments-wordpress |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
production: | ||
host: localhost | ||
database: db_name | ||
username: db_user | ||
password: 'db_pass' | ||
staging: | ||
host: localhost | ||
database: db_name | ||
username: db_user | ||
password: 'db_pass' | ||
local: | ||
host: localhost | ||
database: db_name | ||
username: root | ||
password: 'root' |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
production: | ||
host: localhost | ||
database: db_name | ||
username: db_user | ||
password: 'db_pass' | ||
staging: | ||
host: localhost | ||
database: db_name | ||
username: db_user | ||
password: 'db_pass' | ||
local: | ||
host: localhost | ||
database: db_name | ||
username: root | ||
password: 'root' |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
################################################################################ | ||
## Setup project | ||
################################################################################ | ||
|
||
# Lock the project to Capistrano 3.11.0 | ||
lock '3.11.0' | ||
|
||
# The WordPress admin user | ||
set :wp_user, 'yourname' | ||
|
||
# The WordPress admin email address | ||
set :wp_email, '[email protected]' | ||
|
||
# The WordPress 'Site Title' for the website | ||
set :wp_sitename, 'WP Deploy' | ||
|
||
# The local environment URL. | ||
set :wp_localurl, 'http://wpdeploy.local' | ||
|
||
# An identifying name for the application to be used by Capistrano | ||
set :application, 'wp-deploy' | ||
set :repo_url, '[email protected]:Mixd/wp-deploy.git' | ||
|
||
|
||
################################################################################ | ||
## Setup Capistrano | ||
################################################################################ | ||
|
||
set :log_level, :debug | ||
set :keep_releases, 2 | ||
set :use_sudo, false | ||
set :ssh_options, forward_agent: true | ||
|
||
|
||
################################################################################ | ||
## Linked files and directories (symlinks) | ||
################################################################################ | ||
|
||
set :linked_files, %w(wp-config.php .htaccess robots.txt) | ||
set :linked_dirs, %w(content/uploads) | ||
|
||
namespace :deploy do | ||
desc 'create WordPress files for symlinking' | ||
task :create_wp_files do | ||
on roles(:app) do | ||
execute :touch, "#{shared_path}/wp-config.php" | ||
execute :touch, "#{shared_path}/.htaccess" | ||
execute :touch, "#{shared_path}/robots.txt" | ||
end | ||
end | ||
|
||
after 'check:make_linked_dirs', :create_wp_files | ||
after :finishing, 'deploy:cleanup' | ||
end |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
################################################################################ | ||
## Setup project | ||
################################################################################ | ||
|
||
# Lock the project to Capistrano 3.11.0 | ||
lock '3.11.0' | ||
|
||
# The WordPress admin user | ||
set :wp_user, 'wcmc' | ||
|
||
# The WordPress admin email address | ||
set :wp_email, '[email protected]' | ||
|
||
set :deploy_user, 'wcmc' | ||
|
||
# The WordPress 'Site Title' for the website | ||
set :wp_sitename, 'ecosystemassessments' | ||
|
||
# The local environment URL. | ||
set :wp_localurl, 'http://wpdeploy.local' | ||
|
||
# An identifying name for the application to be used by Capistrano | ||
set :application, 'ecosystemassessments' | ||
set :repo_url, '[email protected]:unepwcmc/ecosystemassessments-wordpress.git' | ||
|
||
|
||
################################################################################ | ||
## Setup Capistrano | ||
################################################################################ | ||
|
||
set :log_level, :debug | ||
set :keep_releases, 2 | ||
set :use_sudo, false | ||
set :ssh_options, forward_agent: true | ||
|
||
|
||
################################################################################ | ||
## Linked files and directories (symlinks) | ||
################################################################################ | ||
|
||
set :linked_files, %w(wp-config.php .htaccess robots.txt index.php content/themes/ea/.env) | ||
set :linked_dirs, %w(content/uploads content/plugins content/languages) | ||
|
||
|
||
set :file_permissions_paths, ["content"] | ||
set :file_permissions_users, ["www-data"] | ||
set :file_permissions_chmod_mode, "0755" | ||
set :file_permissions_groups, ["www-data"] | ||
|
||
|
||
before "deploy:updated", "deploy:set_permissions:acl" | ||
|
||
namespace :deploy do | ||
desc 'create WordPress files for symlinking' | ||
task :create_wp_files do | ||
on roles(:app) do | ||
execute :touch, "#{shared_path}/wp-config.php" | ||
execute :touch, "#{shared_path}/.htaccess" | ||
execute :touch, "#{shared_path}/robots.txt" | ||
end | ||
end | ||
|
||
after 'check:make_linked_dirs', :create_wp_files | ||
after :finishing, 'deploy:cleanup' | ||
end | ||
|
||
|
||
namespace :deploy do | ||
after :publishing, 'service:apache2:restart' | ||
end |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
################################################################################ | ||
## Setup Environment | ||
################################################################################ | ||
|
||
# The Git branch this environment should be attached to. | ||
set :branch, 'master' | ||
|
||
# The environment's name. To be used in commands and other references. | ||
set :stage, :production | ||
|
||
# The URL of the website in this environment. | ||
set :stage_url, 'http://www.example.com' | ||
|
||
# The environment's server credentials | ||
server 'XXX.XXX.XX.XXX', user: 'SSHUSER', roles: %w(web app db) | ||
|
||
# The deploy path to the website on this environment's server. | ||
set :deploy_to, '/deploy/to/path' | ||
|
||
# The web user on this environment's server. | ||
set :web_user, 'www-data' |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
################################################################################ | ||
## Setup Environment | ||
################################################################################ | ||
|
||
# The Git branch this environment should be attached to. | ||
set :branch, 'development' | ||
|
||
# The environment's name. To be used in commands and other references. | ||
set :stage, :staging | ||
|
||
# The URL of the website in this environment. | ||
set :stage_url, 'http://www.example.com' | ||
|
||
# The environment's server credentials | ||
server 'XXX.XXX.XX.XXX', user: 'SSHUSER', roles: %w(web app db) | ||
|
||
# The deploy path to the website on this environment's server. | ||
set :deploy_to, '/deploy/to/path' | ||
|
||
# The web user on this environment's server. | ||
set :web_user, 'www-data' |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
################################################################################ | ||
## Setup Environment | ||
################################################################################ | ||
|
||
# The Git branch this environment should be attached to. | ||
set :branch, 'master' | ||
|
||
# The environment's name. To be used in commands and other references. | ||
set :stage, :staging | ||
|
||
# The URL of the website in this environment. | ||
set :stage_url, 'elearning.staging.wordpress-linode.linode.unep-wcmc.org' | ||
|
||
# The environment's server credentials | ||
server 'staging.wordpress-linode.linode.unep-wcmc.org', user: 'wcmc', roles: %w(web app db) | ||
|
||
# The deploy path to the website on this environment's server. | ||
set :deploy_to, "/home/#{fetch(:deploy_user)}/#{fetch(:application)}" | ||
|
||
# The web user on this environment's server. | ||
set :web_user, 'www-data' |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# BEGIN WordPress | ||
|
||
<IfModule mod_rewrite.c> | ||
RewriteEngine On | ||
RewriteBase / | ||
RewriteRule ^index\.php$ - [L] | ||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
RewriteRule . /index.php [L] | ||
</IfModule> | ||
|
||
# END WordPress |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
User-agent: * | ||
Disallow: / |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
define('DB_NAME', '<%= database['database'] %>'); | ||
define('DB_USER', '<%= database['username'] %>'); | ||
define('DB_PASSWORD', '<%= database['password'] %>'); | ||
define('DB_HOST', '<%= database['host'] %>'); | ||
define('DB_CHARSET', 'utf8'); | ||
define('DB_COLLATE', ''); | ||
define('WPLANG', ''); | ||
define('WP_DEBUG', true); | ||
|
||
$table_prefix = 'wp_'; | ||
|
||
<%= secret_keys %> | ||
|
||
define('WP_HOME', '<%= wp_siteurl %>'); | ||
define('WP_SITEURL','<%= wp_siteurl %>/wordpress'); | ||
|
||
define('WP_CONTENT_URL', '<%= wp_siteurl %>/content'); | ||
|
||
/** | ||
* Depending on your server configuration, you may find WordPress fails to find your content (themes and plugins). | ||
* This is due to how your server returns `$_SERVER['DOCUMENT_ROOT']`. If this issue affects you, try swapping | ||
* for the `dirname(__FILE__)` method below. | ||
*/ | ||
|
||
// define('WP_CONTENT_DIR', realpath(dirname(__FILE__) . '/content')); | ||
define('WP_CONTENT_DIR', realpath($_SERVER['DOCUMENT_ROOT'] . '/content')); | ||
|
||
if (!defined('ABSPATH')) { | ||
define('ABSPATH', dirname(__FILE__) . '/'); | ||
} | ||
|
||
require_once(ABSPATH . 'wp-settings.php'); |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# BEGIN WordPress | ||
|
||
<IfModule mod_rewrite.c> | ||
RewriteEngine On | ||
RewriteBase / | ||
RewriteRule ^index\.php$ - [L] | ||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
RewriteRule . /index.php [L] | ||
</IfModule> | ||
|
||
# END WordPress |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
User-agent: * | ||
Disallow: /wordpress/wp-admin/ | ||
Allow: /wordpress/wp-admin/admin-ajax.php |
Oops, something went wrong.