summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2020-05-03 21:13:33 +0100
committeriphydf <iphydf@users.noreply.github.com>2020-05-05 23:41:16 +0100
commit3851cfb652f1b2237738a49c106e703f0270ceee (patch)
treed760cc11853a8d56fc4cd4455f4eeba23685e07f
parent8c0fd40356e4a7724b556e17b15b0d14f7d25b4d (diff)
Add autotools build to localbuild docker images.
-rw-r--r--.hadolint.yaml6
-rw-r--r--other/docker/autotools/Dockerfile23
-rw-r--r--other/docker/cmake/Dockerfile14
-rwxr-xr-xother/docker/run-ci22
-rw-r--r--other/docker/travis/Dockerfile (renamed from other/docker/Dockerfile.ci)12
5 files changed, 58 insertions, 19 deletions
diff --git a/.hadolint.yaml b/.hadolint.yaml
new file mode 100644
index 00000000..bc95a173
--- /dev/null
+++ b/.hadolint.yaml
@@ -0,0 +1,6 @@
1---
2ignored:
3 - DL3007
4 - DL3008
5 - DL3013
6 - DL3018
diff --git a/other/docker/autotools/Dockerfile b/other/docker/autotools/Dockerfile
new file mode 100644
index 00000000..9922a62b
--- /dev/null
+++ b/other/docker/autotools/Dockerfile
@@ -0,0 +1,23 @@
1################################################
2# autotools-linux
3FROM localbuild/travis:1.0.0
4
5USER root
6RUN apt-get update && apt-get install --no-install-recommends -y \
7 autoconf \
8 automake \
9 libtool \
10 && apt-get clean \
11 && rm -rf /var/lib/apt/lists/*
12USER travis
13
14# Copy minimal files to run "autotools-linux install", so we can avoid
15# rebuilding nacl and other things when only source files change.
16RUN mkdir -p /home/travis/build/c-toxcore /home/travis/cache
17WORKDIR /home/travis/build/c-toxcore
18COPY --chown=travis:travis c-toxcore/.travis/ /home/travis/build/c-toxcore/.travis/
19RUN .travis/autotools-linux install
20
21# Now copy the rest of the sources and run the build.
22COPY --chown=travis:travis . /home/travis/build/
23RUN .travis/autotools-linux script
diff --git a/other/docker/cmake/Dockerfile b/other/docker/cmake/Dockerfile
new file mode 100644
index 00000000..0b70a9f7
--- /dev/null
+++ b/other/docker/cmake/Dockerfile
@@ -0,0 +1,14 @@
1################################################
2# cmake-linux
3FROM localbuild/travis:1.0.0
4
5# Copy minimal files to run "cmake-linux install", so we can avoid rebuilding
6# astyle and other things when only source files change.
7RUN mkdir -p /home/travis/build/c-toxcore /home/travis/cache
8WORKDIR /home/travis/build/c-toxcore
9COPY --chown=travis:travis c-toxcore/.travis/ /home/travis/build/c-toxcore/.travis/
10RUN .travis/cmake-linux install
11
12# Now copy the rest of the sources and run the build.
13COPY --chown=travis:travis . /home/travis/build/
14RUN .travis/cmake-linux script
diff --git a/other/docker/run-ci b/other/docker/run-ci
index 9005cfbd..a42c11eb 100755
--- a/other/docker/run-ci
+++ b/other/docker/run-ci
@@ -1,15 +1,21 @@
1#!/bin/bash 1#!/bin/bash
2 2
3set -eu 3set -eux
4
5STAGE="${1-cmake}"
4 6
5readarray -t FILES <<<"$(git ls-files | sed -e 's,^,c-toxcore/,')" 7readarray -t FILES <<<"$(git ls-files | sed -e 's,^,c-toxcore/,')"
6 8
9FILES+=(c-toxcore/.git)
10
7if [ -f .git ]; then 11if [ -f .git ]; then
8 cd .. 12 FILES+=(.git/modules/c-toxcore)
9 tar -c "${FILES[@]}" "c-toxcore/.git" ".git/modules/c-toxcore" |
10 docker build -f c-toxcore/other/docker/Dockerfile.ci -
11else
12 cd ..
13 tar -c "${FILES[@]}" "c-toxcore/.git" |
14 docker build -f c-toxcore/other/docker/Dockerfile.ci -
15fi 13fi
14
15cd ..
16tar -c "${FILES[@]}" |
17 docker build -f "c-toxcore/other/docker/travis/Dockerfile" \
18 -t localbuild/travis:1.0.0 -
19tar -c "${FILES[@]}" |
20 docker build -f "c-toxcore/other/docker/$STAGE/Dockerfile" \
21 -t "localbuild/$STAGE:1.0.0" -
diff --git a/other/docker/Dockerfile.ci b/other/docker/travis/Dockerfile
index db7e5e2c..96bfdab4 100644
--- a/other/docker/Dockerfile.ci
+++ b/other/docker/travis/Dockerfile
@@ -22,6 +22,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
22 && apt-get clean \ 22 && apt-get clean \
23 && rm -rf /var/lib/apt/lists/* 23 && rm -rf /var/lib/apt/lists/*
24 24
25SHELL ["/bin/bash", "-o", "pipefail", "-c"]
25RUN curl https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \ 26RUN curl https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
26 && apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main" \ 27 && apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main" \
27 && apt-get update && apt-get install --no-install-recommends -y \ 28 && apt-get update && apt-get install --no-install-recommends -y \
@@ -62,14 +63,3 @@ USER travis
62ENV CC=gcc CXX=g++ \ 63ENV CC=gcc CXX=g++ \
63PATH=/home/travis/.local/bin:$PATH \ 64PATH=/home/travis/.local/bin:$PATH \
64TRAVIS_REPO_SLUG=TokTok/c-toxcore 65TRAVIS_REPO_SLUG=TokTok/c-toxcore
65
66# Copy minimal files to run "cmake-linux install", so we can avoid rebuilding
67# astyle and other things when only source files change.
68RUN mkdir -p /home/travis/build/c-toxcore /home/travis/cache
69WORKDIR /home/travis/build/c-toxcore
70COPY --chown=travis:travis c-toxcore/.travis/ /home/travis/build/c-toxcore/.travis/
71RUN .travis/cmake-linux install
72
73# Now copy the rest of the sources and run the build.
74COPY --chown=travis:travis . /home/travis/build/
75RUN .travis/cmake-linux script