Build automation
This commit is contained in:
parent
8829b65ab2
commit
d0cfbdf3cf
46
Jenkinsfile
vendored
Normal file
46
Jenkinsfile
vendored
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
node(label: 'raspberrypi') {
|
||||||
|
def dists = ["stretch", "jessie", "wheezy"]
|
||||||
|
def srcdir = "${WORKSPACE}/src"
|
||||||
|
|
||||||
|
stage('Checkout') {
|
||||||
|
sh "rm -fr ${srcdir}"
|
||||||
|
sh "mkdir ${srcdir}"
|
||||||
|
dir(srcdir) {
|
||||||
|
checkout scm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < dists.size(); ++i) {
|
||||||
|
def dist = dists[i]
|
||||||
|
def pkgdir = "package-${dist}"
|
||||||
|
def results = "results-${dist}"
|
||||||
|
|
||||||
|
stage("Prepare source for ${dist}") {
|
||||||
|
sh "rm -fr ${pkgdir}"
|
||||||
|
sh "${srcdir}/prepare-build.sh ${dist} ${pkgdir}"
|
||||||
|
}
|
||||||
|
|
||||||
|
stage("Build for ${dist}") {
|
||||||
|
sh "rm -fr ${results}"
|
||||||
|
sh "mkdir -p ${results}"
|
||||||
|
dir(pkgdir) {
|
||||||
|
sh "DIST=${dist} pdebuild --use-pdebuild-internal --debbuildopts -b --buildresult ${WORKSPACE}/${results}"
|
||||||
|
}
|
||||||
|
archiveArtifacts artifacts: "${results}/*.deb", fingerprint: true
|
||||||
|
}
|
||||||
|
|
||||||
|
stage("Test install on ${dist}") {
|
||||||
|
sh "/build/repo/validate-packages.sh ${dist} ${results}/dump1090-fa_*.deb ${results}/dump1090_*.deb"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (env.BRANCH_NAME == "master" || env.BRANCH_NAME == "dev") {
|
||||||
|
stage("Deploy to staging repo") {
|
||||||
|
for (int i = 0; i < dists.size(); ++i) {
|
||||||
|
def dist = dists[i]
|
||||||
|
def results = "results-${dist}"
|
||||||
|
sh "/build/repo/deploy-packages.sh ${dist} ${results}/*.deb"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -11,6 +11,9 @@ then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export DEBFULLNAME=${DEBFULLNAME:-FlightAware build automation}
|
||||||
|
export DEBEMAIL=${DEBEMAIL:-adsb-devs@flightaware.com}
|
||||||
|
|
||||||
TOP=`dirname $0`
|
TOP=`dirname $0`
|
||||||
DIST=$1
|
DIST=$1
|
||||||
OUT=$2
|
OUT=$2
|
||||||
|
|
Loading…
Reference in a new issue