theme-juice 0.10.3 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,6 +18,8 @@ module ThemeJuice
18
18
  attr_accessor :verbose
19
19
  attr_accessor :dryrun
20
20
  attr_accessor :nginx
21
+ attr_accessor :stage
22
+ attr_accessor :cap
21
23
 
22
24
  def vm_box=(val)
23
25
  @vm_box = val ||= ENV.fetch("TJ_VM_BOX") { "git@github.com:ericmann/vvv-apache.git" }
@@ -0,0 +1,41 @@
1
+ require "ostruct"
2
+
3
+ module ThemeJuice
4
+ module HashHelper
5
+
6
+ def symbolize_keys
7
+ inject({}) do |acc, (k, v)|
8
+ key = String === k ? k.to_sym : k
9
+ value = Hash === v ? v.symbolize_keys : v
10
+ acc[key] = value
11
+ acc
12
+ end
13
+ end
14
+
15
+ # @TODO This is probably not a good idea...
16
+ def method_missing(method, *args, &block)
17
+ if to_ostruct.respond_to? method
18
+ to_ostruct.send method
19
+ else
20
+ super
21
+ end
22
+ end
23
+
24
+ def to_ostruct(acc = self, opts = {})
25
+ if opts[:recursive]
26
+ case acc
27
+ when Hash
28
+ OpenStruct.new Hash[acc.map { |k, v| [k, to_ostruct(v, opts)] }]
29
+ when Array
30
+ acc.map { |x| to_ostruct(x, opts) }
31
+ else
32
+ acc
33
+ end
34
+ else
35
+ OpenStruct.new acc
36
+ end
37
+ end
38
+ end
39
+ end
40
+
41
+ Hash.send :include, ThemeJuice::HashHelper
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "TJ" "1" "June 2015" "" "Theme Juice Manual"
4
+ .TH "TJ" "1" "July 2015" "" "Theme Juice Manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBtj\fR \- WordPress development made easy
@@ -10,13 +10,13 @@
10
10
  \fBtj\fR [\fIcommand\fR] [\-\-flag=\fIarg\fR] [\-\-flag]
11
11
  .
12
12
  .SH "DESCRIPTION"
