gplugin/builders

Add a clang-format image

2020-02-15, Gary Kramlich
db60d4884dd1
Parents 4f76665cbe1e
Children bdf44477c025
Add a clang-format image
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dockerfile.clang-format Sat Feb 15 20:45:21 2020 -0600
@@ -0,0 +1,13 @@
+FROM gplugin/builders:debian-bullseye-amd64
+
+MAINTAINER Gary Kramlich <grim@reaperworld.com>
+
+RUN set -ex && \
+ apt-get update && \
+ apt-get install -y --no-install-recommends clang-format-9 && \
+ update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-9 1000 && \
+ apt-get clean && \
+ rm -rf /var/lib/apt/lists
+
+COPY clang-format/build.sh /
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/clang-format/build.sh Sat Feb 15 20:45:21 2020 -0600
@@ -0,0 +1,28 @@
+#!/bin/sh -ex
+# Copyright (C) 2015-2016 Gary Kramlich <grim@reaperworld.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+cd ${CONVEY_WORKSPACE}
+
+BUILD_DIR="build-clang-format"
+
+meson ${BUILD_DIR}
+ninja -C ${BUILD_DIR} clang-format
+hg diff 2>/dev/null
+
+[ -n $(hg id -T '{dirty}') ] && exit 1
+
+
--- a/convey.yml Mon Feb 10 01:26:23 2020 -0600
+++ b/convey.yml Sat Feb 15 20:45:21 2020 -0600
@@ -59,6 +59,11 @@
stages:
- tasks: [import, build]
+ clang-format:
+ environment: [TARGET=clang-format]
+ stages:
+ - tasks: [import, build]
+
debian-buster-amd64:
environment: [TARGET=debian-buster-amd64]
stages: