-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmigrate_apply.yml
More file actions
53 lines (52 loc) · 1.82 KB
/
Copy pathmigrate_apply.yml
File metadata and controls
53 lines (52 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
description: >
This command apply migrations to a database.
parameters:
url:
type: string
default: ''
description: |
The URL of the target database. For example: `mysql://root:pass@localhost:3306/dev`.
dir:
type: string
default: ""
description: |
The URL of the migration directory to lint. For example: file://migrations.
Read more about [Atlas URLs](https://atlasgo.io/concepts/url)
config:
type: string
default: ''
description: |
The path to the Atlas configuration file. By default, Atlas will look for a file named `atlas.hcl` in the current directory.
For example, `file://config/atlas.hcl`. Learn more about [Atlas configuration files](https://atlasgo.io/atlas-schema/projects).
vars:
type: string
default: ''
description: |
Stringify JSON object containing variables to be used inside the Atlas configuration file. For example: '{"var1": "value1", "var2": "value2"}'
working_directory:
type: string
default: "."
description: |
The working directory to run from. Defaults to project root.
env:
type: string
default: ''
description: |
The environment to use from the Atlas configuration file. For example, `dev`.
dry_run:
type: boolean
default: false
description: |
Print SQL without executing it. Defaults to `false`
steps:
- run:
name: Apply migrations to a database
command: atlasaction --action migrate/apply
environment:
ATLAS_INPUT_WORKING_DIRECTORY: <<parameters.working_directory>>
ATLAS_INPUT_DIR: <<parameters.dir>>
ATLAS_INPUT_CONFIG: <<parameters.config>>
ATLAS_INPUT_ENV: <<parameters.env>>
ATLAS_INPUT_DRY_RUN: <<parameters.dry_run>>
ATLAS_INPUT_VARS: <<parameters.vars>>
ATLAS_INPUT_URL: <<parameters.url>>