-
Notifications
You must be signed in to change notification settings - Fork 126
/
Copy pathazure-pipelines.yml
43 lines (40 loc) · 1.77 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
name: Instrumented Tests
trigger:
- main
pool:
name: DockerBuildAgents
workspace:
clean: all
steps:
- checkout: self
submodules: true
- script: |
docker --version
echo =============================================
echo Kill all running containers if existing
echo =============================================
docker container kill $(docker ps -q)
echo =============================================
echo Run unit and instrumented inside docker container
echo =============================================
docker run --privileged --cpus="3" --memory="12g" -v "$PWD":/home/gradle/ -w /home/gradle/ authclient.azurecr.io/samples/dbi-instrumented-api30 sh scripts/run-instrumented-tests.sh
displayName: 'Build and test inside docker container'
- script: |
echo =============================================
echo Kill all running containers if existing
echo =============================================
docker container kill $(docker ps -q)
echo =============================================
echo Cleaning up build output that is owned by docker user rather than agent user
echo =============================================
docker run --privileged --cpus="3" --memory="12g" -v "$PWD":/home/gradle/ -w /home/gradle/ authclient.azurecr.io/samples/dbi-instrumented-api30 gradle clean
echo =============================================
echo prune containers to avoid running out of disk space - shutdown containers still exist on disk
echo =============================================
docker system prune -f
echo =============================================
echo Dump environment variables for build agent
echo =============================================
env
condition: always()
displayName: 'Cleanup'