aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/build_containers
blob: 4335d8ba275b32a564158383932ea8d5864316d8 (plain)
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
#!/usr/bin/env bash
set -e
set -o pipefail

# This is a sanity test script for the CODI and toolchain Docker images.
# This removes the old test containers, and builds a new codi and new toolchains.
# If you do not have the deps containers, it will build them but this takes awhile
#
# Example:
#
# ./tests/build_containers

TOPDIR=`git rev-parse --show-toplevel`

# remove codi test image as we will rebuild it
Q=`docker images  -q crops/codi:test`
if [ "$Q"  != "" ]; then
    echo "Removing codi image"
    docker rmi -f $Q
fi

Q=`docker images  -q crops/codi:testdebug`
if [ "$Q"  != "" ]; then
    echo "Removing codi debug image"
    docker rmi -f $Q
fi

# remove toolchain test image as we will rebuild it
Q=`docker images  -q crops/toolchain:test`
if [ "$Q"  != "" ]; then
    echo "Removing toolchain image"
    docker rmi -f   $Q
fi

# remove Zephyr toolchain image as we will rebuild it
Q=`docker images  -q crops/zephyr:test`
if [ "$Q"  != "" ]; then
    echo "Removing Zephyr toolchain image"
    docker rmi -f   $Q
fi

cd ${TOPDIR}/dockerfiles;

Q=`docker images  -q crops/codi:deps`
if [ "$Q"  == "" ]; then
    echo "Build CODI deps image"
    docker build -t crops/codi:deps -f Dockerfile.codi.deps --rm=true ..
fi


echo "Build CODI test image"
docker build -t crops/codi:test -f Dockerfile.codi --rm=true ..

echo "Build CODI debug test image"
docker build -t crops/codi:testdebug --build-arg build_type=debug -f Dockerfile.codi --rm=true ..

Q=`docker images  -q crops/toolchain:deps`
if [ "$Q"  == "" ]; then
    echo "Build toolchain deps image"
    docker build -t crops/toolchain:deps -f Dockerfile.toolchain.deps  --rm=true ..
fi

echo "Build toolchain test image"
docker build -t crops/toolchain:test -f Dockerfile.toolchain --rm=true ..

Q=`docker images  -q crops/zephyr:deps`
if [ "$Q"  == "" ]; then
    echo "Build Zephyr deps image"
    docker build -t crops/zephyr:deps -f Dockerfile.zephyr.deps  --rm=true ..
fi

echo "Build Zephyr toolchain image"
docker build -t crops/zephyr:test -f Dockerfile.zephyr --rm=true ..