From f5fea189b01cc9b8b4e164026a7056be4b2222a9 Mon Sep 17 00:00:00 2001 From: emicklei_kramphub Date: Mon, 27 Aug 2018 11:16:16 +0200 Subject: [PATCH] update doc about --migrations --- README.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 81a4fc9..818c127 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,12 @@ Prepares your setup for working with migrations by creating a `gmig.json` file i gmig init my-production-project -You must change the file `my-production-project/gmig.json` to set the Bucket name. +Then your filesystem will have: + + /my-production-project/ + gmig.json + +You must change the file `gmig.json` to set the Bucket name. { "project": "my-production-project", @@ -91,7 +96,7 @@ You must change the file `my-production-project/gmig.json` to set the Bucket nam } If you decide to store state files of different projects in one Bucket then set the state object name to reflect this, eg. `myproject-gmig-state`. -If you want to apply the same migrations to different regions/zones then choose a target folder name to reflect this, eg. `my-production-project-us-east`. Values for `region` and `zone` are required if you want to create Compute Engine resources. +If you want to apply the same migrations to different regions/zones then choose a target folder name to reflect this, eg. `my-production-project-us-east`. Values for `region` and `zone` are required if you want to create Compute Engine resources. The `env` map can be used to parameterize commands in your migrations. All commands will have access to the value of `$FOO`. ### new [title] @@ -99,13 +104,15 @@ Creates a new migration for you to describe a change to the current state of inf gmig new "add storage view role to cloudbuild account" -### status [path] +### status [path] [--migrations folder] List all migrations with an indicator (applied,pending) whether is has been applied or not. gmig status my-production-project/ + +Run this command in the directory where all migrations are stored. Use `--migrations` for a different location. -### up [path] [|migration file] +### up [path] [|migration file] [--migrations folder] Executes the `do` section of each pending migration compared to the last applied change to the infrastructure. If `migration file` is given then stop after applying that one. @@ -113,7 +120,7 @@ Upon each completed migration, the `gmig-last-migration` object is updated in th gmig up my-production-project -### down [path] +### down [path] [--migrations folder] Executes one `undo` section of the last applied change to the infrastructure. If completed then update the `gmig-last-migration` object.