theme-juice 0.18.0 → 0.18.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a9c7d01a73e2ae140f3f05911aee1a7a76dfa5c
4
- data.tar.gz: af2dacb3e141e0110605c157485c39a5118ef4b6
3
+ metadata.gz: e22a0c483f73ad97ac5b25c6311a68a2391870ed
4
+ data.tar.gz: b74a40235c95e76f08a1f1f9904c4f7ff132dffd
5
5
  SHA512:
6
- metadata.gz: d64ed7239b302e8e3f112497ce86729b1f5e9e20afd8fcaacf1232a1aacde34e5dfb3a4b9a55cb6017fff25c60d45713581d6314919346ecf4382dd579f3c78a
7
- data.tar.gz: 8d278f0288b1d2f69c2a9897b72e75f9431c6857e49d515fb37a301504eb921d4c378d1a3f9d28897c830630f5fd8d18a7462a3d0661dcd17472d7d7bb28f737
6
+ metadata.gz: 0a00f892ea9d159a557804b4bd1628f78981a117ae8399f9f8b6f885ff7222aedf652861ac434ed68c81044d2b753c64c207164d795bb49ce4d5a8131b3403ab
7
+ data.tar.gz: b091d400d0df5c44f2250835db91afea88ff794270505f9ef3569fc0d536789ebf12e87323a611f4091390048c09f8884863e6cbb5cd6bb91144e2e7e00be0e3
data/README.md CHANGED
@@ -1,304 +1,305 @@
1
- # Theme Juice CLI
2
- [![Gem Version](http://img.shields.io/gem/v/theme-juice.svg?style=flat-square)](https://rubygems.org/gems/theme-juice)
3
- [![Travis](https://img.shields.io/travis/ezekg/theme-juice-cli.svg?style=flat-square)](https://travis-ci.org/ezekg/theme-juice-cli)
4
- [![Code Climate](https://img.shields.io/codeclimate/github/ezekg/theme-juice-cli.svg?style=flat-square)](https://codeclimate.com/github/ezekg/theme-juice-cli)
5
- [![Code Climate](https://img.shields.io/codeclimate/coverage/github/ezekg/theme-juice-cli.svg?style=flat-square)](https://codeclimate.com/github/ezekg/theme-juice-cli)
6
- [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ezekg/theme-juice-cli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
7
-
8
- ![Theme Juice CLI](demo.gif)
9
-
10
- ***The master branch contains features currently in development, so don't expect it to work at all times. Grab the newest RubyGem instead of building directly from master. Until `1.0`, we'll most likely be adjusting things, and that means breaking changes. Before updating, be sure to check back here to make sure that nothing major has changed.***
11
-
12
- _All breaking changes will go up a minor version (`0.x.0`), while patches and backwards compatible changes will bump up the patch number (`0.0.x`). After `1.0`, we will follow [semantic versioning](http://semver.org/)_.
13
-
14
- _On that note, as of `0.12`, we have renamed all mentions of "theme" to "template" (to avoid confusion, since these are application templates, and not just WordPress themes), and we have also renamed the default directory where `tj` installs the virtual machine to `~/tj-vagrant` to avoid possible conflicts with existing Vagrant installations._
15
-
16
- ## What is it?
17
- [Theme Juice CLI](http://themejuice.it) (`tj`) is a command line utility that allows you to generate, manage and deploy new local WordPress development applications in seconds using Vagrant, utilizing an Apache fork of [VVV](https://github.com/Varying-Vagrant-Vagrants/VVV) called [VVV-Apache](https://github.com/ezekg/theme-juice-vvv) as the virtual machine.
18
-
19
- Check out [our getting started guide over at SitePoint](http://www.sitepoint.com/introducing-theme-juice-for-local-wordpress-development/), or [view the documentation site](http://themejuice.it).
20
-
21
- ## Requirements
22
- **`tj` requires [Vagrant](https://www.vagrantup.com/) and [VirtualBox](https://www.virtualbox.org/) to be able to create virtual machines for local development. Please download and install both of these before getting started.**
23
-
24
- I recommend one of the latest versions of Ruby MRI (2.2, 2.1, 2.0). `tj` requires at least MRI 1.9.3. For the full report, check out the [Travis CI build status](https://travis-ci.org/ezekg/theme-juice-cli), where I test against an array of Ruby interpreters.
25
-
26
- I also recommend you set up [SSH-keys for GitHub](https://help.github.com/articles/generating-ssh-keys/). Internally, `tj` uses `git clone` with SSH URLs, [so things might break if you don't have your keys set up properly](#help-it-wont-let-me-git-clone-anything).
27
-
28
- ## Installation
29
- ```
30
- gem install theme-juice
31
- ```
32
-
33
- ## Getting Started
34
-
35
- _If you're going to be using [our starter template](https://github.com/ezekg/theme-juice-starter), then I recommend checking out [it's dependencies](https://github.com/ezekg/theme-juice-starter#development-dependencies) before running your first `create`. That way, the build step doesn't fail._
36
-
37
- ### Create a new project
38
- This will lead you through a series of prompts to set up required project information, such as name, location, template, database info, etc. Using the specified information, it will run the installation process and set up a local development environment, if one hasn't already been set up. It will sync your local project location with the project
39
- location within the VM, so you can run this from anywhere on your local system.
40
-
41
- ```
42
- tj create
43
- ```
44
-
45
- #### What happens on your first `create`?
46
- 1. `tj` will clone the selected VM into your `vm-path`
47
- 1. `tj` will clone the selected starter template
48
- 1. `tj` will run the starter template's Juicefile(1) `install` command
49
- 1. `tj` will create all of the necessary project files, such as:
50
- * `Customfile` containing DNS and synced folder settings
51
- * `init-custom.sql` containing database setup
52
- * `project.conf` containing server settings
53
- * `wp-cli.local.yml` containing VM paths
54
- 1. `tj` will provision the VM to put the new configuration into effect
55
-
56
- If you've never used `tj` before, then that last step might take awhile. After that's done, you should be able to access your new project at the specified url. It's that easy!
57
-
58
- ### Set up an existing project
59
- This sets up an existing local project within the development environment. You will go through a series of prompts to create the necessary files. This command is essentially an alias for `tj create --bare`.
60
-
61
- ```
62
- tj setup
63
- ```
64
-
65
- ### Remove a project
66
- This will remove a project from your development environment. You will go through a series of prompts to delete a project. This will only remove files that were generated by `tj` i.e. the database setup, DNS setup, and other project configuration files.
67
-
68
- It will not touch your local folders that were synced to the VM.
69
-
70
- ```
71
- tj delete
72
- ```
73
-
74
- ### Deploy a project
75
- This will deploy a project to the passed `<stage>` using [Capistrano](http://capistranorb.com/). Head over to the [docs](http://themejuice.it/deploy) to see all of the available commands. There's a quick getting started section there too for your first deployment!
76
-
77
- ```
78
- tj deploy <stage>
79
- ```
80
-
81
- ### Want more?
82
- Want to check out all of the various flags and features `tj` offers? Just ask `tj` for help, and you'll be greeted with a nice `man` page full of information about how to use just about everything.
83
-
84
- ```
85
- tj help
86
- ```
87
-
88
- Or, you can also check out [themejuice.it](http://themejuice.it) for a pretty website chock-full of the same documentation provided by `tj help`.
89
-
90
- ## FAQ
91
-
92
- 1. [Is Windows supported?](#is-windows-supported)
93
- 1. [Can I use the original VVV instead of VVV-Apache?](#can-i-use-the-original-vvv-instead-of-vvv-apache)
94
- 1. [So, does that mean I can use any Vagrant box?](#so-does-that-mean-i-can-use-any-vagrant-box)
95
- 1. [What is a `Customfile`?](#what-is-a-customfile)
96
- 1. [What is a `Juicefile`?](#what-is-a-juicefile)
97
- 1. [Does `tj` support subdomain multi-sites?](#does-tj-support-subdomain-multi-sites)
98
- 1. [Can I access a project from another device (i.e. mobile)?](#can-i-access-a-project-from-another-device-ie-mobile)
99
- 1. [Can I add my starter template, ________?](#can-i-add-my-starter-template-________)
100
- 1. [Can I integrate my deployments with Slack?](#can-i-integrate-my-deployments-with-slack)
101
- 1. [Troubleshooting](#troubleshooting)
102
-
103
- ### Is Windows supported?
104
- Yes! But, since Windows doesn't support UTF-8 characters inside of the terminal, and is picky about ASCII colors, you'll probably have to run `tj` with a couple flags.
105
-
106
- Something that has worked for me on one of my Windows machines is to run all commands through [git-scm](http://git-scm.com/downloads) with the `--boring --no-landrush` flags. This will disable all unicode characters and colors from being output, and will also disable [Landrush](https://github.com/phinze/landrush), which isn't fully supported on Windows.
107
-
108
- To set these globally via the `ENV`, set the following environment variables or run the commands below in your terminal:
109
-
110
- ```bash
111
- export TJ_BORING=true
112
- export TJ_NO_LANDRUSH=true
113
- ```
114
-
115
- In addition to that, `tj` uses the [OS gem](https://github.com/rdp/os) to sniff out your OS and it'll adjust a few things accordingly to make sure that nothing breaks.
116
-
117
- _I don't regularly develop on Windows, so if you encounter any bugs, please let me know through a **well-documented** issue and I'll try my best to get it resolved._
118
-
119
- ### Can I use the original VVV instead of VVV-Apache?
120
- Definitely. If you want to use `tj` with Nginx and the [original VVV](https://github.com/Varying-Vagrant-Vagrants/VVV), it's as simple as running `tj` with a few flags:
121
-
122
- ```bash
123
- tj new --vm-box git@github.com:Varying-Vagrant-Vagrants/VVV.git --nginx
124
- ```
125
-
126
- To use these permanently, set the appropriate `ENV` variables through your `.bashrc` or similar, i.e. `export TJ_VM_BOX=git@github.com:Varying-Vagrant-Vagrants/VVV.git` and `export TJ_NGINX=true`.
127
-
128
- _Note: Before running this, you might want to either choose a new `vm-path`, or destroy any existing VMs inside of your `~/tj-vagrant` directory. If `tj` detects that a VM already installed, it will skip installing the new box._
129
-
130
- ### So, does that mean I can use any Vagrant box?
131
- Yes and no; in order for `tj` to properly create a project, the Vagrant box needs to follow the same directory structure as VVV, and include a `Customfile`. Here is the required structure that `tj` needs in order to be able to create new projects:
132
-
133
- ```
134
- ├── config/
135
- | |
136
- | ├── {apache,nginx}-config/
137
- | | |
138
- | | ├── site-1.conf
139
- | | ├── site-2.conf
140
- | | ..
141
- | ├── database/
142
- | | |
143
- | | ├── init-custom.sql
144
- | | ..
145
- | ..
146
- ├── www/
147
- | |
148
- | ├── site-1/
149
- | | |
150
- | | ├── index.php
151
- | | ..
152
- | ├── site-2/
153
- | | |
154
- | | ├── index.php
155
- | | ..
156
- | ..
157
- ├── Customfile
158
- ...
159
- ```
160
-
161
- ### What is a `Customfile`?
162
- [It's a file that contains custom rules to add into the main `Vagrantfile`, without actually having to modify it](https://github.com/Varying-Vagrant-Vagrants/VVV/blob/develop/Vagrantfile#L208-L218). This allows us to easily modify the Vagrant box without causing merge conflicts if you were to update the VM source via `git pull`. Every file that `tj` modifies is _meant to be modified_, so at any time you may update your installation of VVV with a simple `git pull` without getting merge conflicts out the wazoo.
163
-
164
- ### What is a `Juicefile`?
165
- A YAML configuration file called `Juicefile` can be used to store commonly-used build scripts, similar to [npm scripts](https://docs.npmjs.com/misc/scripts). Each command block sequence can be mapped to an individual project's build script, allowing a streamlined set of commands to be used across multiple projects that utilize different tools. If you plan to deploy using `tj`, this file will also house your [deployment configuration](http://themejuice.it/deploy).
166
-
167
- Below is the config that comes baked into [our starter template](https://github.com/ezekg/theme-juice-starter):
168
-
169
- ```yml
170
- #
171
- # Manage command aliases for the current application
172
- #
173
- commands:
174
-
175
- # Run application install scripts
176
- install:
177
- - composer install
178
- - bundle install
179
- - npm install
180
- - bower install
181
- - grunt build
182
-
183
- # Manage build tools
184
- watch:
185
- - grunt %args%
186
-
187
- # Manage front-end dependencies
188
- assets:
189
- - bower %args%
190
-
191
- # Manage back-end dependencies
192
- vendor:
193
- - composer %args%
194
-
195
- # Manage WP installation
196
- wp:
197
- - wp ssh --host=vagrant %args%
198
-
199
- # Create a backup of the current database with a nice timestamp
200
- backup:
201
- - mkdir -p backup
202
- - wp ssh --host=vagrant db export backup/$(date +'%Y-%m-%d-%H-%M-%S').sql
203
-
204
- # Package up entire application into a gzipped tar file
205
- dist:
206
- - tar -zcvf dist.tar.gz .
207
- ```
208
-
209
- Each command sequence is run within a single execution, with all `%args%`/`%argN%` being replaced by the passed command. Here's a few example scenarios:
210
- ```bash
211
- # Will contain all arguments stitched together by a space
212
- cmd1 %args%
213
- # Will contain each argument mapped to its respective index
214
- cmd2 '%arg1% %arg2% %arg3%'
215
- # Will only map argument 4, while ignoring 1-3
216
- cmd3 "%arg4%"
217
- ```
218
-
219
- You can specify an unlimited number of commands with an unlimited number of arguments; however, you should be careful with how this is used. Don't go including `sudo rm -rf %arg1%` in a command, while passing `/` as an argument. Keep it simple. These are meant to make your life easier by helping you manage build tools, not to do fancy scripting.
220
-
221
- ### Does `tj` support subdomain multi-sites?
222
- If you're able to use [Landrush](https://github.com/phinze/landrush) for your DNS, then yes. All subdomains will resolve to their parent domain. Landrush comes pre-installed when you create your first project with `tj`. Having said that, unfortunately, if you're on Windows you'll probably have to manually add the subdomains due to Landrush not being fully supported. If you have the Windows chops, head over there and contribute to Landrush by squashing that bug. I'm sure he would appreciate it!
223
-
224
- ### Can I access a project from another device (i.e. mobile)?
225
- Yes! Every project created with `tj` will automatically be set up to support using [xip.io](http://xip.io/). If you're using OSX, then everything should work out of the box. If you're not using OSX, then you'll need to point port `80` on your host machine to `8080`; Vagrant cannot do this by default for security reasons.
226
-
227
- Once everything is good to go, you can access a project from another device on the same network by going to `<project-name>.<your-hosts-ip-address>.xip.io` e.g. `themejuice.192.168.1.1.xip.io`.
228
-
229
- _If you're familiar with forwarding host ports on operating systems other than OSX, check out [this file](https://github.com/ezekg/theme-juice-cli/blob/master/lib/theme-juice/tasks/forward_ports.rb#L34-L51) and make a pull request so that everybody else can benefit from your smarts._
230
-
231
- ### Can I add my starter template, ________?
232
- Yes! Just update the `TEMPLATES` constant inside [commands/create.rb](https://github.com/ezekg/theme-juice-cli/blob/master/lib/theme-juice/commands/create.rb#L7-L12) and make a pull request. I'll verify that the template includes a `Juicefile` (not required, but preferred to automate build steps), and that everything looks solid. Until then (or if your template is private), just run the command below to clone your template.
233
-
234
- ```
235
- tj create --template git@your.repo:link/goes-here.git
236
- ```
237
-
238
- ### Can I integrate my deployments with Slack?
239
- Yes, you can integrate deployment notifications with your teams Slack account by adding the following template to your `Juicefile`:
240
-
241
- ```yml
242
- deployment:
243
- # ...
244
-
245
- slack:
246
- url: https://hooks.slack.com/services/your-token
247
- username: Deploybot
248
- channel: "#devops"
249
- emoji: ":rocket:"
250
-
251
- # ...
252
- ```
253
-
254
- Check out [capistrano-slackify](https://github.com/onthebeach/capistrano-slackify) for more information.
255
-
256
- ## Troubleshooting
257
-
258
- 1. [Help! It won't let me `git clone` anything!](#help-it-wont-let-me-git-clone-anything)
259
- 1. [What the heck is an `invalid multibyte char (US-ASCII)`?!](#what-the-heck-is-an-invalid-multibyte-char-us-ascii)
260
- 1. [Why are my `.dev` domains resolving to `127.0.53.53`?!](#why-are-my-dev-domains-resolving-to-12705353)
261
-
262
- ### Help! It won't let me `git clone` anything!
263
- If you're hitting issues related to `git clone`, either cloning the VM or a starter template, then you most likely don't have [SSH-keys for GitHub set up correctly](https://help.github.com/articles/error-permission-denied-publickey/). Either go through that article and assure that you can use Git with the `git@github.com` protocol, or else you can manually run `tj` with the appropriate flags corresponding to the problem-repository, swapping out `git@github.com:` for `https://github.com/`. For example:
264
-
265
- ```
266
- tj create --template https://github.com/starter-template/repository.git --vm-box https://github.com/vm-box/repository.git
267
- ```
268
-
269
- The flag duo above replaces the URLs for the starter template and VM box repositories so that they use `https` instead of the `git` protocol.
270
-
271
- ### What the heck is an `invalid multibyte char (US-ASCII)`?!
272
- For one reason or another, your terminal probably doesn't support UTF-8, so it's throwing a fit. Use the `--no-unicode` flag to disable the unicode characters. If the problem still persists, try running it with the `--boring` flag. That should disable all unicode characters and coloring.
273
-
274
- ```
275
- tj create --no-unicode # Or: tj create --boring
276
- ```
277
-
278
- ### Why are my `.dev` domains resolving to `127.0.53.53`?!
279
- [Google has applied for control of the `.dev` TLD (top level domain)](https://gtldresult.icann.org/application-result/applicationstatus/applicationdetails/1339). To fix it, you'll need to periodically flush your local DNS cache (I'm honestly not entirely sure why). In the future, we'll probably switch to something like `.localhost`. Here are a few commands to flush your cache on OSX:
280
-
281
- ```bash
282
- # Yosemite:
283
- sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
284
-
285
- # Mountain Lion:
286
- sudo discoveryutil mdnsflushcache; sudo discoveryutil udnsflushcaches
287
- ```
288
-
289
- _Still having issues? [Yell at me!](https://github.com/ezekg/theme-juice-cli/issues)_
290
-
291
- ## Contributing
292
- 1. First, create a _well documented_ [issue](https://github.com/ezekg/theme-juice-cli/issues) for your proposed feature/bug fix
293
- 1. After getting approval for the new feature, [fork the repository](https://github.com/ezekg/theme-juice-cli/fork)
294
- 1. Create a new feature branch (`git checkout -b my-new-feature`)
295
- 1. Write tests before pushing your changes, then run Rspec (`rake`)
296
- 1. Commit your changes (`git commit -am 'add some feature'`)
297
- 1. Push to the new branch (`git push origin my-new-feature`)
298
- 1. Create a new Pull Request
299
-
300
- ## License
301
- Please see [LICENSE](https://github.com/ezekg/theme-juice-cli/blob/master/LICENSE) for licensing details.
302
-
303
- ## Author
304
- Ezekiel Gabrielse, [@ezekkkg](https://twitter.com/ezekkkg), [http://ezekielg.com](http://ezekielg.com)
1
+ # Theme Juice CLI
2
+ [![Gem Version](http://img.shields.io/gem/v/theme-juice.svg?style=flat-square)](https://rubygems.org/gems/theme-juice)
3
+ [![Travis](https://img.shields.io/travis/ezekg/theme-juice-cli.svg?style=flat-square)](https://travis-ci.org/ezekg/theme-juice-cli)
4
+ [![Code Climate](https://img.shields.io/codeclimate/github/ezekg/theme-juice-cli.svg?style=flat-square)](https://codeclimate.com/github/ezekg/theme-juice-cli)
5
+ [![Code Climate](https://img.shields.io/codeclimate/coverage/github/ezekg/theme-juice-cli.svg?style=flat-square)](https://codeclimate.com/github/ezekg/theme-juice-cli)
6
+ [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ezekg/theme-juice-cli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
7
+
8
+ ![Theme Juice CLI](demo.gif)
9
+
10
+ ## What is it?
11
+ [Theme Juice CLI](http://themejuice.it) (`tj`) is a command line utility that allows you to generate, manage and deploy new local WordPress development applications in seconds using Vagrant, utilizing an [Apache fork](https://github.com/ezekg/theme-juice-vvv) of [VVV](https://github.com/Varying-Vagrant-Vagrants/VVV) for the virtual machine.
12
+
13
+ Check out [our getting started guide over at SitePoint](http://www.sitepoint.com/introducing-theme-juice-for-local-wordpress-development/), or [view the documentation site](http://themejuice.it).
14
+
15
+ ## Requirements
16
+ **`tj` requires [Vagrant](https://www.vagrantup.com/) and [VirtualBox](https://www.virtualbox.org/) to be able to create virtual machines for local development. Please download and install both of these before getting started.**
17
+
18
+ I recommend one of the latest versions of Ruby MRI (2.2, 2.1, 2.0). `tj` requires at least MRI 1.9.3. For the full report, check out the [Travis CI build status](https://travis-ci.org/ezekg/theme-juice-cli), where I test against an array of Ruby interpreters.
19
+
20
+ I also recommend you set up [SSH-keys for GitHub](https://help.github.com/articles/generating-ssh-keys/). Internally, `tj` uses `git clone` with SSH URLs, [so things might break if you don't have your keys set up properly](#help-it-wont-let-me-git-clone-anything).
21
+
22
+ ## Installation
23
+ ```
24
+ gem install theme-juice
25
+ ```
26
+
27
+ ## Getting Started
28
+
29
+ _If you're going to be using [our starter template](https://github.com/ezekg/theme-juice-starter), then I recommend checking out [it's dependencies](https://github.com/ezekg/theme-juice-starter#development-dependencies) before running your first `create`. That way, the build step doesn't fail._
30
+
31
+ ### Initialize the VM
32
+ This will install and configure the virtual machine. This will clone the VM into the `vm-path`, install the required Vagrant plugins (such as [Landrush](https://github.com/phinze/landrush), unless disabled) and will also set up port forwarding if you're on OSX.
33
+
34
+ ```
35
+ tj init
36
+ ```
37
+
38
+ ### Create a new project
39
+ This will lead you through a series of prompts to set up required project information, such as name, location, template, database info, etc. Using the specified information, it will run the installation process and set up a local development environment, if one hasn't already been set up. It will sync your local project location with the project
40
+ location within the VM, so you can run this from anywhere on your local system.
41
+
42
+ ```
43
+ tj create
44
+ ```
45
+
46
+ #### What happens on your first `create`?
47
+ 1. `tj` will execute `tj init` if the VM is uninitialized
48
+ 1. `tj` will clone the selected starter template
49
+ 1. `tj` will run the starter template's Juicefile(1) `install` command
50
+ 1. `tj` will create all of the necessary project files, such as:
51
+ * `Customfile` containing DNS and synced folder settings
52
+ * `init-custom.sql` containing database setup
53
+ * `project.conf` containing server settings
54
+ * `wp-cli.local.yml` containing VM paths
55
+ 1. `tj` will provision the VM to put the new configuration into effect
56
+
57
+ If you've never used `tj` before, then that last step might take awhile. After that's done, you should be able to access your new project at the specified url. It's that easy!
58
+
59
+ ### Set up an existing project
60
+ This sets up an existing local project within the development environment. You will go through a series of prompts to create the necessary files. This command is essentially an alias for `tj create --bare`.
61
+
62
+ ```
63
+ tj setup
64
+ ```
65
+
66
+ ### Remove a project
67
+ This will remove a project from your development environment. You will go through a series of prompts to delete a project. This will only remove files that were generated by `tj` i.e. the database setup, DNS setup, and other project configuration files.
68
+
69
+ It will not touch your local folders that were synced to the VM.
70
+
71
+ ```
72
+ tj delete
73
+ ```
74
+
75
+ ### Deploy a project
76
+ This will deploy a project to the passed `<stage>` using [Capistrano](http://capistranorb.com/). Head over to the [docs](http://themejuice.it/deploy) to see all of the available commands. There's a quick getting started section there too for your first deployment!
77
+
78
+ ```
79
+ tj deploy <stage>
80
+ ```
81
+
82
+ ### Want more?
83
+ Want to check out all of the various flags and features `tj` offers? Just ask `tj` for help, and you'll be greeted with a nice `man` page full of information about how to use just about everything.
84
+
85
+ ```
86
+ tj help
87
+ ```
88
+
89
+ Or, you can also check out [themejuice.it](http://themejuice.it) for a pretty website chock-full of the same documentation provided by `tj help`.
90
+
91
+ ## FAQ
92
+
93
+ 1. [Is Windows supported?](#is-windows-supported)
94
+ 1. [Can I use the original VVV instead of VVV-Apache?](#can-i-use-the-original-vvv-instead-of-vvv-apache)
95
+ 1. [So, does that mean I can use any Vagrant box?](#so-does-that-mean-i-can-use-any-vagrant-box)
96
+ 1. [What is a `Customfile`?](#what-is-a-customfile)
97
+ 1. [What is a `Juicefile`?](#what-is-a-juicefile)
98
+ 1. [Does `tj` support subdomain multi-sites?](#does-tj-support-subdomain-multi-sites)
99
+ 1. [Can I access a project from another device (i.e. mobile)?](#can-i-access-a-project-from-another-device-ie-mobile)
100
+ 1. [Can I add my starter template, ________?](#can-i-add-my-starter-template-________)
101
+ 1. [Can I integrate my deployments with Slack?](#can-i-integrate-my-deployments-with-slack)
102
+ 1. [Troubleshooting](#troubleshooting)
103
+
104
+ ### Is Windows supported?
105
+ Yes! But, since Windows doesn't support UTF-8 characters inside of the terminal, and is picky about ASCII colors, you'll probably have to run `tj` with a couple flags.
106
+
107
+ Something that has worked for me on one of my Windows machines is to run all commands through [git-scm](http://git-scm.com/downloads) with the `--boring --no-landrush` flags. This will disable all unicode characters and colors from being output, and will also disable [Landrush](https://github.com/phinze/landrush), which isn't fully supported on Windows.
108
+
109
+ To set these globally via the `ENV`, set the following environment variables or run the commands below in your terminal:
110
+
111
+ ```bash
112
+ export TJ_BORING=true
113
+ export TJ_NO_LANDRUSH=true
114
+ ```
115
+
116
+ In addition to that, `tj` uses the [OS gem](https://github.com/rdp/os) to sniff out your OS and it'll adjust a few things accordingly to make sure that nothing breaks.
117
+
118
+ _I don't regularly develop on Windows, so if you encounter any bugs, please let me know through a **well-documented** issue and I'll try my best to get it resolved._
119
+
120
+ ### Can I use the original VVV instead of VVV-Apache?
121
+ Definitely. If you want to use `tj` with Nginx and the [original VVV](https://github.com/Varying-Vagrant-Vagrants/VVV), it's as simple as running `tj` with a few flags:
122
+
123
+ ```bash
124
+ tj new --vm-box git@github.com:Varying-Vagrant-Vagrants/VVV.git --nginx
125
+ ```
126
+
127
+ To use these permanently, set the appropriate `ENV` variables through your `.bashrc` or similar, i.e. `export TJ_VM_BOX=git@github.com:Varying-Vagrant-Vagrants/VVV.git` and `export TJ_NGINX=true`.
128
+
129
+ _Note: Before running this, you might want to either choose a new `vm-path`, or destroy any existing VMs inside of your `~/tj-vagrant` directory. If `tj` detects that a VM already installed, it will skip installing the new box._
130
+
131
+ ### So, does that mean I can use any Vagrant box?
132
+ Yes and no; in order for `tj` to properly create a project, the Vagrant box needs to follow the same directory structure as VVV, and include a `Customfile`. Here is the required structure that `tj` needs in order to be able to create new projects:
133
+
134
+ ```
135
+ ├── config/
136
+ | |
137
+ | ├── {apache,nginx}-config/
138
+ | | |
139
+ | | ├── site-1.conf
140
+ | | ├── site-2.conf
141
+ | | ..
142
+ | ├── database/
143
+ | | |
144
+ | | ├── init-custom.sql
145
+ | | ..
146
+ | ..
147
+ ├── www/
148
+ | |
149
+ | ├── site-1/
150
+ | | |
151
+ | | ├── index.php
152
+ | | ..
153
+ | ├── site-2/
154
+ | | |
155
+ | | ├── index.php
156
+ | | ..
157
+ | ..
158
+ ├── Customfile
159
+ ...
160
+ ```
161
+
162
+ ### What is a `Customfile`?
163
+ [It's a file that contains custom rules to add into the main `Vagrantfile`, without actually having to modify it](https://github.com/Varying-Vagrant-Vagrants/VVV/blob/develop/Vagrantfile#L208-L218). This allows us to easily modify the Vagrant box without causing merge conflicts if you were to update the VM source via `git pull`. Every file that `tj` modifies is _meant to be modified_, so at any time you may update your installation of VVV with a simple `git pull` without getting merge conflicts out the wazoo.
164
+
165
+ ### What is a `Juicefile`?
166
+ A YAML configuration file called `Juicefile` can be used to store commonly-used build scripts, similar to [npm scripts](https://docs.npmjs.com/misc/scripts). Each command block sequence can be mapped to an individual project's build script, allowing a streamlined set of commands to be used across multiple projects that utilize different tools. If you plan to deploy using `tj`, this file will also house your [deployment configuration](http://themejuice.it/deploy).
167
+
168
+ Below is the config that comes baked into [our starter template](https://github.com/ezekg/theme-juice-starter):
169
+
170
+ ```yml
171
+ #
172
+ # Manage command aliases for the current application
173
+ #
174
+ commands:
175
+
176
+ # Run application install scripts
177
+ install:
178
+ - composer install
179
+ - bundle install
180
+ - npm install
181
+ - bower install
182
+ - grunt build
183
+
184
+ # Manage build tools
185
+ watch:
186
+ - grunt %args%
187
+
188
+ # Manage front-end dependencies
189
+ assets:
190
+ - bower %args%
191
+
192
+ # Manage back-end dependencies
193
+ vendor:
194
+ - composer %args%
195
+
196
+ # Manage WP installation
197
+ wp:
198
+ - wp ssh --host=vagrant %args%
199
+
200
+ # Create a backup of the current database with a nice timestamp
201
+ backup:
202
+ - mkdir -p backup
203
+ - wp ssh --host=vagrant db export backup/$(date +'%Y-%m-%d-%H-%M-%S').sql
204
+
205
+ # Package up entire application into a gzipped tar file
206
+ dist:
207
+ - tar -zcvf dist.tar.gz .
208
+ ```
209
+
210
+ Each command sequence is run within a single execution, with all `%args%`/`%argN%` being replaced by the passed command. Here's a few example scenarios:
211
+ ```bash
212
+ # Will contain all arguments stitched together by a space
213
+ cmd1 %args%
214
+ # Will contain each argument mapped to its respective index
215
+ cmd2 '%arg1% %arg2% %arg3%'
216
+ # Will only map argument 4, while ignoring 1-3
217
+ cmd3 "%arg4%"
218
+ ```
219
+
220
+ You can specify an unlimited number of commands with an unlimited number of arguments; however, you should be careful with how this is used. Don't go including `sudo rm -rf %arg1%` in a command, while passing `/` as an argument. Keep it simple. These are meant to make your life easier by helping you manage build tools, not to do fancy scripting.
221
+
222
+ ### Does `tj` support subdomain multi-sites?
223
+ If you're able to use [Landrush](https://github.com/phinze/landrush) for your DNS, then yes. All subdomains will resolve to their parent domain. Landrush comes pre-installed when you create your first project with `tj`. Having said that, unfortunately, if you're on Windows you'll probably have to manually add the subdomains due to Landrush not being fully supported. If you have the Windows chops, head over there and contribute to Landrush by squashing that bug. I'm sure he would appreciate it!
224
+
225
+ ### Can I access a project from another device (i.e. mobile)?
226
+ Yes! Every project created with `tj` will automatically be set up to support using [xip.io](http://xip.io/). If you're using OSX, then everything should work out of the box. If you're not using OSX, then you'll need to point port `80` on your host machine to `8080`; Vagrant cannot do this by default for security reasons.
227
+
228
+ Once everything is good to go, you can access a project from another device on the same network by going to `<project-name>.<your-hosts-ip-address>.xip.io` e.g. `themejuice.192.168.1.1.xip.io`.
229
+
230
+ _If you're familiar with forwarding host ports on operating systems other than OSX, check out [this file](https://github.com/ezekg/theme-juice-cli/blob/master/lib/theme-juice/tasks/forward_ports.rb#L34-L51) and make a pull request so that everybody else can benefit from your smarts._
231
+
232
+ ### Can I add my starter template, ________?
233
+ Yes! Just update the `TEMPLATES` constant inside [commands/create.rb](https://github.com/ezekg/theme-juice-cli/blob/master/lib/theme-juice/commands/create.rb#L7-L12) and make a pull request. I'll verify that the template includes a `Juicefile` (not required, but preferred to automate build steps), and that everything looks solid. Until then (or if your template is private), just run the command below to clone your template.
234
+
235
+ ```
236
+ tj create --template git@your.repo:link/goes-here.git
237
+ ```
238
+
239
+ ### Can I integrate my deployments with Slack?
240
+ Yes, you can integrate deployment notifications with your teams Slack account by adding the following template to your `Juicefile`:
241
+
242
+ ```yml
243
+ deployment:
244
+ # ...
245
+
246
+ slack:
247
+ url: https://hooks.slack.com/services/your-token
248
+ username: Deploybot
249
+ channel: "#devops"
250
+ emoji: ":rocket:"
251
+
252
+ # ...
253
+ ```
254
+
255
+ Check out [capistrano-slackify](https://github.com/onthebeach/capistrano-slackify) for more information.
256
+
257
+ ## Troubleshooting
258
+
259
+ 1. [Help! It won't let me `git clone` anything!](#help-it-wont-let-me-git-clone-anything)
260
+ 1. [What the heck is an `invalid multibyte char (US-ASCII)`?!](#what-the-heck-is-an-invalid-multibyte-char-us-ascii)
261
+ 1. [Why are my `.dev` domains resolving to `127.0.53.53`?!](#why-are-my-dev-domains-resolving-to-12705353)
262
+
263
+ ### Help! It won't let me `git clone` anything!
264
+ If you're hitting issues related to `git clone`, either cloning the VM or a starter template, then you most likely don't have [SSH-keys for GitHub set up correctly](https://help.github.com/articles/error-permission-denied-publickey/). Either go through that article and assure that you can use Git with the `git@github.com` protocol, or else you can manually run `tj` with the appropriate flags corresponding to the problem-repository, swapping out `git@github.com:` for `https://github.com/`. For example:
265
+
266
+ ```
267
+ tj create --template https://github.com/starter-template/repository.git --vm-box https://github.com/vm-box/repository.git
268
+ ```
269
+
270
+ The flag duo above replaces the URLs for the starter template and VM box repositories so that they use `https` instead of the `git` protocol.
271
+
272
+ ### What the heck is an `invalid multibyte char (US-ASCII)`?!
273
+ For one reason or another, your terminal probably doesn't support UTF-8, so it's throwing a fit. Use the `--no-unicode` flag to disable the unicode characters. If the problem still persists, try running it with the `--boring` flag. That should disable all unicode characters and coloring.
274
+
275
+ ```
276
+ tj create --no-unicode # Or: tj create --boring
277
+ ```
278
+
279
+ ### Why are my `.dev` domains resolving to `127.0.53.53`?!
280
+ [Google has applied for control of the `.dev` TLD (top level domain)](https://gtldresult.icann.org/application-result/applicationstatus/applicationdetails/1339). To fix it, you'll need to periodically flush your local DNS cache (I'm honestly not entirely sure why). In the future, we'll probably switch to something like `.localhost`. Here are a few commands to flush your cache on OSX:
281
+
282
+ ```bash
283
+ # Yosemite:
284
+ sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
285
+
286
+ # Mountain Lion:
287
+ sudo discoveryutil mdnsflushcache; sudo discoveryutil udnsflushcaches
288
+ ```
289
+
290
+ _Still having issues? [Yell at me!](https://github.com/ezekg/theme-juice-cli/issues)_
291
+
292
+ ## Contributing
293
+ 1. First, create a _well documented_ [issue](https://github.com/ezekg/theme-juice-cli/issues) for your proposed feature/bug fix
294
+ 1. After getting approval for the new feature, [fork the repository](https://github.com/ezekg/theme-juice-cli/fork)
295
+ 1. Create a new feature branch (`git checkout -b my-new-feature`)
296
+ 1. Write tests before pushing your changes, then run Rspec (`rake`)
297
+ 1. Commit your changes (`git commit -am 'add some feature'`)
298
+ 1. Push to the new branch (`git push origin my-new-feature`)
299
+ 1. Create a new Pull Request
300
+
301
+ ## License
302
+ Please see [LICENSE](https://github.com/ezekg/theme-juice-cli/blob/master/LICENSE) for licensing details.
303
+
304
+ ## Author
305
+ Ezekiel Gabrielse, [@ezekkkg](https://twitter.com/ezekkkg), [http://ezekielg.com](http://ezekielg.com)
@@ -12,16 +12,17 @@
12
12
  .SH "DESCRIPTION"
13
13
  Creates a new project\. It will lead you through a series of prompts to set up required project information, such as name, location, template, database info, etc\. Using the specified information, it will run the installation process below\.
14
14
  .
15
- .IP "1." 4
15
+ .IP "\(bu" 4
16
16
  \fBtj\fR will execute init(1) if the VM is uninitialized
17
17
  .
18
- .IP "2." 4
18
+ .IP "\(bu" 4
19
19
  \fBtj\fR will clone the selected starter template
20
20
  .
21
- .IP "3." 4
21
+ .IP "\(bu" 4
22
22
  \fBtj\fR will run the starter template\'s Juicefile(1) \fBinstall\fR command
23
23
  .
24
- .IP "4." 4
24
+ .IP "\(bu" 4
25
+ \fBtj\fR will create all of the necessary project files, such as:
25
26
  .
26
27
  .IP "\(bu" 4
27
28
  \fBCustomfile\fR containing DNS and synced folder settings
@@ -35,11 +36,8 @@ Creates a new project\. It will lead you through a series of prompts to set up r
35
36
  .IP "\(bu" 4
36
37
  \fBwp\-cli\.local\.yml\fR containing VM paths
37
38
  .
38
- .IP "" 0
39
-
40
- .
41
- .IP "5." 4
42
- \fBtj\fR will provision the VM to put the new configuration into effect
39
+ .IP "\(bu" 4
40
+ Finally, \fBtj\fR will provision the VM to put the new configuration into effect
43
41
  .
44
42
  .IP "" 0
45
43
  .
@@ -14,13 +14,13 @@ DESCRIPTION
14
14
  database info, etc. Using the specified information, it will run the
15
15
  installation process below.
16
16
 
17
- 1. tj will execute init(1) if the VM is uninitialized
17
+ o tj will execute init(1) if the VM is uninitialized
18
18
 
19
- 2. tj will clone the selected starter template
19
+ o tj will clone the selected starter template
20
20
 
21
- 3. tj will run the starter template's Juicefile(1) install command
21
+ o tj will run the starter template's Juicefile(1) install command
22
22
 
23
- 4.
23
+ o tj will create all of the necessary project files, such as:
24
24
 
25
25
  o Customfile containing DNS and synced folder settings
26
26
 
@@ -30,10 +30,8 @@ DESCRIPTION
30
30
 
31
31
  o wp-cli.local.yml containing VM paths
32
32
 
33
-
34
-
35
-
36
- 5. tj will provision the VM to put the new configuration into effect
33
+ o Finally, tj will provision the VM to put the new configuration into
34
+ effect
37
35
 
38
36
 
39
37
 
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module ThemeJuice
4
- VERSION = "0.18.0"
4
+ VERSION = "0.18.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: theme-juice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ezekiel Gabrielse