From b1877d53652e43ba4bf84f7e35fb2e8042384db4 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 25 Dec 2018 15:57:40 -0600 Subject: [PATCH] Add azure pipeline (#10) Closes #6. --- .gitmodules | 8 ++++---- azure-docker/Dockerfile | 12 ++++++++++++ azure-pipelines.yml | 26 ++++++++++++++++++++++++++ deps/03-build.sh | 10 +++++----- 4 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 azure-docker/Dockerfile create mode 100644 azure-pipelines.yml diff --git a/.gitmodules b/.gitmodules index f902ee0..ce888eb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,12 @@ [submodule "deps/robotpy-cscore"] path = deps/robotpy-cscore - url = git@github.com:robotpy/robotpy-cscore.git + url = https://github.com/robotpy/robotpy-cscore.git [submodule "deps/pynetworktables"] path = deps/pynetworktables - url = git@github.com:robotpy/pynetworktables.git + url = https://github.com/robotpy/pynetworktables.git [submodule "deps/allwpilib"] path = deps/allwpilib - url = git@github.com:wpilibsuite/allwpilib.git + url = https://github.com/wpilibsuite/allwpilib.git [submodule "deps/thirdparty-opencv"] path = deps/thirdparty-opencv - url = git@github.com:wpilibsuite/thirdparty-opencv.git + url = https://github.com/wpilibsuite/thirdparty-opencv.git diff --git a/azure-docker/Dockerfile b/azure-docker/Dockerfile new file mode 100644 index 0000000..779e61b --- /dev/null +++ b/azure-docker/Dockerfile @@ -0,0 +1,12 @@ +FROM debian:stretch-backports + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get -y update \ + && apt-get -y install \ + git vim parted \ + quilt realpath qemu-user-static debootstrap zerofree pxz zip dosfstools \ + bsdtar libcap2-bin rsync grep udev xz-utils curl xxd file \ + build-essential cmake python3 ant sudo \ + && apt-get -y -t stretch-backports install openjdk-11-jdk \ + && rm -rf /var/lib/apt/lists/* diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..1b05e23 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,26 @@ +resources: + containers: + - container: pi-gen + image: wpilib/pi-gen:latest + options: --privileged + +jobs: + - job: 'Main' + pool: + vmImage: 'Ubuntu 16.04' + + container: pi-gen + + steps: + - checkout: self + submodules: true + - script: | + cd deps && ./01-download.sh && ./02-extract.sh && ./03-build.sh && ./04-copy.sh + displayName: 'Build Image Dependencies' + - script: | + sudo sh -c 'dpkg-reconfigure qemu-user-static && ./build.sh' + cp deploy/*.zip $BUILD_ARTIFACTSTAGINGDIRECTORY + displayName: 'Build Image' + - task: PublishBuildArtifacts@1 + inputs: + artifactName: 'FRCVisionImage' diff --git a/deps/03-build.sh b/deps/03-build.sh index 068fdbd..e42b584 100755 --- a/deps/03-build.sh +++ b/deps/03-build.sh @@ -40,18 +40,18 @@ cmake ../../02-extract/opencv \ -DPYTHON3_NUMPY_INCLUDE_DIRS=${PWD}/../../02-extract/raspbian9/arm-raspbian9-linux-gnueabihf/usr/include/python3.5m/numpy \ -DOPENCV_EXTRA_FLAGS_DEBUG=-Og \ -DCMAKE_MODULE_PATH=${PWD}/../../thirdparty-opencv/arm-frc-modules \ - || die -make -j3 || die -make install || die + || exit 1 +make -j3 || exit 1 +make install || exit 1 popd # wpiutil, cscore, ntcore, cameraserver pushd allwpilib -./gradlew -PonlyRaspbian :wpiutil:build :cscore:build :ntcore:build :cameraserver:build :cameraserver:multiCameraServer:build || die +./gradlew -PonlyRaspbian :wpiutil:build :cscore:build :ntcore:build :cameraserver:build :cameraserver:multiCameraServer:build || exit 1 popd # tools pushd tools -make || die +make || exit 1 popd