add drone pipeline
Some checks reported errors
continuous-integration/drone/push Build is passing
continuous-integration/drone Build encountered an error

This commit is contained in:
Simon Marsh 2021-12-30 13:11:15 +00:00
parent 18853a82c6
commit 256e198fee
Signed by: burble
GPG Key ID: 0FCCD13AE1CF7ED8
2 changed files with 57 additions and 52 deletions

57
.drone.yml Normal file
View File

@ -0,0 +1,57 @@
---
kind: pipeline
type: docker
name: deploy
steps:
- name: build alpine
image: c8n.io/simonburblecom/bird-build:alpine
commands:
- /build.sh
- name: build ubuntu
image: c8n.io/simonburblecom/bird-build:ubuntu
commands:
- /build.sh
- name: upload
image: plugins/s3
settings:
bucket: artifacts
access_key:
from_secret: MINIO_ACCESS_KEY
secret_key:
from_secret: MINIO_SECRET_KEY
endpoint: https://minio.burble.dn42
region: uk-lon3
path_style: true
source: artifacts/**/*
strip_prefix: artifacts/
target: /bird/${DRONE_BRANCH}
image_pull_secrets:
- CONFIG_JSON
---
kind: secret
name: CONFIG_JSON
get:
path: burble.dn42/kv/data/drone/docker
name: configjson
---
kind: secret
name: MINIO_ACCESS_KEY
get:
path: burble.dn42/kv/data/drone/minio
name: ACCESS_KEY
---
kind: secret
name: MINIO_SECRET_KEY
get:
path: burble.dn42/kv/data/drone/minio
name: SECRET_KEY

View File

@ -1,52 +0,0 @@
#!/bin/bash -e
##########################################################################
date=$(date +%y%m%d)
version='2.0.8'
git tag -a "burble-${version}-${date}" -m "burble.dn42 build ${version}/${date}"
git push --tags
# configure
if [ ! -f configure ]
then
autoreconf
fi
./configure \
--prefix=/usr \
--sysconfdir=/etc/bird \
--localstatedir=/var
# make
make -j4
# create debian package
echo "bird-$version for burble.dn42" > description-pak
sudo checkinstall \
--default \
--type='debian' --install=no \
--pkgname='bird' \
--pkgversion="$version" \
--pkgrelease="burble-$date" \
--maintainer="simon@burble.com" \
--provides='bird' \
--strip \
--backup=no
# reset perms
sudo chown simon.simon *.deb
# upload
pkg="bird_${version}-burble-${date}_amd64.deb"
dstdir='minio/artifacts/bird'
dst="${dstdir}/${date}/${pkg}"
mc cp "$pkg" "$dst"
mc cp "$dst" "${dstdir}/current/bird_${version}-burble_amd64.deb"
##########################################################################
# end of file