-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
114 lines (93 loc) · 3.23 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
102
103
104
105
106
107
108
109
110
111
112
113
114
# Node.js with Angular
# Build a Node.js project that uses Angular.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
jobs:
- job: BuildAndTest
pool:
vmImage: 'Ubuntu 16.04'
condition: ne(variables['Build.SourceBranch'], 'refs/heads/gh-pages')
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.13'
displayName: 'Install Node.js'
- script: |
npm install -g @angular/[email protected]
npm install
displayName: 'npm install'
- script: |
ng lint
displayName: 'tslint'
- script: |
ng build --prod
displayName: 'build distribution'
- script: |
ng test --watch=false --browsers ChromeHeadless --code-coverage
displayName: 'execute tests'
- task: PublishTestResults@2
condition: always()
inputs:
testRunner: JUnit
testResultsFiles: ./test-results/junit.xml
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/*coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/coverage'
- job: Deploy
dependsOn: BuildAndTest
pool:
vmImage: 'Ubuntu 16.04'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.13'
displayName: 'Install Node.js'
- script: |
npm install -g @angular/[email protected]
npm install -g [email protected]
npm install
npm i [email protected] --save-dev
displayName: 'npm install'
- script: |
git remote set-url origin https://[email protected]/eQualityTime/ovfplayer.git
git config user.name "eQualityTimeDevs"
git config user.email "[email protected]"
git tag -a $BUILD_BUILDNUMBER -m "Release tagging"
git push --tags
displayName: 'Tag and release'
- script: |
node git_version.js
displayName: 'Git describe'
- script: |
ng build --prod --base-href "https://equalitytime.github.io/ovfplayer/"
workbox injectManifest
displayName: 'build with correct HREF'
- script: |
npx ngh --dir=dist/open-voice-factory --repo=https://[email protected]/eQualityTime/ovfplayer.git --name="eQualityTimeDevs" --email="[email protected]"
displayName: 'deploy to gh-pages'
- job: DeployStaging
dependsOn: BuildAndTest
pool:
vmImage: 'Ubuntu 16.04'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.13'
displayName: 'Install Node.js'
- script: |
npm install -g @angular/[email protected]
npm install -g [email protected]
npm install
npm i [email protected] --save-dev
displayName: 'npm install'
- script: |
ng build --base-href "https://equalitytime.github.io/teststaging/" --configuration=staging
workbox injectManifest
displayName: 'build with correct HREF'
- script: |
npx ngh --dir=dist/open-voice-factory --repo=https://[email protected]/eQualityTime/teststaging.git --name="eQualityTimeDevs" --email="[email protected]"
displayName: 'deploy to gh-pages'