forked from compassinformatics/cpsi-mapview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
101 lines (79 loc) · 3.47 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Pipeline to build and minify the project
# Useful links
# https://adamtheautomator.com/azure-devops-pipelines-powershell/
# https://aka.ms/yaml
trigger:
- master
pool:
vmImage: 'windows-2019'
# inbuilt variables at https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml
variables:
SENCHA_EXT_VERSION: '6.2.0'
SENCHA_CMD_VERSION: '6.5.2'
# first get the ExtJS framework and unzip it, unless this has already been cached
steps:
- task: CacheBeta@1
inputs:
key: ext
path: $(System.DefaultWorkingDirectory)/ext
cacheHitVar: CACHE_RESTORED
displayName: 'Get Cached ExtJS Framework'
- powershell: Invoke-WebRequest -Uri "http://cdn.sencha.com/ext/gpl/ext-$($env:SENCHA_EXT_VERSION)-gpl.zip" -OutFile "ExtJS.zip"
condition: ne(variables.CACHE_RESTORED, 'true')
displayName: 'Download ExtJS Framework'
- task: ExtractFiles@1
inputs:
archiveFilePatterns: '$(System.DefaultWorkingDirectory)/ExtJS.zip'
destinationFolder: '$(System.DefaultWorkingDirectory)'
# set following or it will delete the zip!
cleanDestinationFolder: false
condition: ne(variables.CACHE_RESTORED, 'true')
displayName: 'Unzip ExtJS Framework'
# rename the framework folder to ext
- powershell: Rename-Item -Path ext-$($env:SENCHA_EXT_VERSION) -newName ext
condition: ne(variables.CACHE_RESTORED, 'true')
displayName: 'Rename ExtJS Framework Folder'
# now let's download and install SenchaCmd
- task: CacheBeta@1
inputs:
key: sencha-cmd
path: $(System.DefaultWorkingDirectory)/sencha-cmd
cacheHitVar: CMD_CACHE_RESTORED
displayName: 'Get Cached SenchaCmd'
- powershell: Invoke-WebRequest -Uri "http://cdn.sencha.com/cmd/$($env:SENCHA_CMD_VERSION)/jre/SenchaCmd-$($env:SENCHA_CMD_VERSION)-windows-64bit.zip" -OutFile "SenchaCmd.zip"
condition: ne(variables.CMD_CACHE_RESTORED, 'true')
displayName: 'Download SenchaCmd'
- task: ExtractFiles@1
inputs:
archiveFilePatterns: "$(System.DefaultWorkingDirectory)/SenchaCmd.zip"
destinationFolder: $(System.DefaultWorkingDirectory)/sencha-cmd
condition: ne(variables.CMD_CACHE_RESTORED, 'true')
displayName: 'Unzip SenchaCmd'
- powershell: $senchaCmdExists = Test-Path -Path "$(System.DefaultWorkingDirectory)/sencha-cmd/sencha.exe"
displayName: 'Check if SenchaCmd is Installed'
# Run the SenchaCmd installer
# https://docs.sencha.com/cmd/guides/intro_to_cmd.html#intro_to_cmd_-_installing_sencha_cmd_silently
# https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/powershell?view=azure-devops
- powershell: ./SenchaCmd-6.5.2.15-windows-64bit.exe -q -dir "."
workingDirectory: $(System.DefaultWorkingDirectory)/sencha-cmd
displayName: 'Install SenchaCmd'
condition: ne(variables.senchaCmdExists, True)
# Now we can begin the production build process
- script: git submodule update --init --recursive
displayName: 'Update git Dependencies'
- script: |
npm install
displayName: 'Install NodeJS Dependencies'
- script: npm test
displayName: 'Run Tests'
- script: |
$(System.DefaultWorkingDirectory)/sencha-cmd/sencha which
$(System.DefaultWorkingDirectory)/sencha-cmd/sencha -info app build
displayName: 'Build Production'
# Now publish the build
# https://docs.microsoft.com/en-us/azure/devops/pipelines/artifacts/build-artifacts?view=azure-devops&tabs=yaml
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(System.DefaultWorkingDirectory)/build/production/CpsiMapview'
artifactName: CpsiMapview
displayName: 'Publish Output'