864264f6 by Jeff Balicki

deploy

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent 7c914fb6
---
BUNDLE_PATH: "vendor/bundle"
# BEGIN WordPress
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
\ No newline at end of file
# 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 }
source 'https://rubygems.org'
gem "capistrano", "~> 3.10"
gem 'capistrano-composer'
GEM
remote: https://rubygems.org/
specs:
airbrussh (1.4.1)
sshkit (>= 1.6.1, != 1.7.0)
capistrano (3.17.1)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
sshkit (>= 1.9.0)
capistrano-composer (0.0.6)
capistrano (>= 3.0.0.pre)
concurrent-ruby (1.1.10)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (7.0.1)
rake (13.0.6)
sshkit (1.21.2)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
PLATFORMS
x86_64-darwin-21
x86_64-darwin-22
DEPENDENCIES
capistrano (~> 3.10)
capistrano-composer
BUNDLED WITH
2.3.21
set :application, 'msf-climate-hub'
set :repo_url, 'git@git.gotenzing.com:msf/msf-climate-hub.git'
# Branch options
# Prompts for the branch name (defaults to current branch)
#ask :branch, -> { `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"
SSHKit.config.command_map[:composer] = "/usr/bin/php74 /home/tenzing_www/composer.phar"
set :keep_releases, 2
set :deploy_to, -> { "/var/www/html/production/#{fetch(:application)}" }
# Use :debug for more verbose output when troubleshooting
set :log_level, :info
# Put all shared files/directories here (e.g. uploads that need to go on the NFS drive)
set :linked_files, fetch(:linked_files, []).push('.env')
set :linked_dirs, fetch(:linked_dirs, []).push('wp-content/uploads', 'wp-content/storage', 'wp-content/languages', 'wp-content/cache')
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
# Your restart mechanism here, for example:
# execute :service, :nginx, :reload
end
end
end
namespace :deploy do
desc 'Sync servers'
task :sync do
on roles(:web), in: :sequence, wait: 5 do
execute "cd '#{release_path}/'; rm -Rf .git/ "
execute("si #{fetch(:application)}")
end
end
end
namespace :deploy do
desc 'Sync servers'
task :sync_again do
on roles(:web), in: :sequence, wait: 5 do
execute("si #{fetch(:application)}")
end
end
end
namespace :deploy do
desc 'Install composer packages in msf-child theme'
task :install_theme_packages do
on roles(:web), in: :sequence, wait: 5 do
execute "cd '#{release_path}/wp-content/themes/msf-child'; /usr/bin/php74 /home/tenzing_www/composer.phar install --no-dev --prefer-dist --no-interaction --quiet --optimize-autoloader"
end
end
end
namespace :deploy do
desc 'set file permissions'
task :set_permissions do
on roles(:web), in: :sequence, wait: 5 do
execute "cd '#{release_path}/'; chmod -Rf 777 .htaccess wp-config.php"
end
end
end
# Override `git#create_release` to handle submodules
namespace :git do
desc 'Copy repo to releases'
task create_release: :'git:update' do
on roles(:all) do
with fetch(:git_environmental_variables) do
within repo_path do
execute :git, :clone, '-b', fetch(:branch), '--recursive', '.', release_path
end
end
end
end
end
# The above update_option_paths task is not run by default
# Note that you need to have WP-CLI installed on your server
# Uncomment the following line to run it on deploys if needed
# after 'deploy:publishing', 'deploy:update_option_paths'
#after 'deploy:updated', 'deploy:install_theme_packages'
after 'deploy:updated', 'deploy:sync'
#after 'deploy:updated', 'deploy:set_permissions'
after 'deploy:finished', 'deploy:sync_again'
set :stage, :production
# Simple Role Syntax
# ==================
role :web, %w{tenzing_www@web-1}
# 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)
set :application, 'msf-climate-hub'
set :stage, :staging
set :branch, "master"
# Simple Role Syntax
# ==================
role :web, %w{tenzing_www@web-1}
# 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)
<?php
phpinfo();
// $fields =
// array (
// 'location' =>
// array (
// 'name' => 'Location',
// 'field_name' => 'location',
// 'type' => 'textfield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'multiline' => 'no',
// ),
// ),
// 'city' =>
// array (
// 'name' => 'City',
// 'field_name' => 'city',
// 'type' => 'textfield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'multiline' => 'no',
// ),
// ),
// 'event_date' =>
// array (
// 'name' => 'Event Start Date',
// 'field_name' => 'event_date',
// 'type' => 'datefield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'date_format' => 'Short',
// 'custom_date_format' => '',
// ),
// ),
// 'event_date_end' =>
// array (
// 'name' => 'Event End Date (optional)',
// 'field_name' => 'event_date_end',
// 'type' => 'datefield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'date_format' => 'Short',
// 'custom_date_format' => '',
// ),
// ),
// 'time_start' =>
// array (
// 'name' => 'Start Time',
// 'field_name' => 'time_start',
// 'type' => 'textfield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'multiline' => 'no',
// ),
// ),
// 'time_end' =>
// array (
// 'name' => 'End Time',
// 'field_name' => 'time_end',
// 'type' => 'textfield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'multiline' => 'no',
// ),
// ),
// 'reg_open' =>
// array (
// 'name' => 'Registration Opens',
// 'field_name' => 'reg_open',
// 'type' => 'datefield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'date_format' => 'Short',
// 'custom_date_format' => '',
// ),
// ),
// 'early_bird_deadline' =>
// array (
// 'name' => 'Early Bird Deadline',
// 'field_name' => 'early_bird_deadline',
// 'type' => 'datefield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'date_format' => 'Medium',
// 'custom_date_format' => '',
// ),
// ),
// 'reg_deadline' =>
// array (
// 'name' => 'Registration Deadline',
// 'field_name' => 'reg_deadline',
// 'type' => 'datefield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'date_format' => 'Medium',
// 'custom_date_format' => '',
// ),
// ),
// 'cancel_deadline' =>
// array (
// 'name' => 'Cancellation Deadline',
// 'field_name' => 'cancel_deadline',
// 'type' => 'datefield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'date_format' => 'Medium',
// 'custom_date_format' => '',
// ),
// ),
// 'edit_deadline' =>
// array (
// 'name' => 'Edit Deadline',
// 'field_name' => 'edit_deadline',
// 'type' => 'datefield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'date_format' => 'Medium',
// 'custom_date_format' => '',
// ),
// ),
// 'cost' =>
// array (
// 'name' => 'Cost',
// 'field_name' => 'cost',
// 'type' => 'textfield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'multiline' => 'no',
// ),
// ),
// 'early_bird_discount' =>
// array (
// 'name' => 'Early Bird ($) Discount ',
// 'field_name' => 'early_bird_discount',
// 'type' => 'textfield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'multiline' => 'no',
// ),
// ),
// 'student_member_discount' =>
// array (
// 'name' => 'Student/Member ($) Discount',
// 'field_name' => 'student_member_discount',
// 'type' => 'textfield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'multiline' => 'no',
// ),
// ),
// 'worth_cehours' =>
// array (
// 'name' => 'Worth CE Hours',
// 'field_name' => 'worth_cehours',
// 'type' => 'textfield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'multiline' => 'no',
// ),
// ),
// 'is_archived_podcast' =>
// array (
// 'name' => 'Include in Archived Podcast',
// 'field_name' => 'is_archived_podcast',
// 'type' => 'checkbox',
// 'show_list' => false,
// 'extra' =>
// array (
// ),
// ),
// 'is_archived_webinar' =>
// array (
// 'name' => 'Include in Archived Webinars',
// 'field_name' => 'is_archived_webinar',
// 'type' => 'checkbox',
// 'show_list' => 'off',
// 'extra' =>
// array (
// ),
// ),
// 'event_include_on_home_page' =>
// array (
// 'name' => 'Include on Home Page',
// 'field_name' => 'event_include_on_home_page',
// 'type' => 'checkbox',
// 'show_list' => 'off',
// 'extra' =>
// array (
// ),
// ),
// );
// $new_fields = array();
// foreach($fields as $field){
// $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
// $charactersLength = strlen($characters);
// $randomString = '';
// for ($i = 0; $i < 13; $i++) {
// $randomString .= $characters[rand(0, $charactersLength - 1)];
// }
// error_log(print_r($field['name'], true));
// array_push($new_fields,
// array(
// 'key' => 'field_'.$randomString,
// 'label' => $field['name'],
// 'name' => $field['field_name'],
// 'type' => $field['type'],
// 'instructions' => '',
// 'required' => 0,
// 'conditional_logic' => 0,
// 'wrapper' =>
// (object) array(
// 'width' => '',
// 'class' => '',
// 'id' => '',
// ),
// 'default_value' => '',
// 'placeholder' => '',
// 'prepend' => '',
// 'append' => '',
// 'maxlength' => '',
// )
// );
// }
// var_dump(json_encode($new_fields));
<?php
require_once(__DIR__ . '/../vendor/autoload.php');
(new \Dotenv\Dotenv(__DIR__.'/../'))->load();
/**
* The base configuration for WordPress
*
......@@ -19,7 +18,8 @@ require_once(__DIR__ . '/../vendor/autoload.php');
*
* @package WordPress
*/
require_once(__DIR__ . '/vendor/autoload.php');
(new \Dotenv\Dotenv(__DIR__.'/'))->load();
// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
......