|
1 |
| -# Scope the validations to master and PRs to master |
| 1 | +# Scope the validations to main and PRs to main |
2 | 2 | trigger:
|
3 |
| - - master |
| 3 | + - main |
4 | 4 | pr:
|
5 |
| - - master |
| 5 | + - main |
6 | 6 |
|
7 |
| -# We have one single job with conditional steps for changes in master |
| 7 | +# We have one single job with conditional steps for changes in main |
8 | 8 | jobs:
|
9 |
| -- job: 'webhintio' |
10 |
| - pool: |
11 |
| - vmImage: 'Ubuntu 16.04' |
12 |
| - steps: |
13 |
| - - task: NodeTool@0 |
14 |
| - inputs: |
15 |
| - versionSpec: '10.x' |
16 |
| - displayName: 'Install Node.js' |
17 |
| - - script: npm install |
18 |
| - displayName: 'Install dependencies' |
19 |
| - - script: npm test |
20 |
| - displayName: 'Test' |
21 |
| - - script: ./helpers/update-site.sh |
22 |
| - displayName: 'Deploy' |
23 |
| - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) |
24 |
| - env: |
25 |
| - GIT_USER_EMAIL: $(GIT_USER_EMAIL) |
26 |
| - GIT_USER_NAME: $(GIT_USER_NAME) |
27 |
| - GIT_PASSWORD: $(GIT_PASSWORD) |
28 |
| - GIT_SCANNER_USER: $(GIT_SCANNER_USER) |
29 |
| - GIT_SCANNER_PASSWORD: $(GIT_SCANNER_PASSWORD) |
30 |
| - BRANCH: variables['Build.SourceBranch'] |
31 |
| - - script: npm run test-staging && node helpers/integration-tests/index.js |
32 |
| - displayName: 'Analyze staging with webhint' |
33 |
| - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) |
34 |
| - - task: AzureAppServiceManage@0 |
35 |
| - displayName: 'Swap into production' |
36 |
| - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) |
37 |
| - inputs: |
38 |
| - azureSubscription: 'webhint-web' |
39 |
| - Action: 'Swap Slots' |
40 |
| - WebAppName: 'sonarwhal' |
41 |
| - ResourceGroupName: 'webhint-web' |
42 |
| - SourceSlot: 'staging' |
43 |
| - - bash: | |
44 |
| - curl https://www.google.com/ping?sitemap=https://webhint.io/sitemap.xml |
45 |
| - curl https://www.bing.com/ping?sitemap=https://webhint.io/sitemap.xml |
46 |
| - displayName: 'Update sitemaps' |
47 |
| - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) |
| 9 | + - job: "webhintio" |
| 10 | + pool: |
| 11 | + vmImage: "Ubuntu 16.04" |
| 12 | + steps: |
| 13 | + - task: NodeTool@0 |
| 14 | + inputs: |
| 15 | + versionSpec: "10.x" |
| 16 | + displayName: "Install Node.js" |
| 17 | + - script: npm install |
| 18 | + displayName: "Install dependencies" |
| 19 | + - script: npm test |
| 20 | + displayName: "Test" |
| 21 | + - script: ./helpers/update-site.sh |
| 22 | + displayName: "Deploy" |
| 23 | + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) |
| 24 | + env: |
| 25 | + GIT_USER_EMAIL: $(GIT_USER_EMAIL) |
| 26 | + GIT_USER_NAME: $(GIT_USER_NAME) |
| 27 | + GIT_PASSWORD: $(GIT_PASSWORD) |
| 28 | + GIT_SCANNER_USER: $(GIT_SCANNER_USER) |
| 29 | + GIT_SCANNER_PASSWORD: $(GIT_SCANNER_PASSWORD) |
| 30 | + BRANCH: variables['Build.SourceBranch'] |
| 31 | + - script: npm run test-staging && node helpers/integration-tests/index.js |
| 32 | + displayName: "Analyze staging with webhint" |
| 33 | + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) |
| 34 | + - task: AzureAppServiceManage@0 |
| 35 | + displayName: "Swap into production" |
| 36 | + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) |
| 37 | + inputs: |
| 38 | + azureSubscription: "webhint-web" |
| 39 | + Action: "Swap Slots" |
| 40 | + WebAppName: "sonarwhal" |
| 41 | + ResourceGroupName: "webhint-web" |
| 42 | + SourceSlot: "staging" |
| 43 | + - bash: | |
| 44 | + curl https://www.google.com/ping?sitemap=https://webhint.io/sitemap.xml |
| 45 | + curl https://www.bing.com/ping?sitemap=https://webhint.io/sitemap.xml |
| 46 | + displayName: "Update sitemaps" |
| 47 | + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) |
48 | 48 |
|
49 |
| -- job: 'Algolia' |
50 |
| - pool: |
51 |
| - vmImage: 'Ubuntu 16.04' |
52 |
| - steps: |
53 |
| - - script: npm run ci-docsearch-scraper |
54 |
| - condition: eq(variables['Build.Reason'], 'Schedule') |
| 49 | + - job: "Algolia" |
| 50 | + pool: |
| 51 | + vmImage: "Ubuntu 16.04" |
| 52 | + steps: |
| 53 | + - script: npm run ci-docsearch-scraper |
| 54 | + condition: eq(variables['Build.Reason'], 'Schedule') |
0 commit comments