2014-12-09 17:55:17 -05:00
|
|
|
---
|
2015-07-22 22:31:00 -04:00
|
|
|
description: |
|
|
|
|
The `packer push` Packer command takes a template and pushes it to a build
|
|
|
|
service that will automatically build this Packer template.
|
|
|
|
layout: docs
|
|
|
|
page_title: 'Push - Command-Line'
|
|
|
|
...
|
2014-12-09 17:55:17 -05:00
|
|
|
|
2015-01-22 21:48:02 -05:00
|
|
|
# Command-Line: Push
|
2014-12-09 17:55:17 -05:00
|
|
|
|
2015-02-03 17:37:55 -05:00
|
|
|
The `packer push` Packer command takes a template and pushes it to a Packer
|
|
|
|
build service such as [HashiCorp's Atlas](https://atlas.hashicorp.com). The
|
|
|
|
build service will automatically build your Packer template and expose the
|
|
|
|
artifacts.
|
2014-12-09 17:55:17 -05:00
|
|
|
|
2015-02-03 17:37:55 -05:00
|
|
|
External build services such as HashiCorp's Atlas make it easy to iterate on
|
|
|
|
Packer templates, especially when the builder you are running may not be easily
|
2014-12-09 17:55:17 -05:00
|
|
|
accessable (such as developing `qemu` builders on Mac or Windows).
|
|
|
|
|
2015-07-22 22:31:00 -04:00
|
|
|
!> The Packer build service will receive the raw copy of your Packer template
|
2015-02-03 18:32:57 -05:00
|
|
|
when you push. **If you have sensitive data in your Packer template, you should
|
|
|
|
move that data into Packer variables or environment variables!**
|
|
|
|
|
2015-07-22 22:31:00 -04:00
|
|
|
For the `push` command to work, the [push
|
|
|
|
configuration](/docs/templates/push.html) must be completed within the template.
|
2014-12-09 17:55:17 -05:00
|
|
|
|
|
|
|
## Options
|
|
|
|
|
2015-07-22 22:31:00 -04:00
|
|
|
- `-message` - A message to identify the purpose or changes in this Packer
|
2015-02-03 18:34:05 -05:00
|
|
|
template much like a VCS commit message. This message will be passed to the
|
|
|
|
Packer build service. This option is also available as a short option `-m`.
|
|
|
|
|
2015-07-22 22:31:00 -04:00
|
|
|
- `-token` - An access token for authenticating the push to the Packer build
|
2015-02-03 17:37:55 -05:00
|
|
|
service such as Atlas. This can also be specified within the push
|
|
|
|
configuration in the template.
|
|
|
|
|
2015-07-22 22:31:00 -04:00
|
|
|
- `-name` - The name of the build in the service. This typically looks like
|
|
|
|
`hashicorp/precise64`.
|
2015-04-15 15:53:57 -04:00
|
|
|
|
2015-02-03 17:37:55 -05:00
|
|
|
## Examples
|
|
|
|
|
|
|
|
Push a Packer template:
|
|
|
|
|
2015-07-22 22:31:00 -04:00
|
|
|
``` {.shell}
|
2015-02-03 18:34:05 -05:00
|
|
|
$ packer push -m "Updating the apache version" template.json
|
2015-02-03 17:37:55 -05:00
|
|
|
```
|
|
|
|
|
|
|
|
Push a Packer template with a custom token:
|
2014-12-09 17:55:17 -05:00
|
|
|
|
2015-07-22 22:31:00 -04:00
|
|
|
``` {.shell}
|
2015-02-03 17:37:55 -05:00
|
|
|
$ packer push -token ABCD1234 template.json
|
|
|
|
```
|