wslave 0.3.6 → 0.3.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8daaa212535c1ecfa77f8e58081ee01f28c89d95c782dda2e6e31a608c17364f
4
- data.tar.gz: f8661cfe1d3a1a190a99a5fca0f50c5be41e081637fcf81866a798e1ab56488c
3
+ metadata.gz: ae8f5b776137111cf2c79936a1f7bc17126fe3a884441865cf5fa8895305a9ee
4
+ data.tar.gz: 9a604e9920dd201fec828720230c61036d933ac17625824f8148590864038ee0
5
5
  SHA512:
6
- metadata.gz: 2ede25542d1264752be2659c8098c847dd53b65bb696fe1a6c24be291020bc0465555262b026059c249046967f32b5cf762919b3cc55cf9c77e332ee19cead1f
7
- data.tar.gz: fdaa5e5762f5edb5f09c4264ae45a3f61594272f954e198d4bbfdca8b7743bd0f83ec33d041e46370c97238dbe71997f5dd1f0a769d4043bc3e4f6c5e3b05f1b
6
+ metadata.gz: 5cd61b1d6aed6bde6295cd27bc6d268373cb9e2a63ffc35dfaad03fb209395d209a95d45944f66eb24c588c508f546b944b2b6afb820f89fac5e960c0b36064c
7
+ data.tar.gz: 108c3f32c3fd2b2671889002f003a9c866e3a03f3757b75eac0863fad877bffbec35e660f7f31390e25a41d3a603b84b375022e4b9df2237f2f790b54acbd91d
@@ -2,8 +2,8 @@ require 'yaml'
2
2
  require 'date'
3
3
  require 'wslave_sage'
4
4
 
5
- opts = YAML.load_file('config/definitions.yml')
6
- db_info = YAML.load_file('config/database.yml')
5
+ opts = YAML.load_file('config/definitions.yml', aliases: true)
6
+ db_info = YAML.load_file('config/database.yml', aliases: true)
7
7
 
8
8
  deploy_user = opts['deployer']['user']
9
9
  deploy_group = opts['deployer']['www_data_group']
@@ -137,10 +137,10 @@ namespace :deploy do
137
137
  end
138
138
  end
139
139
 
140
- desc 'Finds and replaces localhost:8000 and your Staging address with the Production address'
140
+ desc 'Finds and replaces localhost:8000 / localhost:8001and your Staging address with the Production address'
141
141
  task :chikan do
142
142
  on roles(:web) do
143
- puts 'Replacing localhost:8000 and Production URLs with Staging URLs...'
143
+ puts 'Replacing localhost:8000 / localhost:8001 and Staging URLs with Production URLs...'
144
144
 
145
145
  # Set an anchor to first homogonize instances of URL's, then replace all the anchors
146
146
  anchor = "URL_REPLACEMENT_ANCHOR_00000"
@@ -159,14 +159,16 @@ namespace :deploy do
159
159
  # replace instances of it with something that won't match
