diff options
Diffstat (limited to 'ci')
-rw-r--r-- | ci/Dockerfile/fedora23 | 5 | ||||
l--------- | ci/Dockerfile/fedora23.x86_64 | 1 | ||||
-rw-r--r-- | ci/Dockerfile/ubuntu1404 | 10 | ||||
l--------- | ci/Dockerfile/ubuntu1404.ppc64le | 1 | ||||
l--------- | ci/Dockerfile/ubuntu1404.x86_64 | 1 | ||||
-rwxr-xr-x | ci/build-all-defconfigs.sh | 38 | ||||
-rwxr-xr-x | ci/build.sh | 55 |
7 files changed, 111 insertions, 0 deletions
diff --git a/ci/Dockerfile/fedora23 b/ci/Dockerfile/fedora23 new file mode 100644 index 00000000..5c425a39 --- /dev/null +++ b/ci/Dockerfile/fedora23 @@ -0,0 +1,5 @@ +FROM fedora:23 +RUN dnf -y install gcc-c++ flex bison git ctags cscope expat-devel patch zlib-devel zlib-static texinfo perl-bignum "perl(XML::Simple)" "perl(YAML)" "perl(XML::SAX)" "perl(Fatal)" "perl(Thread::Queue)" "perl(Env)" "perl(XML::LibXML)" "perl(Digest::SHA1)" libxml2-devel +RUN dnf -y install which wget unzip tar cpio python bzip2 bc +RUN dnf -y install findutils +RUN dnf -y install ncurses-devel diff --git a/ci/Dockerfile/fedora23.x86_64 b/ci/Dockerfile/fedora23.x86_64 new file mode 120000 index 00000000..5322ce73 --- /dev/null +++ b/ci/Dockerfile/fedora23.x86_64 @@ -0,0 +1 @@ +fedora23
\ No newline at end of file diff --git a/ci/Dockerfile/ubuntu1404 b/ci/Dockerfile/ubuntu1404 new file mode 100644 index 00000000..8acb9320 --- /dev/null +++ b/ci/Dockerfile/ubuntu1404 @@ -0,0 +1,10 @@ +FROM ubuntu:14.04 +# Don't ask. Ubuntu is awful. +RUN sed -e 's/main$/main universe/' --in-place=orig /etc/apt/sources.list +RUN DEBIAN_FRONTEND=noninteractive apt-get update +RUN DEBIAN_FRONTEND=noninteractive apt-get install -yy cscope ctags \ + libz-dev libexpat-dev \ + python language-pack-en texinfo \ + build-essential g++ git bison flex unzip \ + libxml-simple-perl libxml-sax-perl libxml2-dev libxml2-utils xsltproc +RUN DEBIAN_FRONTEND=noninteractive apt-get install -yy wget bc diff --git a/ci/Dockerfile/ubuntu1404.ppc64le b/ci/Dockerfile/ubuntu1404.ppc64le new file mode 120000 index 00000000..529a5fa5 --- /dev/null +++ b/ci/Dockerfile/ubuntu1404.ppc64le @@ -0,0 +1 @@ +ubuntu1404
\ No newline at end of file diff --git a/ci/Dockerfile/ubuntu1404.x86_64 b/ci/Dockerfile/ubuntu1404.x86_64 new file mode 120000 index 00000000..529a5fa5 --- /dev/null +++ b/ci/Dockerfile/ubuntu1404.x86_64 @@ -0,0 +1 @@ +ubuntu1404
\ No newline at end of file diff --git a/ci/build-all-defconfigs.sh b/ci/build-all-defconfigs.sh new file mode 100755 index 00000000..1730e289 --- /dev/null +++ b/ci/build-all-defconfigs.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +set -ex +set -eo pipefail + +DEFCONFIGS=`(cd openpower/configs; ls -1 *_defconfig)` + +if [ -z "$1" or ! -d "$1" ]; then + echo "No output directory specified" + exit 1; +fi + +if [ -z "$CCACHE_DIR" ]; then + CCACHE_DIR=`pwd`/.op-build_ccache +fi + +shopt -s expand_aliases +source op-build-env + +for i in $DEFCONFIGS; do + op-build $i + echo 'BR2_CCACHE=y' >> output/.config + echo "BR2_CCACHE_DIR=\"$CCACHE_DIR\"" >> output/.config + echo 'BR2_CCACHE_INITIAL_SETUP=""' >> output/.config + + op-build olddefconfig + op-build + r=$? + mkdir $1/$i-images + mv output/images/* $1/$i-images/ + mv output/.config $1/$i-images/.config + lsb_release -a > $1/$i-images/lsb_release + rm -rf output/* + if [ $r -ne 0 ]; then + exit $r + fi +done + diff --git a/ci/build.sh b/ci/build.sh new file mode 100755 index 00000000..d7e98cad --- /dev/null +++ b/ci/build.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +set -ex +set -eo pipefail + +function run_docker +{ + $DOCKER_PREFIX docker run --cap-add=sys_admin --net=host --rm=true \ + --user="${USER}" -w "${PWD}" -v "${PWD}":"${PWD}":Z \ + -t $1 $2 +} + +env + +if [ -d output-images ]; then + echo 'output-images already exists!'; + exit 1; +fi + +for distro in ubuntu1404 fedora23; +do + base_dockerfile=ci/Dockerfile/$distro.`arch` + if [ ! -f $base_dockerfile ]; then + echo '$distro not supported on `arch`.'; + continue + fi + if [[ -n "$HTTP_PROXY" ]]; then + http_proxy=$HTTP_PROXY + fi + if [[ -n "$http_proxy" ]]; then + if [[ "$distro" == fedora23 ]]; then + PROXY="RUN echo \"proxy=${http_proxy}\" >> /etc/dnf/dnf.conf" + fi + if [[ "$distro" == ubuntu1404 ]]; then + PROXY="RUN echo \"Acquire::http::Proxy \\"\"${http_proxy}/\\"\";\" > /etc/apt/apt.conf.d/000apt-cacher-ng-proxy" + fi + fi + + Dockerfile=$(head -n1 $base_dockerfile; echo ${PROXY}; tail -n +2 $base_dockerfile; cat << EOF +RUN groupadd -g ${GROUPS} ${USER} && useradd -d ${HOME} -m -u ${UID} -g ${GROUPS} ${USER} +${PROXY} +USER ${USER} +ENV HOME ${HOME} +EOF +) + $DOCKER_PREFIX docker build -t openpower/op-build-$distro - <<< "${Dockerfile}" + mkdir -p output-images/$distro + run_docker openpower/op-build-$distro "./ci/build-all-defconfigs.sh output-images/$distro" + if [ $? = 0 ]; then + mv *-images output-$distro/ + else + exit $?; + fi +done; + |