summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-01-27 13:26:25 (GMT)
committerBrad King <brad.king@kitware.com>2021-01-27 15:29:38 (GMT)
commit88e049e327978e8bd84e77cc71287dd2912aa226 (patch)
treeb3986ac4fc0d088b3d1a40e4b9d1234e0660674e
parenteefa0ed0fa6b7f520d77b85829951cd16e81a0b0 (diff)
downloadCMake-88e049e327978e8bd84e77cc71287dd2912aa226.zip
CMake-88e049e327978e8bd84e77cc71287dd2912aa226.tar.gz
CMake-88e049e327978e8bd84e77cc71287dd2912aa226.tar.bz2
ci: add docker spec to build ninja for linux-aarch64
-rwxr-xr-x.gitlab/ci/docker/ninja/centos7-aarch64.bash20
-rw-r--r--.gitlab/ci/docker/ninja/centos7-aarch64/Dockerfile7
-rwxr-xr-x.gitlab/ci/docker/ninja/centos7-aarch64/build_ninja.sh11
3 files changed, 38 insertions, 0 deletions
diff --git a/.gitlab/ci/docker/ninja/centos7-aarch64.bash b/.gitlab/ci/docker/ninja/centos7-aarch64.bash
new file mode 100755
index 0000000..d24967c
--- /dev/null
+++ b/.gitlab/ci/docker/ninja/centos7-aarch64.bash
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+
+set -e
+set -x
+
+cleanup() {
+ docker container rm -fv "$build_container" >/dev/null 2>&1 || true
+ docker image rm -f "$build_image" >/dev/null 2>&1 || true
+}
+
+readonly suffix="-$(date -u +%Y-%m-%d)-${RANDOM}"
+readonly build_container="ninja-build-linux-aarch64$suffix"
+readonly build_image="ninja:build-linux-aarch64$suffix"
+readonly git_tag="${1-v1.10.2}"
+
+trap "cleanup" EXIT INT TERM
+
+docker image build --build-arg GIT_TAG="$git_tag" --tag="$build_image" "${BASH_SOURCE%/*}/centos7-aarch64"
+docker container create --name "$build_container" "$build_image"
+docker cp "$build_container:/ninja/ninja" "ninja"
diff --git a/.gitlab/ci/docker/ninja/centos7-aarch64/Dockerfile b/.gitlab/ci/docker/ninja/centos7-aarch64/Dockerfile
new file mode 100644
index 0000000..d9e1cc6
--- /dev/null
+++ b/.gitlab/ci/docker/ninja/centos7-aarch64/Dockerfile
@@ -0,0 +1,7 @@
+FROM kitware/cmake:build-linux-aarch64-base-2020-12-21
+MAINTAINER Brad King <brad.king@kitware.com>
+
+ARG GIT_TAG=v1.10.2
+
+COPY build_ninja.sh /root/build_ninja.sh
+RUN scl enable devtoolset-7 -- sh /root/build_ninja.sh $GIT_TAG
diff --git a/.gitlab/ci/docker/ninja/centos7-aarch64/build_ninja.sh b/.gitlab/ci/docker/ninja/centos7-aarch64/build_ninja.sh
new file mode 100755
index 0000000..7e2602c
--- /dev/null
+++ b/.gitlab/ci/docker/ninja/centos7-aarch64/build_ninja.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+git clone https://github.com/ninja-build/ninja.git
+cd ninja
+git checkout "${1-v1.10.2}"
+./configure.py --bootstrap
+./ninja all
+./ninja_test
+strip ninja