-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy pathazure-pipelines.yml
54 lines (52 loc) · 1.81 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
# Scope the validations to master and PRs to master
trigger:
- master
pr:
- master
# We have one single job with conditional steps for changes in master
jobs:
- job: 'webhintio'
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: npm install
displayName: 'Install dependencies'
- script: npm test
displayName: 'Test'
- script: ./helpers/update-site.sh
displayName: 'Deploy'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
env:
GIT_USER_EMAIL: $(GIT_USER_EMAIL)
GIT_USER_NAME: $(GIT_USER_NAME)
GIT_PASSWORD: $(GIT_PASSWORD)
GIT_SCANNER_USER: $(GIT_SCANNER_USER)
GIT_SCANNER_PASSWORD: $(GIT_SCANNER_PASSWORD)
BRANCH: variables['Build.SourceBranch']
- script: npm run test-staging && node helpers/integration-tests/index.js
displayName: 'Analyze staging with webhint'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- task: AzureAppServiceManage@0
displayName: 'Swap into production'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
azureSubscription: 'webhint-web'
Action: 'Swap Slots'
WebAppName: 'sonarwhal'
ResourceGroupName: 'webhint-web'
SourceSlot: 'staging'
- bash: |
curl https://www.google.com/ping?sitemap=https://webhint.io/sitemap.xml
curl https://www.bing.com/ping?sitemap=https://webhint.io/sitemap.xml
displayName: 'Update sitemaps'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- job: 'Algolia'
pool:
vmImage: 'Ubuntu 16.04'
steps:
- script: npm run ci-docsearch-scraper
condition: eq(variables['Build.Reason'], 'Schedule')