forked from Azure-Samples/modern-data-warehouse-dataops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspark-python-pipelines.yml
70 lines (60 loc) · 1.71 KB
/
spark-python-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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
variables:
- group: Databricks-dev-environment
- group: Databricks-stg-environment
- group: Databricks-prod-environment
- name: jobPath
value: 'spark_python_jobs/main.py'
- name: jobTestPath
value: 'spark_python_jobs/tests/integration/main_test.py'
- name: jobName
value: 'spark_app_python_job'
- name: jobTestName
value: 'spark_app_python_job_integration_test'
trigger:
batch: true
branches:
include:
- '*'
tags:
include:
- v*.*
- prod
paths:
include:
- spark_python_jobs/**
stages:
- stage: test_at_stg
displayName: 'Test at Staging'
condition: |
or(
startsWith(variables['Build.SourceBranch'], 'refs/heads/staging'),
startsWith(variables['Build.SourceBranch'], 'refs/heads/production')
)
jobs:
- template: ./template/test-lib-job.yml
parameters:
environmentName: 'STG'
- template: ./template/test-spark-python-job.yml
parameters:
environmentName: 'STG'
databricksDomain: '$(databricksDomain_stg)'
databricksClusterId: '$(databricksClusterId_stg)'
databricksToken: '$(databricksToken_stg)'
databricksJobName: '$(jobTestName)'
databricksArtifactsPath: '$(jobTestPath)'
- stage: deploy_to_prod
displayName: 'Deploy to Prod'
condition: |
and(
startsWith(variables['Build.SourceBranch'], 'refs/heads/production'),
succeeded('test_at_stg')
)
jobs:
- template: ./template/deploy-spark-python-job.yml
parameters:
environmentName: 'PROD'
databricksDomain: '$(databricksDomain_prod)'
databricksClusterId: '$(databricksClusterId_prod)'
databricksToken: '$(databricksToken_prod)'
databricksJobName: '$(jobName)'
databricksArtifactsPath: '$(jobPath)'