From 748a62680c8cefcdb11207f5aa8a365bfd07f313 Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Fri, 10 Mar 2023 09:45:52 -0800 Subject: [PATCH] Add Drone support --- .drone.jsonnet | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ .drone/drone.sh | 24 +++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 .drone.jsonnet create mode 100755 .drone/drone.sh diff --git a/.drone.jsonnet b/.drone.jsonnet new file mode 100644 index 0000000..a14838d --- /dev/null +++ b/.drone.jsonnet @@ -0,0 +1,51 @@ +# Copyright 2023 Christian Mazakas +# Distributed under the Boost Software License, Version 1.0. +# https://www.boost.org/LICENSE_1_0.txt + +local triggers = +{ + branch: [ "master", "develop", "feature/*", "bugfix/*", "fix/*", "pr/*", "base-template" ] +}; + +local linux_pipeline(name, image, environment, packages = "", sources = [], arch = "amd64") = +{ + name: name, + kind: "pipeline", + type: "docker", + trigger: triggers, + platform: + { + os: "linux", + arch: arch + }, + steps: + [ + { + name: "everything", + image: image, + environment: environment, + commands: + [ + 'set -e', + 'uname -a', + 'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -', + ] + + (if sources != [] then [ ('apt-add-repository "' + source + '"') for source in sources ] else []) + + (if packages != "" then [ 'apt-get update', 'apt-get -y install ' + packages ] else []) + + [ + './.drone/drone.sh', + ] + } + ] +}; + +[ + + linux_pipeline( + "Linux 22.04 GCC 11* 32/64", + "cppalliance/droneubuntu2204:1", + {}, + "asciidoctor" + ), + +] diff --git a/.drone/drone.sh b/.drone/drone.sh new file mode 100755 index 0000000..3d0ba26 --- /dev/null +++ b/.drone/drone.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Copyright 2023 Christian Mazakas +# Distributed under the Boost Software License, Version 1.0. +# https://www.boost.org/LICENSE_1_0.txt + +set -ex +export PATH=~/.local/bin:/usr/local/bin:$PATH + +DRONE_BUILD_DIR=$(pwd) + +BOOST_BRANCH=develop +if [ "$DRONE_BRANCH" = "master" ]; then BOOST_BRANCH=master; fi + +cd .. +git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root +cd boost-root +git submodule update --init tools/boostdep +python tools/boostdep/depinst/depinst.py config +./bootstrap.sh +./b2 -d0 headers + +echo 'using asciidoctor : "/usr/bin/asciidoctor" ;' > ~/user-config.jam +./b2 $DRONE_BUILD_DIR