From e38a5a25e03a5b301233854194f75f54a9eb2580 Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Sun, 24 May 2015 11:12:54 +0530 Subject: [PATCH] ci: Allow local tests to run in a docker Signed-off-by: Abhishek Lekshmanan --- Dockerfile | 19 ++++++++ ci/entrypoint.sh | 114 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100644 Dockerfile create mode 100755 ci/entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..943cc88 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM golang:1.3-wheezy +MAINTAINER Abhishek Lekshmanan "abhishek.lekshmanan@gmail.com" + +ENV CEPH_VERSION giant + +RUN echo deb http://ceph.com/debian-$CEPH_VERSION/ wheezy main | tee /etc/apt/sources.list.d/ceph-$CEPH_VERSION.list + +# Running wget with no certificate checks, alternatively ssl-cert package should be installed +RUN wget --no-check-certificate -q -O- 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc' | apt-key add - &&\ + apt-get update && \ + apt-get install -y ceph \ + librados-dev librbd-dev libcephfs-dev + +VOLUME /go/src/github.com/noahdesu/go-ceph + +COPY ./ci/entrypoint.sh /tmp/entrypoint.sh + +ENTRYPOINT ["/tmp/entrypoint.sh", "/tmp/micro-ceph"] + diff --git a/ci/entrypoint.sh b/ci/entrypoint.sh new file mode 100755 index 0000000..21474df --- /dev/null +++ b/ci/entrypoint.sh @@ -0,0 +1,114 @@ +#!/bin/bash +# +# Copyright (C) 2013,2014 Loic Dachary +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +set -e +set -u +DIR=$1 + +#if ! dpkg -l ceph ; then +# wget -q -O- 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc' | sudo apt-key add - +# echo deb http://ceph.com/debian-dumpling/ $(lsb_release -sc) main | sudo tee /etc/apt/sources.list.d/ceph.list +# sudo apt-get update +# sudo apt-get --yes install ceph ceph-common +#fi + +# get rid of process and directories leftovers +pkill ceph-mon || true +pkill ceph-osd || true +rm -fr $DIR + +# cluster wide parameters +mkdir -p ${DIR}/log +cat >> $DIR/ceph.conf <> $DIR/ceph.conf <> $DIR/ceph.conf <> $DIR/ceph.conf <