From 89e12245af7f9c37fe2943836e3e347eaabb92b0 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 14 Jul 2013 17:38:31 +0900 Subject: [PATCH] website: document the fix command --- .../docs/command-line/fix.html.markdown | 33 +++++++++++++++++++ website/source/layouts/docs.erb | 1 + 2 files changed, 34 insertions(+) create mode 100644 website/source/docs/command-line/fix.html.markdown diff --git a/website/source/docs/command-line/fix.html.markdown b/website/source/docs/command-line/fix.html.markdown new file mode 100644 index 000000000..614777d4c --- /dev/null +++ b/website/source/docs/command-line/fix.html.markdown @@ -0,0 +1,33 @@ +--- +layout: "docs" +page_title: "Command-line: Fix" +--- + +# Command-Line: Fix + +The `packer fix` command takes a template and finds backwards incompatible +parts of it and brings it up to date so it can be used with the latest version +of Packer. After you update to a new Packer release, you should run the +fix command to make sure your templates work with the new release. + +The fix command will output the changed template to standard out, so you +should redirect standard using standard OS-specific techniques if you want to +save it to a file. For example, on Linux systems, you may want to do this: + +``` +$ packer fix old.json > new.json +``` + +If fixing fails for any reason, the fix command will exit with a non-zero +exit status. Error messages appear on standard error, so if you're redirecting +output, you'll still see error messages. + +
+Even when Packer fix doesn't do anything to the template, +the template will be outputted to standard out. Things such as configuration +key ordering and indentation may be changed. The output format however, is +pretty-printed for human readability. +
+ +The full list of fixes that the fix command performs is visible in the +help output, which can be seen via `packer fix -h`. diff --git a/website/source/layouts/docs.erb b/website/source/layouts/docs.erb index a6ed7f2cd..e5acb6b6b 100644 --- a/website/source/layouts/docs.erb +++ b/website/source/layouts/docs.erb @@ -11,6 +11,7 @@
  • Command-Line

  • Introduction
  • Build
  • +
  • Fix
  • Validate