-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathrun.sh
executable file
·40 lines (32 loc) · 1.01 KB
/
run.sh
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
#!/bin/bash
# Copyright 2016 tsuru authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
set -e
DOCKER=${DOCKER:-docker}
NO_REBUILD=$2
parent_path=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P )
cd "$parent_path"
if [ ! -z $1 ]; then
platforms=$1
else
platforms=$(ls -d */ | cut -f1 -d'/' | grep -v common)
fi
function run_test {
local plat=$1
echo "Testing $plat platform..."
sed "s/{PLATFORM}/$plat/g" Dockerfile.template > ./$plat/Dockerfile
cp -r common ./$plat/common
if [ -z ${NO_REBUILD} ]; then
${DOCKER} build --platform linux/amd64 -t platform-$plat ../$plat && ${DOCKER} build --progress plain -t tests-$plat --no-cache ./$plat
else
${DOCKER} build --platform linux/amd64 --progress plain -t tests-$plat --no-cache ./$plat
fi
rm ./$plat/Dockerfile && rm -rf ./$plat/common
}
for plat in $platforms; do
if [ ! -d "./${plat}" ]; then
continue
fi
run_test $plat
done