This repository was archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathazure-pipelines.yml
78 lines (63 loc) · 2.16 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
pool:
name: Hosted Ubuntu 1604
variables:
python.version: '3.7'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python $(python.version)'
inputs:
versionSpec: '$(python.version)'
- pwsh: |
$s = (Get-Content configs/.databricks-connect).replace('<Token>',"$(DatabricksToken)").replace('<ClusterId>',"$(ClusterId)").replace('<OrgId>',"$(DatabricksOrgId)").replace('<location>',"$(Location)")
$s | Set-Content configs/.databricks-connect
Copy-Item "configs/int.config.json" -Destination "configs/config.json"
displayName: 'Configure Environment'
- task: CopyFiles@2
displayName: 'Copy Files to: /home/vsts/'
inputs:
SourceFolder: configs
Contents: |
.databricks-connect
TargetFolder: /home/vsts/
OverWrite: true
- script: |
python -m pip install pypandoc==1.5
displayName: 'Install pypandoc'
- script: |
python -m pip install --upgrade pip && pip install -r requirements.txt
displayName: 'Install dependencies'
- script: 'pip install pytest && pytest tests --doctest-modules --junitxml=junit/test-results.xml'
displayName: pytest
continueOnError: true
- task: PublishTestResults@2
displayName: 'Publish Test Results **/test-results.xml'
inputs:
testResultsFiles: '**/test-results.xml'
failTaskOnFailedTests: true
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()
- pwsh: |
Write-Output "Setting Build Number 0.0.$(Build.BuildID)"
$s = (Get-Content "./pipelines/__init__.py").replace("0.0.1","0.0.$(Build.BuildID)")
$s | Set-Content "./pipelines/__init__.py"
$s = (Get-Content "./setup.py").replace("0.0.1","0.0.$(Build.BuildID)")
$s | Set-Content "./setup.py"
displayName: 'Set Build Number in files'
- script: |
python setup.py bdist_wheel
displayName: 'Build Wheel'
- task: PowerShell@2
displayName: 'Run Build.ps1'
inputs:
targetType: filePath
filePath: ./Build.ps1
pwsh: true
- task: CopyFiles@2
displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
inputs:
Contents: |
bin/**
Deploy.ps1
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'