-
Notifications
You must be signed in to change notification settings - Fork 40
/
azure-pipelines.yml
52 lines (47 loc) · 1.58 KB
/
azure-pipelines.yml
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
trigger: none
pr: none
variables:
- name: packageUrl
value: "https://github.com/erikbra/grate/releases/download/1.6.1/grate_1.6.1-1_amd64.deb"
- name: localFile
value: /tmp/grate_1.6.1-1_amd64.deb
- name: dbRoot
value: $(Build.SourcesDirectory)/examples/scripts/sqlite
jobs:
- job: dryrun
displayName: Dry run - see what will change
pool:
vmImage: ubuntu-latest
steps:
- pwsh: Invoke-WebRequest -Uri $(packageUrl) -OutFile $(localFile)
displayName: Download grate
- pwsh: sudo dpkg -i $(localFile)
displayName: Install grate
- pwsh: grate --help
displayName: Make sure grate is successfully installed
- pwsh: grate --silent --dryrun --databasetype sqlite --connectionstring "Data Source=devops-db.db" --files $(dbRoot)
displayName: Run migration in dryRun mode
- job: validate_migration
displayName: Wait for approval
dependsOn: dryrun
pool: server
timeoutInMinutes: 10
steps:
- task: ManualValidation@0
inputs:
notifyUsers:
instructions: 'Please verify that the grate dryrun migration looks OK'
- job: run_actual_migration
displayName: Run actual migration
dependsOn: validate_migration
pool:
vmImage: ubuntu-latest
steps:
- pwsh: Invoke-WebRequest -Uri $(packageUrl) -OutFile $(localFile)
displayName: Download grate
- pwsh: sudo dpkg -i $(localFile)
displayName: Install grate
- pwsh: grate --help
displayName: Make sure grate is successfully installed
- pwsh: grate --silent --databasetype sqlite --connectionstring "Data Source=devops-db.db" --files $(dbRoot)
displayName: Run migration for real