From 0fb897a1d2cc03e76b8e4cc8d23fcc43a6020e7a Mon Sep 17 00:00:00 2001 From: hylom Date: Tue, 17 Apr 2018 18:47:58 +0900 Subject: [PATCH] add build-container --- build-container/Dockerfile | 16 ++++++++++++++++ build-container/build.sh | 3 +++ build-container/files/entrypoint.sh | 36 ++++++++++++++++++++++++++++++++++++ build-container/files/jaist.list | 3 +++ 4 files changed, 58 insertions(+) create mode 100644 build-container/Dockerfile create mode 100755 build-container/build.sh create mode 100644 build-container/files/entrypoint.sh create mode 100644 build-container/files/jaist.list diff --git a/build-container/Dockerfile b/build-container/Dockerfile new file mode 100644 index 00000000..fcb10a23 --- /dev/null +++ b/build-container/Dockerfile @@ -0,0 +1,16 @@ +FROM debian:stretch +MAINTAINER hirom@osdn.jp + +# use Japanese mirror +COPY files/jaist.list /etc/apt/sources.list + +# install basic packages +RUN apt-get update -y +RUN apt-get install -y devscripts git +RUN apt-get install -y debhelper cdbs + +COPY files/entrypoint.sh /entrypoint.sh +RUN chmod 755 /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] +VOLUME ["/var/newslash/build"] + diff --git a/build-container/build.sh b/build-container/build.sh new file mode 100755 index 00000000..3627f681 --- /dev/null +++ b/build-container/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash +docker build -t newslash-build . +docker run -ti --rm -v $(pwd)/build:/var/newslash/build newslash-build diff --git a/build-container/files/entrypoint.sh b/build-container/files/entrypoint.sh new file mode 100644 index 00000000..554e670e --- /dev/null +++ b/build-container/files/entrypoint.sh @@ -0,0 +1,36 @@ +#!/bin/bash +set -eo pipefail + +BUILD_DIR=/var/newslash/build +REPO_URL=http://scm.osdn.net/gitroot/srad-devel/newslash.git + +# checkout newslash source codes +mkdir -p $BUILD_DIR +cd $BUILD_DIR + +if [ -d newslash ]; then + if [ -d newslash/.git ]; then + cd newslash + git pull + git submodule update + else + rm -rf newslash + git clone $REPO_URL newslash + cd newslash + git submodule init && git submodule update + fi +else + git clone $REPO_URL newslash + cd newslash + git submodule init && git submodule update +fi + +# generate changelog +./misc/gen_changelog.sh > debian/changelog + +# create default config file +#cp /home/hylom/mojolicious/src/newslash_web/newslash-web.production.json ./repo/src/newslash_web/' + +# start build +debuild -B -us -uc + diff --git a/build-container/files/jaist.list b/build-container/files/jaist.list new file mode 100644 index 00000000..ec9ccd48 --- /dev/null +++ b/build-container/files/jaist.list @@ -0,0 +1,3 @@ +deb http://ftp.jaist.ac.jp/pub/Linux/debian/ stretch main contrib non-free +deb http://ftp.jaist.ac.jp/pub/Linux/debian/ stretch-updates main contrib non-free +deb http://ftp.jaist.ac.jp/pub/Linux/debian/ stretch-backports main contrib non-free \ No newline at end of file -- 2.11.0