wslave 0.0.15 → 0.2.0
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 +5 -5
- data/base/.gitignore +5 -0
- data/base/Rakefile +22 -6
- data/base/config/deploy-tools/gen-nginx-vhost.rb +11 -0
- data/base/config/deploy-tools/nginx.vhost.erb +51 -0
- data/base/config/deploy.rb +1 -1
- data/base/config/deploy/production.rb +135 -7
- data/base/config/deploy/staging.rb +135 -8
- data/base/docker-compose.yml +14 -9
- data/base/{Dockerfile → docker/apache/Dockerfile} +2 -4
- data/base/docker/nginx/Dockerfile +24 -0
- data/base/docker/nginx/nginx.vhost +48 -0
- data/base/docker/nginx/supervisord.conf +23 -0
- data/base/public/.htaccess +11 -0
- data/bin/wslave +76 -22
- data/lib/wslave_docker.rb +34 -3
- data/lib/wslave_new.rb +48 -9
- data/lib/wslave_sage.rb +70 -3
- data/lib/wslave_tools.rb +0 -1
- data/lib/wslave_update.rb +2 -2
- data/templates/config/definitions.yml +6 -1
- data/wslave.gemspec +9 -6
- metadata +78 -9
data/lib/wslave_sage.rb
CHANGED
@@ -1,9 +1,76 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
1
3
|
class WSlaveSage
|
2
|
-
|
4
|
+
attr_reader :theme_name
|
5
|
+
|
6
|
+
def initialize()
|
7
|
+
@theme_name = ''
|
8
|
+
end
|
9
|
+
|
10
|
+
def create(name)
|
3
11
|
unless File.exist?("./config/.wslave")
|
4
12
|
puts "This command must be run in the root of a WSlave setup"
|
5
13
|
end
|
6
|
-
|
7
|
-
|
14
|
+
|
15
|
+
name = 'wslave-sage-theme' if name.empty?
|
16
|
+
project_root = Dir.pwd
|
17
|
+
|
18
|
+
puts "Creating Sage theme at public/wp-content/themes/#{name}"
|
19
|
+
`cd public/wp-content/themes && composer create-project roots/sage #{name} dev-master`
|
20
|
+
|
21
|
+
Dir.chdir project_root
|
22
|
+
_write_wslave_sage_config(name)
|
23
|
+
_overwrite_sage_webpack_browsersync_config
|
24
|
+
end
|
25
|
+
|
26
|
+
def update()
|
27
|
+
return unless _check()
|
28
|
+
system("cd public/wp-content/themes/#{@theme_name} && yarn && yarn build")
|
29
|
+
end
|
30
|
+
|
31
|
+
def dev()
|
32
|
+
return unless _check()
|
33
|
+
system("cd public/wp-content/themes/#{@theme_name} && yarn start")
|
34
|
+
end
|
35
|
+
|
36
|
+
def build()
|
37
|
+
return unless _check()
|
38
|
+
system("cd public/wp-content/themes/#{@theme_name} && yarn build")
|
39
|
+
end
|
40
|
+
|
41
|
+
def production()
|
42
|
+
return unless _check()
|
43
|
+
system("cd public/wp-content/themes/#{@theme_name} && yarn build:production")
|
44
|
+
end
|
45
|
+
|
46
|
+
def theme_name?()
|
47
|
+
return '' unless _check()
|
48
|
+
@theme_name
|
49
|
+
end
|
50
|
+
|
51
|
+
def _write_wslave_sage_config(name)
|
52
|
+
File.open("./config/sage.yml", 'w') {|f| YAML.dump({theme: name}, f)}
|
53
|
+
end
|
54
|
+
|
55
|
+
def _overwrite_sage_webpack_browsersync_config
|
56
|
+
return unless _check()
|
57
|
+
theme_info = YAML.load_file("./config/sage.yml")
|
58
|
+
Dir.chdir "#{Dir.pwd}/public/wp-content/themes/#{theme_info[:theme]}"
|
59
|
+
|
60
|
+
webpack_config_path = './webpack.mix.js'
|
61
|
+
new_webpack_config = File.read(webpack_config_path).gsub(
|
62
|
+
/browserSync\('sage.test'\)/, "browserSync('localhost:8000')"
|
63
|
+
)
|
64
|
+
File.open(webpack_config_path, 'w') { |f| f.puts new_webpack_config }
|
65
|
+
end
|
66
|
+
|
67
|
+
def _check()
|
68
|
+
if (File.exist?("./config/.wslave") && File.exist?("./config/sage.yml"))
|
69
|
+
theme_info = YAML.load_file("./config/sage.yml")
|
70
|
+
@theme_name = theme_info[:theme]
|
71
|
+
return true
|
72
|
+
end
|
73
|
+
puts "This does not appear to be the root of a WSlave managed app with a Sage theme."
|
74
|
+
false
|
8
75
|
end
|
9
76
|
end
|
data/lib/wslave_tools.rb
CHANGED
@@ -3,7 +3,6 @@ require 'fileutils'
|
|
3
3
|
class WSlaveTools
|
4
4
|
def self.wslave_root?()
|
5
5
|
return true if (File.exist?("./config/.wslave") &&
|
6
|
-
File.exist?("Dockerfile") &&
|
7
6
|
File.exist?("docker-compose.yml"))
|
8
7
|
puts "This does not appear to be the root of a WSlave managed app."
|
9
8
|
puts "Run command again from the root directory of a WSlave app."
|
data/lib/wslave_update.rb
CHANGED
@@ -9,7 +9,7 @@ class WSlaveUpdate
|
|
9
9
|
path = Dir.pwd
|
10
10
|
if !File.exist?("#{path}/config/.wslave")
|
11
11
|
puts "!!!This command must be run in a WSlave generated project!!!"
|
12
|
-
|
12
|
+
return
|
13
13
|
end
|
14
14
|
|
15
15
|
base_path = File.expand_path "#{__dir__}/../base/"
|
@@ -21,7 +21,7 @@ class WSlaveUpdate
|
|
21
21
|
FileUtils.cp("#{base_path}/Capfile", "#{path}/Capfile")
|
22
22
|
# FileUtils.cp("#{base_path}/Gemfile", "#{path}/Gemfile")
|
23
23
|
FileUtils.cp("#{base_path}/Rakefile", "#{path}/Rakefile")
|
24
|
-
FileUtils.
|
24
|
+
FileUtils.cp_r("#{base_path}/docker", "#{path}/")
|
25
25
|
FileUtils.cp("#{base_path}/docker-compose.yml", "#{path}/docker-compose.yml")
|
26
26
|
FileUtils.cp("#{base_path}/public/.htaccess", "#{path}/public/.htaccess")
|
27
27
|
FileUtils.cp_r(Dir.glob("#{base_path}/config/*"), "#{path}/config")
|
@@ -1,5 +1,7 @@
|
|
1
1
|
deployer:
|
2
|
-
user:
|
2
|
+
user:
|
3
|
+
# Uncomment this line if you are not on a shared host/if your web server runs under a different user than what you specified in the user field above
|
4
|
+
# www_data_group: www-data
|
3
5
|
host:
|
4
6
|
staging:
|
5
7
|
production:
|
@@ -7,6 +9,9 @@ deployer:
|
|
7
9
|
fqdn:
|
8
10
|
staging:
|
9
11
|
production:
|
12
|
+
branch:
|
13
|
+
staging: master
|
14
|
+
production: master
|
10
15
|
app:
|
11
16
|
name:
|
12
17
|
repo:
|
data/wslave.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'wslave'
|
3
|
-
s.version = '0.0
|
3
|
+
s.version = '0.2.0'
|
4
4
|
s.licenses = ['GPL-3.0', 'AGPL-3.0']
|
5
5
|
s.summary = '"Word Slave" generates and controls a WordPress installation'
|
6
6
|
s.description = 'Word Slave includes the wslave command and a control library to generate a ' \
|
@@ -20,10 +20,13 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.bindir = 'bin'
|
21
21
|
s.executables << 'wslave'
|
22
22
|
|
23
|
-
s.add_dependency 'capistrano', '= 3.
|
24
|
-
s.add_dependency 'capistrano-git-with-submodules', '~> 2.0'
|
25
|
-
s.add_dependency 'capistrano-scm-copy', '~> 0.7'
|
23
|
+
s.add_dependency 'capistrano', '= 3.14.1'
|
24
|
+
s.add_dependency 'capistrano-git-with-submodules', '~> 2.0', '2.0.4'
|
25
|
+
s.add_dependency 'capistrano-scm-copy', '~> 0.7', '0.7.0'
|
26
|
+
s.add_dependency 'capistrano-file-permissions', '~> 1.0', '1.0.0'
|
26
27
|
|
27
|
-
s.add_dependency '
|
28
|
-
|
28
|
+
s.add_dependency 'git', '~> 1.7', '1.7.0'
|
29
|
+
|
30
|
+
s.add_dependency 'thor', '~> 1.0', '1.0.1'
|
31
|
+
s.add_dependency 'haikunator', '~> 1.1', '1.1.0'
|
29
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wslave
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rei Kagetsuki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.
|
19
|
+
version: 3.14.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.
|
26
|
+
version: 3.14.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: capistrano-git-with-submodules
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -31,6 +31,9 @@ dependencies:
|
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '2.0'
|
34
|
+
- - '='
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 2.0.4
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -38,6 +41,9 @@ dependencies:
|
|
38
41
|
- - "~>"
|
39
42
|
- !ruby/object:Gem::Version
|
40
43
|
version: '2.0'
|
44
|
+
- - '='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 2.0.4
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: capistrano-scm-copy
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,6 +51,9 @@ dependencies:
|
|
45
51
|
- - "~>"
|
46
52
|
- !ruby/object:Gem::Version
|
47
53
|
version: '0.7'
|
54
|
+
- - '='
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 0.7.0
|
48
57
|
type: :runtime
|
49
58
|
prerelease: false
|
50
59
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -52,20 +61,69 @@ dependencies:
|
|
52
61
|
- - "~>"
|
53
62
|
- !ruby/object:Gem::Version
|
54
63
|
version: '0.7'
|
64
|
+
- - '='
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 0.7.0
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: capistrano-file-permissions
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - "~>"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '1.0'
|
74
|
+
- - '='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 1.0.0
|
77
|
+
type: :runtime
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '1.0'
|
84
|
+
- - '='
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 1.0.0
|
87
|
+
- !ruby/object:Gem::Dependency
|
88
|
+
name: git
|
89
|
+
requirement: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - "~>"
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '1.7'
|
94
|
+
- - '='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 1.7.0
|
97
|
+
type: :runtime
|
98
|
+
prerelease: false
|
99
|
+
version_requirements: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.7'
|
104
|
+
- - '='
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: 1.7.0
|
55
107
|
- !ruby/object:Gem::Dependency
|
56
108
|
name: thor
|
57
109
|
requirement: !ruby/object:Gem::Requirement
|
58
110
|
requirements:
|
59
111
|
- - "~>"
|
60
112
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0
|
113
|
+
version: '1.0'
|
114
|
+
- - '='
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: 1.0.1
|
62
117
|
type: :runtime
|
63
118
|
prerelease: false
|
64
119
|
version_requirements: !ruby/object:Gem::Requirement
|
65
120
|
requirements:
|
66
121
|
- - "~>"
|
67
122
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0
|
123
|
+
version: '1.0'
|
124
|
+
- - '='
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: 1.0.1
|
69
127
|
- !ruby/object:Gem::Dependency
|
70
128
|
name: haikunator
|
71
129
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,6 +131,9 @@ dependencies:
|
|
73
131
|
- - "~>"
|
74
132
|
- !ruby/object:Gem::Version
|
75
133
|
version: '1.1'
|
134
|
+
- - '='
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: 1.1.0
|
76
137
|
type: :runtime
|
77
138
|
prerelease: false
|
78
139
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -80,6 +141,9 @@ dependencies:
|
|
80
141
|
- - "~>"
|
81
142
|
- !ruby/object:Gem::Version
|
82
143
|
version: '1.1'
|
144
|
+
- - '='
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: 1.1.0
|
83
147
|
description: Word Slave includes the wslave command and a control library to generate
|
84
148
|
a "best practice" WordPress installation and includes a pre-rolled Docker setup
|
85
149
|
for running a development server and a Capistrano setup for deployment.
|
@@ -89,18 +153,24 @@ executables:
|
|
89
153
|
extensions: []
|
90
154
|
extra_rdoc_files: []
|
91
155
|
files:
|
156
|
+
- base/.gitignore
|
92
157
|
- base/Capfile
|
93
|
-
- base/Dockerfile
|
94
158
|
- base/Gemfile
|
95
159
|
- base/Rakefile
|
160
|
+
- base/config/deploy-tools/gen-nginx-vhost.rb
|
96
161
|
- base/config/deploy-tools/gen-salts.rb
|
97
162
|
- base/config/deploy-tools/gen-wp-config.rb
|
163
|
+
- base/config/deploy-tools/nginx.vhost.erb
|
98
164
|
- base/config/deploy-tools/wp-config.php.erb
|
99
165
|
- base/config/deploy-tools/wp-config.php.local
|
100
166
|
- base/config/deploy.rb
|
101
167
|
- base/config/deploy/production.rb
|
102
168
|
- base/config/deploy/staging.rb
|
103
169
|
- base/docker-compose.yml
|
170
|
+
- base/docker/apache/Dockerfile
|
171
|
+
- base/docker/nginx/Dockerfile
|
172
|
+
- base/docker/nginx/nginx.vhost
|
173
|
+
- base/docker/nginx/supervisord.conf
|
104
174
|
- base/public/.htaccess
|
105
175
|
- base/public/wp-config.php
|
106
176
|
- bin/wslave
|
@@ -132,8 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
202
|
- !ruby/object:Gem::Version
|
133
203
|
version: '0'
|
134
204
|
requirements: []
|
135
|
-
|
136
|
-
rubygems_version: 2.6.14
|
205
|
+
rubygems_version: 3.1.2
|
137
206
|
signing_key:
|
138
207
|
specification_version: 4
|
139
208
|
summary: '"Word Slave" generates and controls a WordPress installation'
|