forked from Azure/azure-resource-manager-schemas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines-autogen.yml
49 lines (46 loc) · 1.28 KB
/
azure-pipelines-autogen.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
pr: none
trigger: none
schedules:
- cron: "0 8 * * *"
branches:
include:
- autogenerate
displayName: Daily autogeneration
pool:
vmImage: 'Ubuntu-16.04'
steps:
- checkout: self
persistCredentials: true
clean: true
- script: |
set -Eeuxo pipefail
git config user.name "Autogenerator Pipeline"
git config user.email "[email protected]"
git checkout $(Build.SourceBranchName)
git merge --no-commit --no-ff --strategy-option=theirs origin/master
if ! git diff-index --quiet HEAD --; then
git commit -m "Integrate master"
fi
git checkout origin/master -- schemas
displayName: Integrate master branch
- task: Npm@1
inputs:
command: 'install'
workingDir: 'generator'
displayName: 'Install packages'
- task: Npm@1
inputs:
command: 'custom'
workingDir: 'generator'
customCommand: 'run generate-all'
displayName: 'Generate schemas'
- script: |
set -Eeuxo pipefail
git config user.name "Autogenerator Pipeline"
git config user.email "[email protected]"
git add --all schemas
if ! git diff-index --quiet HEAD --; then
git commit -m "Autogenerate schemas"
git push origin $(Build.SourceBranchName)
fi
displayName: Commit and push changes