Once you have a working Wagon site, you probably want to see it working online, with the back-office and everything. That's the role of the Locomotive engine.
The only requirement is to have somewhere (it can be online or locally) a running engine and an account. Check out the engine installation guide for more information.
wagon deploy ENV [PATH]
ENV references the target platform in your config/deploy.yml file.
If the target doesn't exist, the deploy command will ask you for the information about the platform you want to deploy your site to. Then, it will create the site on the Locomotive engine and will update your config/deploy.yml accordingly.
You can have as many targets (test, …etc) as you want.
|-r one, [--resources=one two three]||Deploy the resource(s) passed in argument|
|-d, [--data], [--no-data]||Deploy the data associated with editable elements, e.g. sections, content entries, the editable elements and the translations (by default, they are not)|
|-f filename, [--filter=filename]||Filter the resource(s) to be deployed by their filename and extension. Must be used in conjunction with the '-r' option.|
|-e, [--env=ENV]||Deploy data previously synced from a remote LocomotiveCMS engine. Use |
|-v, [--verbose], [--no-verbose]||Show each resource being deployed. Display the full error stack trace if an error occurs.|
In some cases, you may not wish to deploy the entire site. For instance, if the site is already deployed and you have modified a number of snippets or a single page.
To deploy a particular resource, use the resource option (
-r) and specify one or more resource(s).
|site||Deploys metafields_schema.yml. May be used in conjunction with the data option (|
|pages||Deploys all pages.|
|snippets||Deploys all snippets.|
|content_types||Deploys all content_types.|
|content_entries||Deploys all content_entries. Must be used in conjunction with the data option (|
Additionally, some resources may be deployed invididually by using the filename option (
|pages||Deploys the specified page.|
|theme_assets||Deploys the specified asset.|
|content_entries||Deploys the content_entries of the specified content_type.|
Given the below /config/deploy.yml file,
The following command deploys the entire site (without data) to the staging platform.
wagon deploy staging
The following command deploys all pages to the live platform.
wagon deploy live -r pages -v
The following command deploys all content_types with content_entries to the live platform.
wagon deploy live -r content_types content_entries -d
The following command deploys the entire site (including data synced from the staging platform) to the live platform. The verbose option has been included to display the full error stack trace if it occurs.
wagon deploy live -d -e staging -v
👍 Thanks to greyskin for this cheatsheet:
bundle exec wagon deploy [env] –r [pages, theme_assets, site] –f [path/filename.extension] –v
bundle exec wagon deploy [env] –r [pages, sections, snippets, content_types, theme_assets, site] –v
- resource must be plural (even for single deployment)
- file must include extension
- no single option for content_types, sections, snippets
bundle exec wagon deploy [env] –r content_entries –f [content_type] -d –v
bundle exec wagon deploy [env] –r content_entries -d –v
bundle exec wagon delete [env] [page, section, snippet, content_type, site] [path/filename]
bundle exec wagon delete [env] [pages, sections, snippets, content_types, theme_assets, site]
- no extensions
- no file extensions
Updated 9 months ago