From 88e049e327978e8bd84e77cc71287dd2912aa226 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 27 Jan 2021 08:26:25 -0500 Subject: ci: add docker spec to build ninja for linux-aarch64 --- .gitlab/ci/docker/ninja/centos7-aarch64.bash | 20 ++++++++++++++++++++ .gitlab/ci/docker/ninja/centos7-aarch64/Dockerfile | 7 +++++++ .../ci/docker/ninja/centos7-aarch64/build_ninja.sh | 11 +++++++++++ 3 files changed, 38 insertions(+) create mode 100755 .gitlab/ci/docker/ninja/centos7-aarch64.bash create mode 100644 .gitlab/ci/docker/ninja/centos7-aarch64/Dockerfile create mode 100755 .gitlab/ci/docker/ninja/centos7-aarch64/build_ninja.sh (limited to '.gitlab') diff --git a/.gitlab/ci/docker/ninja/centos7-aarch64.bash b/.gitlab/ci/docker/ninja/centos7-aarch64.bash new file mode 100755 index 0000000000..d24967c958 --- /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 0000000000..d9e1cc6b20 --- /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 + +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 0000000000..7e2602cc16 --- /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 -- cgit v1.2.1