From 3c1e00f23f54f1411018c5d63a5e54283bd424bc Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 2 Mar 2018 19:13:20 +0000 Subject: [PATCH] Add CircleCI config.yml This is an alternative to the TravisCI build file. CircleCI can automatically collect build artifacts which is nice! --- .circleci/config.yml | 56 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..8cd85715 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,56 @@ +# Golang CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-go/ for more details +version: 2 +jobs: + build: + docker: + - image: circleci/golang:1.9 + + working_directory: /go/src/github.com/{{ORG_NAME}}/{{REPO_NAME}} + + steps: + - checkout + - run: + name: Create artifact upload directory + command: mkdir /tmp/upload + + - run: + name: Build for Linux (including Debian packages) + command: | + PKGARCH=amd64 sh contrib/deb/generate.sh && mv yggdrasil /tmp/upload/yggdrasil-linux-amd64; + PKGARCH=i386 sh contrib/deb/generate.sh && mv yggdrasil /tmp/upload/yggdrasil-linux-i386; + PKGARCH=mipsel sh contrib/deb/generate.sh && mv yggdrasil /tmp/upload/yggdrasil-linux-mipsel; + PKGARCH=mips sh contrib/deb/generate.sh && mv yggdrasil /tmp/upload/yggdrasil-linux-mips; + mv *.deb /tmp/upload/ + + - run: + name: Build for macOS + command: | + GOOS=darwin GOARCH=amd64 ./build && mv yggdrasil /tmp/upload/yggdrasil-darwin-amd64; + GOOS=darwin GOARCH=386 ./build && mv yggdrasil /tmp/upload/yggdrasil-darwin-i386; + + - run: + name: Build for OpenBSD + command: | + GOOS=openbsd GOARCH=amd64 ./build && mv yggdrasil /tmp/upload/yggdrasil-linux-amd64; + GOOS=openbsd GOARCH=386 ./build && mv yggdrasil /tmp/upload/yggdrasil-linux-i386; + + - run: + name: Build for Windows + command: | + GOOS=windows GOARCH=amd64 ./build && mv yggdrasil.exe /tmp/upload/yggdrasil-windows-amd64.exe; + GOOS=windows GOARCH=386 ./build && mv yggdrasil.exe /tmp/upload/yggdrasil-windows-i386.exe; + + - run: + name: Build for EdgeRouter + command: | + git clone https://github.com/neilalexander/vyatta-yggdrasil /tmp/vyatta-yggdrasil; + cd /tmp/vyatta-yggdrasil; + BUILDDIR_YGG=$CIRCLE_WORKING_DIRECTORY ./build-edgerouter-x $CIRCLE_BRANCH; + BUILDDIR_YGG=$CIRCLE_WORKING_DIRECTORY ./build-edgerouter-lite $CIRCLE_BRANCH; + mv *.deb /tmp/upload; + + - store_artifacts: + path: /tmp/upload + destination: /