-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathazure-pipelines.yml
129 lines (105 loc) · 4.04 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master # disable CI build for branch except master
# pr:
# - master # only kick off for pr targeting master
jobs:
- job: MyJob
displayName: My First Job
# workspace:
# clean: outputs
# cancelTimeoutInMinutes: 1
# timeoutInMinutes: 1 # check whether works w > 60?
strategy:
matrix:
linux:
imageName: 'ubuntu-16.04'
mac:
imageName: 'macos-10.13'
pool:
vmImage: $(imageName)
# vmImage: 'Ubuntu-16.04'
# BUG: `timeoutInMinutes` accepted under pool but has no effect
variables:
MY_VAR: my value
steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
fetchDepth: 1
# - template: azure-pipelines/linux/continuous-build-linux.yml
- script: echo Hello, world!
displayName: 'Run a one-line script'
- script: |
set -e
# brew install unbuffer
echo "ok"
# sudo apt-get update -qq
# sudo apt-get install -yqq coreutils expect
# which unbuffer
# which stdbuf
- script: |
set -e
echo "v1"
# https://stackoverflow.com/questions/3465619/how-to-make-output-of-any-shell-command-unbuffered
# stdbuf -i0 -o0 -e0 python3 ci_setup.py # didn't work
# python3 ci_setup.py
# works! to resolve
# unbuffer python3 ci_setup.py
python3 -u ci_setup.py # works!
# # python3 ci_setup.py
filelog=/tmp/D20190120T011243.txt
filelog2=/tmp/D20190120T011243.2.txt
# # python3 ci_setup.py > $filelog 2>&1
# unbuffer python3 ci_setup.py > $filelog 2> $filelog2
# python3 ci_setup.py > $filelog 2> $filelog2
echo Add other tasks to build, test, and deploy your project.
echo See https://aka.ms/yaml
echo "ok1"
# echo "##vso[task.logissue type=error;sourcepath=consoleapp/main.cs;linenumber=1;columnnumber=1;code=100;]this is an error"
# echo "##vso[task.logissue type=warning;sourcepath=consoleapp/main.cs;linenumber=1;columnnumber=1;code=100;]this is an error2"
# echo "##vso[task.complete result=Succeeded;]DONE"
#echo ##vso[task.uploadfile]c:\additionalfile.log
# works (needs full path)
# cp README.md /tmp/D20190120T011243.md
#echo "##vso[task.uploadfile]/tmp/D20190120T011243.md"
# echo "##vso[task.uploadfile]$filelog"
# echo "##vso[task.uploadfile]$filelog2"
# git log | cat
# sleep 240
echo "ok2"
displayName: 'Run a multi-line script'
# enabled: false
# timeoutInMinutes: 1
## DEPLOY
# - steps:
# - powershell: .\build.ps1
# - task: CopyFiles@2
# inputs:
# contents: _buildOutput\**
# targetFolder: $(Build.ArtifactStagingDirectory)
# - task: PublishBuildArtifacts@1
# inputs:
# pathtoPublish: $(Build.ArtifactStagingDirectory)
# artifactName: MyBuildOutputs
- script: |
mkdir /tmp/foo && ls > /tmp/foo/D20190120T070155.txt && ls /tmp/foo/
mkdir -p build/foo2
ls > build/foo2/D20190120T070155.txt
ls build/foo2
- task: CopyFiles@2
displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
inputs:
# CHECKME: Description : Copy files from source folder to target folder using match patterns (The match patterns will only match file paths, not folder paths
# contents: /tmp/foo/**
# contents: /tmp/foo/D20190120T070155.txt
# contents: /build/foo2.txt
contents: build/foo2/*
# contents: _buildOutput\**
# targetFolder: $(Build.ArtifactStagingDirectory)
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: MyBuildOutputs