buildbot-master/start_docker_buildbot_master.sh
2019-08-13 14:57:13 +02:00

28 lines
492 B
Bash
Executable File

#!/bin/bash
IMAGE_NAME=buildbot-master
CONTAINER_NAME=buildbot-master
HOST_DIR=/srv/buildbot-master
SLAVE_DIR=/buildbot
docker build -t $IMAGE_NAME .
docker rm -f $CONTAINER_NAME
OLD_IMG=$(docker images | grep '^$IMAGE_NAME' | grep '<none>' | awk '{print $3}')
if [ ! -z "$OLD_IMG" ]; then
docker rmi $OLD_IMG
fi
docker run \
--detach \
--restart always \
--publish 8010:8010 \
--publish 9989:9989 \
--name $CONTAINER_NAME \
--volume $HOST_DIR:$SLAVE_DIR \
$IMAGE_NAME:latest