This repository has been archived by the owner on Aug 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
68 lines (68 loc) · 1.93 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
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
name: "New SAB-Database PR Pipeline"
pool: Default
trigger:
- master
pr:
- master
stages:
- stage: Test
jobs:
- job: Testing
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm install
npm run install:codeclimate
npm run install:k6
displayName: 'install dependencies'
- script: npm run lint
condition: always()
displayName: lint
- script: npm run spellcheck
condition: always()
displayName: spellcheck
- script: npm run codeclimate:analyze
condition: always()
displayName: 'Analyze Code Quality and Check Licenses'
# XXX: Currently runs a demo load test
# TODO: Start the server
# TODO: Run tests against api endpoints
- script: npm run test:load
condition: always()
displayName: 'Run Load Tests'
- script: npm run build
displayName: 'build'
- stage: Deploy
dependsOn: Test
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))
jobs:
- job: Publish_Artifact
steps:
- task: Docker@2
inputs:
containerRegistry: 'MTSContainers'
repository: 'SAB-Database'
command: 'buildAndPush'
Dockerfile: '**/Dockerfile'
Tags: |
$(Build.BuildId)
latest
- job: Deploy_Jenkins
dependsOn: Publish_Artifact
condition: Succeeded()
steps:
- task: JenkinsQueueJob@2
inputs:
serverEndpoint: 'MTSJenkins'
jobName: 'dts-sab-database-api'
captureConsole: true
capturePipeline: true
isParameterizedJob: true
jobParameters: 'azure_build_number=$(Build.BuildId)'