forked from HL7/fhir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vsts-ci.yml
40 lines (38 loc) · 1.21 KB
/
vsts-ci.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
queue:
name: Default
steps:
- bash: |
set -ev
[ -d publish ] && rm -rf publish
antBuild (){
ant -Dargs="./publish.sh -url http://build.fhir.org/ -nocheck"
checkStatus
}
checkStatus (){
nf=`find publish -maxdepth 1 -type f | wc -l`
if [ "$nf" -lt "100" ] ; then
echo "< 100 files produced: bailing!"
exit 1
fi
if [ $? -eq 0 -a ! -f fhir-error-dump.txt ]
then
echo "Build status OK"
else
echo "error dump:"
cat fhir-error-dump.txt
exit 1
fi
}
antBuild
- bash: |
TARGET_DIRECTORY=$(echo "${SYSTEM_PULLREQUEST_SOURCEBRANCH:=unknown-branch}" | sed -r 's/\//_/g')
echo "Will publish to '$TARGET_DIRECTORY' !"
echo $(DEPLOY_KEY_ENCRYPTED) | openssl enc -aes-256-cbc -d -pass pass:$(DEPLOY_KEY_PASSPHRASE) -base64 -A > ${BUILD_REPOSITORY_LOCALPATH}/deploy.rsa
chmod 400 ${BUILD_REPOSITORY_LOCALPATH}/deploy.rsa
if [ "$BUILD_SOURCEBRANCHNAME" != "master" ]; then
tar czf - * | ssh -i ${BUILD_REPOSITORY_LOCALPATH}/deploy.rsa -p 2222 build.fhir.org ./publish $TARGET_DIRECTORY
fi
rm ${BUILD_REPOSITORY_LOCALPATH}/deploy.rsa
echo "Published"
workingDirectory: publish
displayName: Publish