forked from alexott/dlt-files-in-repos-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-release.yml
35 lines (30 loc) · 1.06 KB
/
azure-pipelines-release.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
# Grab variables from the specific variable group
variables:
- group: 'DLT Files In Repos Testing'
- name: 'branchName'
${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}:
value: $[ replace(variables['Build.SourceBranch'], 'refs/heads/', '') ]
${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}:
value: $[ replace(variables['System.PullRequest.SourceBranch'], 'refs/heads/', '') ]
trigger: none
resources:
pipelines:
- pipeline: release
source: 'DLT Files In Repos Staging Test'
trigger:
stages:
- onRelease
pool:
vmImage: ubuntu-latest
steps:
- script: |
pip install databricks-cli
displayName: 'Install databricks-cli'
# https://docs.databricks.com/dev-tools/api/latest/repos.html.
- script: |
echo "Checking out the $(branchName) branch"
databricks repos update --path $(PRODUCTION_DIRECTORY) --branch "$(branchName)"
env:
DATABRICKS_HOST: $(DATABRICKS_HOST)
DATABRICKS_TOKEN: $(DATABRICKS_TOKEN)
displayName: 'Update Production repository'