-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-setup-ci.bash
37 lines (28 loc) · 1.06 KB
/
docker-setup-ci.bash
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
#!/bin/bash
set -e
build_container()
{
echo "Building ROS-Docker container for ${DOCKER_DISTRO}..."
bash ${DOCKER_CI_REL_DIR}/docker-build.bash ${DOCKER_DISTRO}
}
if [[ -d ${DOCKER_CACHE_DIR} ]]; then
echo "Docker cache dir found."
if [[ -f ${DOCKER_CACHE_DIR}/${DOCKER_DISTRO}_container.tar.gz ]]; then
echo "Loading ${DOCKER_CACHE_DIR}/${DOCKER_DISTRO}_container.tar.gz..."
docker load -i ${DOCKER_CACHE_DIR}/${DOCKER_DISTRO}_container.tar.gz
if docker inspect "wavelab/ubuntu:${DOCKER_DISTRO}" > /dev/null 2>&1; then
echo "wavelab/ubuntu:${DOCKER_DISTRO} docker image found."
else
echo "wavelab/ubuntu:${DOCKER_DISTRO} not found - was not in the tar.gz?"
echo "Deleting the tar.gz file."
rm ${DOCKER_CACHE_DIR}/${DOCKER_DISTRO}_container.tar.gz
build_container
fi
else
echo "Docker container for ${DOCKER_DISTRO} not found in ${DOCKER_CACHE_DIR}/."
build_container
fi
else
echo "Docker cache dir not found."
build_container
fi