diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..2e30b91 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,46 @@ +--- +kind: pipeline +type: docker +name: docker-build + +steps: + +- name: docker alpine + image: plugins/docker + settings: + registry: c8n.io + repo: c8n.io/simonburblecom/bird-build + tags: + - alpine + username: + from_secret: DOCKER_USER + password: + from_secret: DOCKER_PW + dockerfile: Dockerfile.alpine + +- name: docker ubuntu + image: plugins/docker + settings: + registry: c8n.io + repo: c8n.io/simonburblecom/bird-build + tags: + - ubuntu + username: + from_secret: DOCKER_USER + password: + from_secret: DOCKER_PW + dockerfile: Dockerfile.ubuntu + +--- +kind: secret +name: DOCKER_USER +get: + path: burble.dn42/kv/data/drone/docker + name: username + +--- +kind: secret +name: DOCKER_PW +get: + path: burble.dn42/kv/data/drone/docker + name: password diff --git a/Dockerfile.alpine b/Dockerfile.alpine new file mode 100644 index 0000000..9ead118 --- /dev/null +++ b/Dockerfile.alpine @@ -0,0 +1,5 @@ +FROM alpine +RUN apk add --update bash build-base git autoconf flex bison linux-headers ncurses-dev readline-dev && rm -rf /var/cache/apk/* +ADD build.sh /build.sh +RUN echo "alpine" > /dist +ENTRYPOINT [ '/build.sh' ] diff --git a/Dockerfile.ubuntu b/Dockerfile.ubuntu new file mode 100644 index 0000000..63c250c --- /dev/null +++ b/Dockerfile.ubuntu @@ -0,0 +1,5 @@ +FROM ubuntu +RUN apt -y update && apt -y dist-upgrade && apt -y install build-essential git autoconf flex bison linux-headers-generic libncurses-dev libreadline-dev && apt -y autoremove --purge && apt -y autoclean && rm -rf /var/cache/apt/archives +ADD build.sh /build.sh +RUN echo "ubuntu" > /dist +ENTRYPOINT [ '/build.sh' ] diff --git a/README.md b/README.md index c89c0c9..54ad04b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # docker-bird-build +[![Build Status](https://ci.burble.dn42/api/badges/burble.dn42/docker-bird-build/status.svg?ref=refs/heads/main)](https://ci.burble.dn42/burble.dn42/docker-bird-build) + +burble.dn42 specific docker image for building bird via Drone CI diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..d3a3823 --- /dev/null +++ b/build.sh @@ -0,0 +1,32 @@ +#!/bin/bash -e +########################################################################## + +DIST=$(cat /dist) + +# clear any previous build +if [ -f Makefile ] +then + make distclean +fi + +if [ ! -f configure ]; +then + autoreconf +fi + +# configure it +./configure \ + --prefix=/usr \ + --sysconfdir=/etc/bird \ + --localstatedir=/var \ + 2>&1 | tee conf.out + +# build it +make -j3 \ + 2>&1 | tee build.out + +mkdir -p artifacts/${DIST} > /dev/null 2>&1 +mv bird birdc birdcl artifacts/${DIST} + +########################################################################## +# end of file