160
160
  db_data = db_data.gsub(/#{opts['deployer']['fqdn']['production']}/, anchor)
161
161
 
162
- # Set staging URL's to the anchor
163
- if opts['deployer']['fqdn']['staging'] != ''
164
- db_data = db_data.gsub(/#{opts['deployer']['fqdn']['staging']}/, anchor)
162
+ # Set production URL's to the anchor
163
+ if opts['deployer']['fqdn']['production'] != ''
164
+ db_data = db_data.gsub(/#{opts['deployer']['fqdn']['production']}/, anchor)
165
165
  end
166
166
 
167
167
  # Set localhost entries to the anchor
168
168
  db_data = db_data.gsub(/localhost\%3A8000/, anchor)
169
169
  db_data = db_data.gsub(/localhost:8000/, anchor)
170
+ db_data = db_data.gsub(/localhost\%3A8001/, anchor)
171
+ db_data = db_data.gsub(/localhost:8001/, anchor)
170
172
 
171
173
  # Replace anchors with the correct target URL
172
174
  db_data = db_data.gsub(anchor, "#{opts['deployer']['fqdn']['production']}")
@@ -197,6 +199,16 @@ namespace :deploy do
197
199
  end
198
200
  end
199
201
 
202
+ desc 'Creates an additional symlink at the path specified in definitions.yml to current/public'
203
+ task :set_symlink do
204
+ on roles(:web) do
205
+ puts 'Setting symlink'
206
+ if (opts['deployer'].include?('symlink') && opts['deployer']['symlink'].include?('production'))
207
+ execute "ln -s #{deploy_path}/current/public #{opts['deployer']['root']}/#{opts['deployer']['symlink']['production']}"
208
+ end
209
+ end
210
+ end
211
+
200
212
  desc 'Perform special seed tasks required on intial seed'
201
213
  task :initial do
202
214
  on roles(:web) do
@@ -220,6 +232,7 @@ namespace :deploy do
220
232
  invoke('deploy:chikan')
221
233
  invoke('deploy:sage')
222
234
  invoke('deploy:set_permissions')
235
+ invoke('deploy:set_symlink')
223
236
  end
224
237
  end
225
238
 
@@ -2,8 +2,8 @@ require 'yaml'
2
2
  require 'date'
3
3
  require 'wslave_sage'
4
4
 
5
- opts = YAML.load_file('config/definitions.yml')
6
- db_info = YAML.load_file('config/database.yml')
5
+ opts = YAML.load_file('config/definitions.yml', aliases: true)
6
+ db_info = YAML.load_file('config/database.yml', aliases: true)
7
7
 
8
8
  deploy_user = opts['deployer']['user']
9
9
  deploy_group = opts['deployer']['www_data_group']
@@ -137,10 +137,10 @@ namespace :deploy do
137
137
  end
138
138
  end
139
139
 
140
- desc 'Finds and replaces localhost:8000 and your Production address with the Staging address'
140
+ desc 'Finds and replaces localhost:8000 / localhost:8001 and your Production address with the Staging address'
141
141
  task :chikan do
142
142
  on roles(:web) do
143
- puts 'Replacing localhost:8000 and Production URLs with Staging URLs...'
143
+ puts 'Replacing localhost:8000 / localhost:8001 and Production URLs with Staging URLs...'
144
144
 
145
145
  # Set an anchor to first homogonize instances of URL's, then replace all the anchors
146
146
  anchor = "URL_REPLACEMENT_ANCHOR_00000"
@@ -167,6 +167,8 @@ namespace :deploy do
167
167
  # Set localhost entries to the anchor
168
168
  db_data = db_data.gsub(/localhost\%3A8000/, anchor)
169
169
  db_data = db_data.gsub(/localhost:8000/, anchor)
170
+ db_data = db_data.gsub(/localhost\%3A8001/, anchor)
171
+ db_data = db_data.gsub(/localhost:8001/, anchor)
170
172
 
171
173
  # Replace anchors with the correct target URL
172
174
  db_data = db_data.gsub(anchor, "#{opts['deployer']['fqdn']['staging']}")
@@ -197,6 +199,16 @@ namespace :deploy do
197
199
  end
198
200
  end
199
201
 
202
+ desc 'Creates an additional symlink at the path specified in definitions.yml to current/public'
203
+ task :set_symlink do
204
+ on roles(:web) do
205
+ puts 'Setting symlink'
206
+ if (opts['deployer'].include?('symlink') && opts['deployer']['symlink'].include?('staging'))
207
+ execute "ln -s #{deploy_path}/current/public #{opts['deployer']['root']}/#{opts['deployer']['symlink']['staging']}"
208
+ end
209
+ end
210
+ end
211
+
200
212
  desc 'Perform special seed tasks required on intial seed'
201
213
  task :initial do
202
214
  on roles(:web) do
@@ -220,6 +232,7 @@ namespace :deploy do
220
232
  invoke('deploy:chikan')
221
233
  invoke('deploy:sage')
222
234
  invoke('deploy:set_permissions')
235
+ invoke('deploy:set_symlink')
223
236
  end
224
237
  end
225
238
 
@@ -8,8 +8,8 @@ def GenerateWPConfig(profile = 'production', out_path = './')
8
8
  config_path = File.dirname(File.expand_path(File.dirname(__FILE__)))
9
9
  vars = {}
10
10
  vars[:profile] = profile.to_sym
11
- vars[:db_info] = YAML.load_file("#{config_path}/database.yml")
12
- vars[:salt] = YAML.load_file("#{config_path}/salts.yml")
11
+ vars[:db_info] = YAML.load_file("#{config_path}/database.yml", aliases: true)
12
+ vars[:salt] = YAML.load_file("#{config_path}/salts.yml", aliases: true)
13
13
 
14
14
  erb_source = File.read("#{config_path}/deploy-tools/wp-config.php.erb")
15
15
  rend = ERB.new(erb_source)
@@ -2,7 +2,7 @@
2
2
  lock "3.17.0"
3
3
 
4
4
  require 'yaml'
5
- opts = YAML.load_file('config/definitions.yml')
5
+ opts = YAML.load_file('config/definitions.yml', aliases: true)
6
6
 
7
7
  set :application, opts['app']['name']
8
8
  set :repo_url, opts['app']['repo']
@@ -1,4 +1,4 @@
1
- FROM php:7.4-apache
1
+ FROM php:8.1-apache
2
2
 
3
3
  RUN a2enmod rewrite
4
4
  RUN service apache2 restart
@@ -1,27 +1,47 @@
1
- FROM ubuntu:20.04
1
+ FROM ubuntu:22.04
2
2
 
3
3
  RUN apt-get update && apt-get dist-upgrade -y
4
4
  RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata
5
- # NOTE: When the PHP FPM version changes, you MUST update the
6
- # version named in base/docker/nginx/supervisord.conf and
7
- # in base/docker/nginx/nginx.vhost, then rebuild the nweb image!
8
- RUN apt-get install -y nginx php7.4-fpm php-mysql \
9
- php7.4-mbstring php7.4-curl php7.4-dom php7.4-exif php7.4-fileinfo \
10
- php7.4-json php7.4-imagick php7.4-xml php7.4-zip php7.4-iconv \
5
+
6
+ RUN apt-get install -y nginx php-fpm php-mysql \
7
+ php-mbstring php-curl php-dom \
8
+ php-imagick php-xml php-zip \
9
+ composer nodejs npm \
11
10
  libpng-dev libjpeg-dev \
12
11
  mariadb-client mariadb-common \
13
- supervisor curl
12
+ supervisor curl less neovim emacs
14
13
  RUN apt-get clean
15
- RUN adduser www-data root
14
+
16
15
  RUN mkdir /db \
17
- && chmod 777 /db
16
+ && chmod 777 /db
18
17
 
19
18
  COPY nginx.vhost /etc/nginx/sites-enabled/default
20
19
  COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
21
- COPY php.ini /etc/php/7.4/fpm/php.ini
20
+
21
+ # NOTE: When the PHP FPM version changes, you MUST change the
22
+ # version definition right below this comment, then you must
23
+ # rebuild the nweb image!
24
+ ARG PHP_FPM_VERSION=8.1
25
+ RUN mkdir -p /run/php
26
+ COPY php.ini /etc/php/$PHP_FPM_VERSION/fpm/php.ini
27
+ RUN ln -s /usr/sbin/php-fpm$PHP_FPM_VERSION /usr/sbin/php-fpm
28
+ RUN ln -s /run/php/php$PHP_FPM_VERSION-fpm.sock /run/php/php-fpm.sock
29
+ RUN ln -s /run/php/php$PHP_FPM_VERSION-fpm.pid /run/php/php-fpm.pid
30
+
31
+ RUN npm install yarn -g
32
+
33
+ # The lines below install wp-cli in the container. However, since
34
+ # wp-cli is run as root it causes various permission problems. In
35
+ # the future this may be re-added with some method of correcting
36
+ # permissions. Until then, please use wp-cli locally.
37
+ #RUN curl https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -o /usr/local/bin/wp
38
+ #RUN chmod +x /usr/local/bin/wp
39
+ #RUN mkdir /root/.wp-cli
40
+ #COPY wp-cli.yml /root/.wp-cli/config.yml
41
+ #RUN echo 'alias wp="wp --allow-root"' >> /root/.bashrc
22
42
 
23
43
  RUN ln -sf /dev/stdout /var/log/nginx/access.log \
24
- && ln -sf /dev/stderr /var/log/nginx/error.log
44
+ && ln -sf /dev/stderr /var/log/nginx/error.log
25
45
 
26
46
  EXPOSE 80
27
47
 
@@ -30,7 +30,7 @@ server {
30
30
 
31
31
  rewrite ^/index\.php$ /wordpress/index.php last;
32
32
  include snippets/fastcgi-php.conf;
33
- fastcgi_pass unix:/run/php/php7.4-fpm.sock;
33
+ fastcgi_pass unix:/run/php/php-fpm.sock;
34
34
  }
35
35
 
36
36
  try_files $uri $uri/ /index.php?$args;