Skip to content

Commit

Permalink
Restructure VM commands section
Browse files Browse the repository at this point in the history
  • Loading branch information
kadamwhite committed Jul 14, 2019
1 parent 09599b3 commit 9f1db9b
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ npm install
composer chassis init
```

You will now be able to load the site at [altis.local](http://altis.local), and [sign in](http://altis.local/admin) with the username `admin` and password `password`.

## Local Development

**Frontend development commands**
Expand All @@ -24,9 +26,19 @@ composer chassis init

**Virtual Machine commands**

- `npm run vagrant`: Run any vagrant command against the virtual machine. May only be used after initializing the local Chassis development environment.
- `npm run vagrant up`: Start the virtual machine.
- `npm run vagrant halt`: Stop the virtual machine.
- `npm run vagrant ssh`: SSH into the virtual machine.
- `npm run vagrant ssh -- -c "wp plugin list"`: SSH into the virtual machine and execute an arbitrary command (list plugins, in this example).
- **Note**: unlike the normal `vagrant ssh` command, note that using `npm run` requires us to put an additional `--` double-dash before we add the `-c` argument.
`npm run vagrant`

Run any vagrant command against the virtual machine (providing that the local Chassis development environment has been initialized). You may use this script to easily run most `vagrant` commands, wherever you are in the project. For example:

- `npm run vagrant up`: Start the virtual machine.
- `npm run vagrant halt`: Stop the virtual machine.
- `npm run vagrant ssh`: SSH into the virtual machine.

Note: Because of how `npm run` scripts work, you wish to pass _arguments_ to a vagrant command (for example `vagrant ssh -c "wp plugin list"`) then you will need to put an additional `--` double-dash between the npm script command and the command's arguments. Examples:

- `npm run vagrant ssh -- -c "wp plugin list"`
- List out installed plugins. Any WP-CLI command should work if invoked in this manner.
- `npm run vagrant ssh -- -c "mysqldump -uwordpress -pvagrantpassword wordpress > /chassis/database-backup.sql"`
- Dump the `wordpress` database within the VM to a file `database-backup.sql` in your project root.
- `npm run vagrant destroy -- -f`
- Destroy the virtual machine.

0 comments on commit 9f1db9b

Please sign in to comment.