Add drone

This commit is contained in:
Christine Dodrill 2015-03-26 00:00:43 -07:00
parent 40da27ad79
commit f9fa87fe3e
7 changed files with 86 additions and 0 deletions

10
dev/drone/Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM flitter/init
RUN wget -O /tmp/drone.deb http://downloads.drone.io/master/drone.deb && \
dpkg -i /tmp/drone.deb && \
apt-get -f install # Sun Oct 26 10:23:45 PDT 2014
ADD drone /etc/service/drone/run
CMD /sbin/my_init
EXPOSE 8000

16
dev/drone/drone Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
export DRONE_DATABASE_DRIVER="postgres"
export DRONE_DATABASE_DATASOURCE="host=$DB_PORT_5432_TCP_ADDR user=postgres dbname=drone sslmode=disable"
export DRONE_SERVER_PORT=:8080
if [ -z "$DOCKER_HOST" ]; then
echo "No docker host"
exit 1
else
export DRONE_WORKER_NODES=$DOCKER_HOST
fi
echo 'Everything is okay. Starting up drone!'
droned

View File

@ -0,0 +1,16 @@
[Unit]
Description=Drone.io continunous integration and delivery
After=docker.service
After=drone-db.service
Requires=docker.service
[Service]
Type=oneshot
ExecStart=/usr/bin/docker run --rm --link drone-db:pg xena/drone-fixdb
ExecStop=/usr/bin/fleetctl destroy drone-db-fix.service
[Install]
WantedBy=multi-user.target
[X-Fleet]
MachineOf=drone-db.service

View File

@ -0,0 +1,14 @@
[Unit]
Description=Drone.io continunous integration and delivery database
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill dronedb
ExecStartPre=/usr/bin/docker pull postgres
ExecStart=/usr/bin/docker run --name drone-db postgres
ExecStop=/usr/bin/docker kill drone
[Install]
WantedBy=multi-user.target

22
dev/drone/drone.service Normal file
View File

@ -0,0 +1,22 @@
[Unit]
Description=Drone.io continunous integration and delivery
After=docker.service
After=drone-db.service
After=drone-db-fix.service
Requires=docker.service
# You need to edit this for your github/gitlab api keys
[Service]
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill drone
ExecStartPre=-/usr/bin/docker rm drone
ExecStartPre=/usr/bin/docker pull xena/drone
ExecStart=/usr/bin/docker run --name drone --link drone-db:db --hostname drone -v /var/run/docker.sock:/docker.sock -e DOCKER_HOST="unix:///docker.sock" -P xena/drone
ExecStop=/usr/bin/docker rm -f drone
[Install]
WantedBy=multi-user.target
[X-Fleet]
MachineOf=drone-db.service

View File

@ -0,0 +1,5 @@
FROM postgres
ADD fixdb.sh /
CMD /fixdb.sh

3
dev/drone/fixdb/fixdb.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
psql -h $PG_PORT_5432_TCP_ADDR -p $PG_PORT_5432_TCP_PORT -U postgres -c "CREATE DATABASE drone;"