diff options
author | iphydf <iphydf@users.noreply.github.com> | 2020-05-03 21:13:33 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2020-05-05 23:41:16 +0100 |
commit | 3851cfb652f1b2237738a49c106e703f0270ceee (patch) | |
tree | d760cc11853a8d56fc4cd4455f4eeba23685e07f | |
parent | 8c0fd40356e4a7724b556e17b15b0d14f7d25b4d (diff) |
Add autotools build to localbuild docker images.
-rw-r--r-- | .hadolint.yaml | 6 | ||||
-rw-r--r-- | other/docker/autotools/Dockerfile | 23 | ||||
-rw-r--r-- | other/docker/cmake/Dockerfile | 14 | ||||
-rwxr-xr-x | other/docker/run-ci | 22 | ||||
-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 | --- | ||
2 | ignored: | ||
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 | ||
3 | FROM localbuild/travis:1.0.0 | ||
4 | |||
5 | USER root | ||
6 | RUN 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/* | ||
12 | USER 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. | ||
16 | RUN mkdir -p /home/travis/build/c-toxcore /home/travis/cache | ||
17 | WORKDIR /home/travis/build/c-toxcore | ||
18 | COPY --chown=travis:travis c-toxcore/.travis/ /home/travis/build/c-toxcore/.travis/ | ||
19 | RUN .travis/autotools-linux install | ||
20 | |||
21 | # Now copy the rest of the sources and run the build. | ||
22 | COPY --chown=travis:travis . /home/travis/build/ | ||
23 | RUN .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 | ||
3 | FROM 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. | ||
7 | RUN mkdir -p /home/travis/build/c-toxcore /home/travis/cache | ||
8 | WORKDIR /home/travis/build/c-toxcore | ||
9 | COPY --chown=travis:travis c-toxcore/.travis/ /home/travis/build/c-toxcore/.travis/ | ||
10 | RUN .travis/cmake-linux install | ||
11 | |||
12 | # Now copy the rest of the sources and run the build. | ||
13 | COPY --chown=travis:travis . /home/travis/build/ | ||
14 | RUN .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 | ||
3 | set -eu | 3 | set -eux |
4 | |||
5 | STAGE="${1-cmake}" | ||
4 | 6 | ||
5 | readarray -t FILES <<<"$(git ls-files | sed -e 's,^,c-toxcore/,')" | 7 | readarray -t FILES <<<"$(git ls-files | sed -e 's,^,c-toxcore/,')" |
6 | 8 | ||
9 | FILES+=(c-toxcore/.git) | ||
10 | |||
7 | if [ -f .git ]; then | 11 | if [ -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 - | ||
11 | else | ||
12 | cd .. | ||
13 | tar -c "${FILES[@]}" "c-toxcore/.git" | | ||
14 | docker build -f c-toxcore/other/docker/Dockerfile.ci - | ||
15 | fi | 13 | fi |
14 | |||
15 | cd .. | ||
16 | tar -c "${FILES[@]}" | | ||
17 | docker build -f "c-toxcore/other/docker/travis/Dockerfile" \ | ||
18 | -t localbuild/travis:1.0.0 - | ||
19 | tar -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 | ||
25 | SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
25 | RUN curl https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \ | 26 | RUN 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 | |||
62 | ENV CC=gcc CXX=g++ \ | 63 | ENV CC=gcc CXX=g++ \ |
63 | PATH=/home/travis/.local/bin:$PATH \ | 64 | PATH=/home/travis/.local/bin:$PATH \ |
64 | TRAVIS_REPO_SLUG=TokTok/c-toxcore | 65 | TRAVIS_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. | ||
68 | RUN mkdir -p /home/travis/build/c-toxcore /home/travis/cache | ||
69 | WORKDIR /home/travis/build/c-toxcore | ||
70 | COPY --chown=travis:travis c-toxcore/.travis/ /home/travis/build/c-toxcore/.travis/ | ||
71 | RUN .travis/cmake-linux install | ||
72 | |||
73 | # Now copy the rest of the sources and run the build. | ||
74 | COPY --chown=travis:travis . /home/travis/build/ | ||
75 | RUN .travis/cmake-linux script | ||