13
- \fBtj\fR is a WordPress development command line utility that allows you to scaffold out an entire Vagrant development environment in seconds (using an Apache fork of VVV \fIhttps://github\.com/Varying\-Vagrant\-Vagrants/VVV\fR called VVV\-Apache \fIhttps://github\.com/ericmann/vvv\-apache\.git\fR as the VM)\. It also helps you manage dependencies and build tools, and can even handle your deployments\.
13
+ Theme Juice (tj(1)) is a command line utility modern for WordPress development\. It allows you to scaffold out a vagrant(1) development environment in seconds (using an apache(7) fork of vvv(7) called vvv\-apache(7) as the VM), and generate/manage an unlimited number of development projects\. It also helps you manage dependencies and build tools, and can even handle your deployments\.
14
14
  .
15
15
  .SH "GLOBAL OPTIONS"
16
16
  .
17
17
  .TP
18
18
  \fB\-\-vm\-box\fR=\fIrepository\fR
19
- Force Vagrant box for use as VM
19
+ Force vagrant(1) box for use as VM
20
20
  .
21
21
  .TP
22
22
  \fB\-\-vm\-path\fR=\fIpath\fR
@@ -32,7 +32,7 @@ Force directory prefix for project in VM
32
32
  .
33
33
  .TP
34
34
  \fB\-\-yolo\fR
35
- Say yes to anything and everything
35
+ Say yes to anything and everything, and maybe even get a few surprises
36
36
  .
37
37
  .TP
38
38
  \fB\-\-boring\fR
@@ -52,7 +52,7 @@ Prints all output without animations
52
52
  .
53
53
  .TP
54
54
  \fB\-\-no\-landrush\fR
55
- Disable the \fBlandrush\fR gem for managing DNS
55
+ Disable the landrush(1) gem for managing DNS
56
56
  .
57
57
  .TP
58
58
  \fB\-\-no\-port\-forward\fR, \fB\-\-no\-port\-forwarding\fR
@@ -68,25 +68,25 @@ Run a command without actually doing anything
68
68
  .
69
69
  .TP
70
70
  \fB\-\-nginx\fR, \fB\-\-no\-apache\fR
71
- Create conf files for nginx instead of apache
71
+ Create \fBconf\fR files for nginx(7) instead of apache(7)
72
72
  .
73
73
  .SH "PRIMARY COMMANDS"
74
74
  Run \fBtj help\fR [\fIcommand\fR] to view an individual command\'s man page\.
75
75
  .
76
76
  .TP
77
- \fBcreate\fR, \fBnew\fR, \fBmk\fR
77
+ create(1), \fBnew\fR, \fBmk\fR
78
78
  Create a new project
79
79
  .
80
80
  .TP
81
- \fBsetup\fR, \fBup\fR, \fBinit\fR
81
+ setup(1), \fBup\fR, \fBinit\fR
82
82
  Setup an existing project
83
83
  .
84
84
  .TP
85
- \fBdelete\fR, \fBrm\fR, \fBremove\fR, \fBtrash\fR
85
+ delete(1), \fBrm\fR, \fBremove\fR, \fBtrash\fR
86
86
  Delete a project
87
87
  .
88
88
  .TP
89
- \fBdeploy\fR, \fBserver\fR, \fBremote\fR
89
+ deploy(1), \fBserver\fR, \fBremote\fR
90
90
  Deploy a project
91
91
  .
92
92
  .SH "SECONDARY COMMANDS"
@@ -101,7 +101,7 @@ List all projects
101
101
  .
102
102
  .TP
103
103
  \fBvm\fR, \fBvagrant\fR, \fBvvv\fR=[\fIcommand\fR[,\fIcommand\fR]\.\.\.]
104
- Manage development environment via \fBvagrant\fR\. Commands are proxied to your Vagrant installation so that they can be run from any directory\.
104
+ Manage development environment via vagrant(1)\. Commands are proxied to your Vagrant installation so that they can be run from any directory\.
105
105
  .
106
106
  .SH "CONFIG COMMANDS"
107
107
  These run the corresponding command from your project\'s config file\. They accept any number of arguments, since the behavior and handling of input is defined within the config file itself\.
@@ -128,7 +128,7 @@ Package project for distribution
128
128
  .
129
129
  .TP
130
130
  \fBwp\fR, \fBwordpress\fR=[\fIarg\fR[,\fIarg\fR]\.\.\.]
131
- Manage project\'s WordPress installation
131
+ Manage project\'s wordpress(7) installation with wp\-cli(1)
132
132
  .
133
133
  .TP
134
134
  \fBbackup\fR, \fBbk\fR=[\fIarg\fR[,\fIarg\fR]\.\.\.]
@@ -139,7 +139,7 @@ Backup project
139
139
  Manage and run project tests
140
140
  .
141
141
  .SH "CONFIG FILE"
142
- A YAML configuration file (\fBJuicefile\fR) can be used to store commonly\-used build scripts\. Each command block sequence can be mapped to an individual project\'s build tool, allowing a streamlined set of commands to be used across multiple projects that utilize different tools\.
142
+ A YAML Juicefile(5) configuration can be used to store commonly\-used build scripts\. Each command block sequence can be mapped to an individual project\'s build tool, allowing a streamlined set of commands to be used across multiple projects that utilize different tools\.
143
143
  .
144
144
  .TP
145
145
  \fBcommands\fR
@@ -177,10 +177,6 @@ Commands used to backup project
177
177
  \fBcommands\.test\fR
178
178
  Command used to manage and run project tests
179
179
  .
180
- .TP
181
- \fBdeployment\fR
182
- Coming soon
183
- .
184
180
  .P
185
181
  Placeholder arguments can be used within any command block sequence to allow splat or indexed arguments to be passed to the corresponding command when executed\.
186
182
  .
@@ -196,14 +192,14 @@ Where \fBn\fR is the argument index e\.g\. \fBcmd %arg1% | cmd %arg2%\fR
196
192
  When naming your configuration file, use the recommended \fBJuicefile\fR, or \fB\.tj\.yaml\fR naming convention\. The raw filename regex matcher is below if you want to be a little different\.
197
193
  .
198
194
  .P
199
- \fB/^(((\e\.)?(tj)|((J|j)uicefile))(\.y(a)?ml)?$)/\fR
195
+ \fB/^(((\e\.)?(tj)|((J|j)uicefile))(\e\.y(a)?ml)?$)/\fR
200
196
  .
201
197
  .SH "ENVIRONMENT"
202
- All of the global options have a corresponding \fBENV\fR variable that can be set to permanently use the specified value each time \fBtj\fR is run\. This is useful if you\'re using an alternate Vagrant box, or if you need to disable certain features due to limited support e\.g\. on Windows\.
198
+ All of the global options have a corresponding \fBENV\fR variable that can be set to permanently use the specified value each time tj(1) is run\. This is useful if you\'re using an alternate vagrant(1) box, or if you need to disable certain features due to limited support e\.g\. on Windows\.
203
199
  .
204
200
  .TP
205
201
  \fBTJ_VM_BOX\fR=\fIrepository\fR
206
- Force Vagrant box for use as VM
202
+ Force vagrant(1) box for use as VM
207
203
  .
208
204
  .TP
209
205
  \fBTJ_PATH\fR=\fIpath\fR
@@ -219,7 +215,7 @@ Force directory prefix for project in VM
219
215
  .
220
216
  .TP
221
217
  \fBTJ_YOLO\fR=\fIbool\fR
222
- Say yes to anything and everything
218
+ Say yes to anything and everything, and maybe even get a few surprises
223
219
  .
224
220
  .TP
225
221
  \fBTJ_BORING\fR=\fIbool\fR
@@ -239,7 +235,7 @@ Prints all output without animations (coming soon)
239
235
  .
240
236
  .TP
241
237
  \fBTJ_NO_LANDRUSH\fR=\fIbool\fR
242
- Disable the \fBlandrush\fR gem for managing DNS
238
+ Disable the landrush(1) gem for managing DNS
243
239
  .
244
240
  .TP
245
241
  \fBTJ_NO_PORT_FORWARD\fR=\fIbool\fR
@@ -247,7 +243,7 @@ Disable automatic port forwarding
247
243
  .
248
244
  .TP
249
245
  \fBTJ_VERBOSE\fR=\fIbool\fR
250
- Prints out additional logging information
246
+ Prints out additional logging information and raises any exceptions caught during runtime
251
247
  .
252
248
  .TP
253
249
  \fBTJ_DRYRUN\fR=\fIbool\fR
@@ -255,5 +251,5 @@ Run a command without actually doing anything
255
251
  .
256
252
  .TP
257
253
  \fBTJ_NGINX\fR=\fIbool\fR
258
- Create conf files for nginx instead of apache
254
+ Create \fBconf\fR files for nginx(7) instead of apache(7)
259
255
 
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "TJ\-CREATE" "1" "June 2015" "" "Theme Juice Manual"
4
+ .TH "TJ\-CREATE" "1" "July 2015" "" "Theme Juice Manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBtj\-create\fR \- Create a new project
@@ -32,7 +32,7 @@ Development URL for the project
32
32
  .
33
33
  .TP
34
34
  \fB\-r\fR, \fB\-\-repository\fR=\fIrepository\fR
35
- Initialize a new Git remote repository
35
+ Initialize a new git(1) remote repository
36
36
  .
37
37
  .TP
38
38
  \fB\-i\fR, \fB\-\-import\-db\fR=\fIpath\fR
@@ -56,7 +56,7 @@ Skip all prompts and use default settings
56
56
  .
57
57
  .TP
58
58
  \fB\-\-no\-wp\fR
59
- Project is not a WordPress install
59
+ Project is not a wordpress(7) install
60
60
  .
61
61
  .TP
62
62
  \fB\-\-no\-db\fR
@@ -30,7 +30,7 @@ GLOBAL OPTIONS
30
30
  Development URL for the project
31
31
 
32
32
  -r, --repository=repository
33
- Initialize a new Git remote repository
33
+ Initialize a new git(1) remote repository
34
34
 
35
35
  -i, --import-db=path
36
36
  Import an existing database
@@ -48,7 +48,7 @@ GLOBAL OPTIONS
48
48
  Skip all prompts and use default settings
49
49
 
50
50
  --no-wp
51
- Project is not a WordPress install
51
+ Project is not a wordpress(7) install
52
52
 
53
53
  --no-db
54
54
  Project does not need a database
@@ -56,4 +56,4 @@ GLOBAL OPTIONS
56
56
 
57
57
 
58
58
 
59
- June 2015 TJ-CREATE(1)
59
+ July 2015 TJ-CREATE(1)
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "TJ\-DELETE" "1" "June 2015" "" "Theme Juice Manual"
4
+ .TH "TJ\-DELETE" "1" "July 2015" "" "Theme Juice Manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBtj\-delete\fR \- Delete a project
@@ -10,7 +10,7 @@
10
10
  \fBtj delete\fR [\-\-flag=\fIarg\fR] [\-\-flag]
11
11
  .
12
12
  .SH "DESCRIPTION"
13
- Remove a project from your development environment\. This will only remove files that were generated by \fBtj\fR i\.e\. the database setup, DNS setup, and the project\'s shared directories\.
13
+ Removes a project from your development environment\. This will only remove files that were generated by tj(1) i\.e\. the database setup, DNS setup, and the project\'s shared directories\.
14
14
  .
15
15
  .P
16
16
  It will not touch your local folders that were synced to the VM\.
@@ -9,8 +9,8 @@ SYNOPSIS
9
9
  tj delete [--flag=arg] [--flag]
10
10
 
11
11
  DESCRIPTION
12
- Remove a project from your development environment. This will only
13
- remove files that were generated by tj i.e. the database setup, DNS
12
+ Removes a project from your development environment. This will only
13
+ remove files that were generated by tj(1) i.e. the database setup, DNS
14
14
  setup, and the project's shared directories.
15
15
 
16
16
  It will not touch your local folders that were synced to the VM.
@@ -31,4 +31,4 @@ GLOBAL OPTIONS
31
31
 
32
32
 
33
33
 
34
- June 2015 TJ-DELETE(1)
34
+ July 2015 TJ-DELETE(1)
@@ -1,13 +1,185 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "TJ\-DEPLOY" "1" "June 2015" "" "Theme Juice Manual"
4
+ .TH "TJ\-DEPLOY" "1" "July 2015" "" "Theme Juice Manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBtj\-deploy\fR \- Deploy a project
8
8
  .
9
9
  .SH "SYNOPSIS"
10
- \fBtj deploy\fR [\-\-flag=\fIarg\fR] [\-\-flag]
10
+ \fBtj deploy\fR \fIstage\fR [\fIcommand\fR] [\-\-flag=\fIarg\fR] [\-\-flag]
11
11
  .
12
12
  .SH "DESCRIPTION"
13
- Coming soon
13
+ Deploys a project to the passed \fBstage\fR\. All commands are transformed and then piped directly to capistrano(1) to handle deployment\.
14
+ .
15
+ .SH "SETUP"
16
+ Follow these steps to quickly get up and running:
17
+ .
18
+ .IP "1." 4
19
+ Create a \fBdeploy\fR user on the \fBstage\fR server
20
+ .
21
+ .IP "2." 4
22
+ Create SSH keys for the new \fBdeploy\fR user
23
+ .
24
+ .IP "3." 4
25
+ Create a deployment key for the \fBstage\fR server to clone your repository
26
+ .
27
+ .IP "4." 4
28
+ Confirm the \fBdeploy\fR user owns the deploy path
29
+ .
30
+ .IP "5." 4
31
+ Run \fBtj deploy <stage> setup\fR to setup the initial shared and releases directories
32
+ .
33
+ .IP "6." 4
34
+ Deploy!
35
+ .
36
+ .IP "" 0
37
+ .
38
+ .SH "PRIMARY COMMANDS"
39
+ If no command is passed, the default task to be executed is \fBdeploy\fR
40
+ .
41
+ .TP
42
+ \fBdeploy\fR
43
+ Deploy a project
44
+ .
45
+ .TP
46
+ \fBrollback\fR
47
+ Rollback a previous deployment
48
+ .
49
+ .TP
50
+ \fBsetup\fR, \fBcheck\fR
51
+ Run a preliminary deployment check, making sure that all necessary folders are created and accessible on the passed \fBstage\fR
52
+ .
53
+ .SH "SECONDARY COMMANDS"
54
+ .
55
+ .TP
56
+ \fBdb:backup\fR
57
+ Back up the database on the passed \fBstage\fR and store it locally in the \fBdeployment\.stages\.vagrant\.backup\fR directory
58
+ .
59
+ .TP
60
+ \fBdb:pull\fR
61
+ Pull the database from the passed \fBstage\fR and import it into the development environment
62
+ .
63
+ .TP
64
+ \fBdb:push\fR
65
+ Push the database from the development environment and import it into the passed \fBstage\fR
66
+ .
67
+ .TP
68
+ \fBenv:pull\fR
69
+ Pull the current \fB\.env\.<stage>\fR file from the passed \fBstage\fR to the development environment
70
+ .
71
+ .TP
72
+ \fBenv:push\fR
73
+ Push the current \fB\.env\.<stage>\fR file from the development environment to the passed \fBstage\fR
74
+ .
75
+ .TP
76
+ \fBuploads:pull\fR
77
+ Pull the current \fBstage\fR\'s uploads folder from the passed \fBstage\fR to the development environment
78
+ .
79
+ .TP
80
+ \fBuploads:push\fR
81
+ Push the uploads folder from the development environment to the passed \fBstage\fR\'s uploads folder
82
+ .
83
+ .SH "CONFIG FILE"
84
+ The YAML Juicefile(5) configuration may be used to store deployment\-related settings\. Below you will find the various block sequences you may use to define your project\'s deployment settings\. All of these will be passed to capistrano(1) to invoke a deployment\.
85
+ .
86
+ .TP
87
+ \fBdeployment\fR
88
+ Deployment configuration
89
+ .
90
+ .TP
91
+ \fBdeployment\.application\fR
92
+ Application settings passed directly to capistrano(1)
93
+ .
94
+ .TP
95
+ \fBdeployment\.settings\fR
96
+ Deployment settings passed directly to capistrano(1)
97
+ .
98
+ .TP
99
+ \fBdeployment\.repository\fR
100
+ Repository settings passed directly to capistrano(1)
101
+ .
102
+ .TP
103
+ \fBdeployment\.rsync\fR
104
+ Optional settings passed to capistrano\-rsync(1); mapped as \fBrsync_<setting>\fR during the deployment initialization
105
+ .
106
+ .TP
107
+ \fBdeployment\.slack\fR
108
+ Optional settings passed to capistrano\-slackify(1); mapped as \fBslack_<setting>\fR during the deployment initialization
109
+ .
110
+ .TP
111
+ \fBdeployment\.stages\fR
112
+ Deployment stages
113
+ .
114
+ .TP
115
+ \fBdeployment\.stages\.<stage>\.server\fR
116
+ Domain or IP address of the server
117
+ .
118
+ .TP
119
+ \fBdeployment\.stages\.<stage>\.path\fR
120
+ Root path to the deployment directory
121
+ .
122
+ .TP
123
+ \fBdeployment\.stages\.<stage>\.user\fR
124
+ User account to deploy as (it is recommended \fInot\fR to use \fBroot\fR)
125
+ .
126
+ .TP
127
+ \fBdeployment\.stages\.<stage>\.url\fR
128
+ URL of the stage
129
+ .
130
+ .TP
131
+ \fBdeployment\.stages\.<stage>\.uploads\fR
132
+ Relative path from deploy path to the uploads folder
133
+ .
134
+ .TP
135
+ \fBdeployment\.stages\.<stage>\.tmp\fR
136
+ Relative path from deploy path to the tmp folder
137
+ .
138
+ .TP
139
+ \fBdeployment\.stages\.<stage>\.shared\fR
140
+ Sequence of relative files from application root to place inside of the shared folder
141
+ .
142
+ .TP
143
+ \fBdeployment\.stages\.<stage>\.roles\fR
144
+ Sequence of deployment roles for the stage
145
+ .
146
+ .TP
147
+ \fBdeployment\.stages\.vagrant\fR
148
+ Required development environment settings; these are used for database and file migration
149
+ .
150
+ .TP
151
+ \fBdeployment\.stages\.vagrant\.server\fR
152
+ Domain or IP address of the development environment
153
+ .
154
+ .TP
155
+ \fBdeployment\.stages\.vagrant\.path\fR
156
+ Root path to the application directory within the VM
157
+ .
158
+ .TP
159
+ \fBdeployment\.stages\.vagrant\.user\fR
160
+ User account to deploy as (usually \fBvagrant\fR)
161
+ .
162
+ .TP
163
+ \fBdeployment\.stages\.vagrant\.pass\fR
164
+ Password for the user (usually \fBvagrant\fR)
165
+ .
166
+ .TP
167
+ \fBdeployment\.stages\.vagrant\.url\fR
168
+ URL of the project
169
+ .
170
+ .TP
171
+ \fBdeployment\.stages\.vagrant\.uploads\fR
172
+ Relative path from application root to the uploads folder
173
+ .
174
+ .TP
175
+ \fBdeployment\.stages\.vagrant\.backup\fR
176
+ Relative path from application root to the backup folder
177
+ .
178
+ .TP
179
+ \fBdeployment\.stages\.vagrant\.tmp\fR
180
+ Relative path from application root to the tmp folder
181
+ .
182
+ .TP
183
+ \fBdeployment\.stages\.vagrant\.roles\fR
184
+ Sequence of roles for the development environment
185
+