-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
77 lines (61 loc) · 2.53 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
# 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
trigger:
- master
pool:
vmImage: 'Ubuntu-16.04'
steps:
- task: NodeTool@0
inputs:
versionSpec: '8.x'
displayName: 'Install Node.js'
- script: |
npm install
displayName: 'npm install'
- script: |
npm run build
displayName: 'npm run build'
- script: |
cd $(Build.StagingDirectory)
git clone https://devops:$(github-output-repo-access-token)@github.com/$(github-output-repo-user)/$(github-output-repo-name).git
displayName: 'Git clone output repo locally'
- script: |
cp -r $(System.DefaultWorkingDirectory)/build/. $(Build.StagingDirectory)/$(github-output-repo-name)
displayName: 'Copy build to local output repo'
- script: |
sed -i 's+"start": "node build/bot.js",+"start": "node bot.js"+g' $(Build.StagingDirectory)/$(github-output-repo-name)/package.json
displayName: 'Update start: in package.json'
- script: |
sed -i '/"build":/d' $(Build.StagingDirectory)/$(github-output-repo-name)/package.json
displayName: 'Remove build from package.json'
- script: |
sed -i '/"heroku-prebuild":/d' $(Build.StagingDirectory)/$(github-output-repo-name)/package.json
displayName: 'Remove heroku from package.json'
- script: |
sed -i '/"dev":/d' $(Build.StagingDirectory)/$(github-output-repo-name)/package.json
displayName: 'Remove dev from package.json'
- script: |
sed -i '/"babel-node":/d' $(Build.StagingDirectory)/$(github-output-repo-name)/package.json
displayName: 'Remove babel from package.json'
- script: |
rm -rf $(Build.StagingDirectory)/$(github-output-repo-name)/docs
displayName: 'Remove documentation folder'
- script: |
rm -rf $(Build.StagingDirectory)/$(github-output-repo-name)/node_modules
displayName: 'Remove node_modules folder'
- script: |
rm $(Build.StagingDirectory)/$(github-output-repo-name)/azure-pipelines.yml
rm $(Build.StagingDirectory)/$(github-output-repo-name)/readme.md
rm $(Build.StagingDirectory)/$(github-output-repo-name)/CODE_OF_CONDUCT.md
rm $(Build.StagingDirectory)/$(github-output-repo-name)/CONTRIBUTING.md
displayName: 'Remove files'
- script: |
cd $(Build.StagingDirectory)/$(github-output-repo-name)
git config user.name $(github-output-username)
git config user.email $(github-output-email)
git add .
git commit -a -m $(Build.BuildNumber)
git push
displayName: 'Git commit and push latest build'