Skip to content

Commit

Permalink
update doc about --migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
emicklei_kramphub committed Aug 27, 2018
1 parent 2ed00ad commit f5fea18
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -91,29 +96,31 @@ 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]

Creates a new migration for you to describe a change to the current state of infrastructure.

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.
Upon each completed migration, the `gmig-last-migration` object is updated in the bucket.

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.
Expand Down

0 comments on commit f5fea18

Please sign in to comment.