Initial commit
This commit is contained in:
commit
3edc5abaa4
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@ -0,0 +1,14 @@
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apk add --update --no-cache build-base gcc git libffi-dev openssl-dev python3 python3-dev py3-pip && \
|
||||
if [ ! -e /usr/bin/python ]; then ln -f /usr/bin/python3 /usr/bin/python ; fi && \
|
||||
if [ ! -e /usr/bin/pip ]; then ln -f /usr/bin/pip3 /usr/bin/pip ; fi && \
|
||||
yes | pip install --upgrade pip
|
||||
|
||||
RUN yes | pip install 'buildbot[bundle]'
|
||||
RUN yes | pip install 'buildbot[tls]'
|
||||
RUN yes | pip install 'docker-py'
|
||||
|
||||
COPY run.sh /bin/
|
||||
ENTRYPOINT ["/bin/run.sh"]
|
||||
|
22
run.sh
Executable file
22
run.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
RUN_DIR=/buildbot
|
||||
|
||||
buildbot create-master $RUN_DIR
|
||||
|
||||
# create default configuration
|
||||
if [ ! -f $RUN_DIR/master.cfg ]; then
|
||||
mv $RUN_DIR/master.cfg.sample $RUN_DIR/master.cfg
|
||||
sed -i 's/http:\/\/localhost:8010/https:\/\/192.168.178.39:8010/' $RUN_DIR/master.cfg
|
||||
sed -i 's/Hello World CI/blackfinn CI/' $RUN_DIR/master.cfg
|
||||
echo "c['buildbotNetUsageData'] = None" >> $RUN_DIR/master.cfg
|
||||
fi
|
||||
|
||||
buildbot checkconfig $RUN_DIR
|
||||
buildbot start $RUN_DIR
|
||||
|
||||
while :;
|
||||
do
|
||||
sleep 1
|
||||
done
|
||||
|
27
start_docker_buildbot_master.sh
Executable file
27
start_docker_buildbot_master.sh
Executable file
@ -0,0 +1,27 @@
|
||||
#!/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
|
||||
|
Loading…
x
Reference in New Issue
Block a user