2018-03-02 22:13:20 +03:00
|
|
|
# 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:
|
2018-03-04 04:29:00 +03:00
|
|
|
name: Create artifact upload directory and set variables
|
|
|
|
command: |
|
|
|
|
mkdir /tmp/upload
|
2018-03-04 14:09:17 +03:00
|
|
|
echo 'export CIBUILD=$(cat VERSION).$(git rev-list HEAD --count | xargs printf "%04d")' >> $BASH_ENV
|
2018-03-04 04:29:00 +03:00
|
|
|
echo 'export CIBRANCH=$(git name-rev --name-only HEAD)' >> $BASH_ENV
|
|
|
|
echo '[ "$CIBRANCH" != "master" ] && export CIVERSION=$CIBRANCH-$CIBUILD || export CIVERSION=$CIBUILD' >> $BASH_ENV
|
2018-03-02 22:13:20 +03:00
|
|
|
|
|
|
|
- run:
|
|
|
|
name: Build for Linux (including Debian packages)
|
|
|
|
command: |
|
2018-03-04 04:29:00 +03:00
|
|
|
PKGARCH=amd64 sh contrib/deb/generate.sh && mv yggdrasil /tmp/upload/yggdrasil-$CIVERSION-linux-amd64;
|
|
|
|
PKGARCH=i386 sh contrib/deb/generate.sh && mv yggdrasil /tmp/upload/yggdrasil-$CIVERSION-linux-i386;
|
|
|
|
PKGARCH=mipsel sh contrib/deb/generate.sh && mv yggdrasil /tmp/upload/yggdrasil-$CIVERSION-linux-mipsel;
|
|
|
|
PKGARCH=mips sh contrib/deb/generate.sh && mv yggdrasil /tmp/upload/yggdrasil-$CIVERSION-linux-mips;
|
2018-03-02 22:13:20 +03:00
|
|
|
mv *.deb /tmp/upload/
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: Build for macOS
|
|
|
|
command: |
|
2018-03-04 04:29:00 +03:00
|
|
|
GOOS=darwin GOARCH=amd64 ./build && mv yggdrasil /tmp/upload/yggdrasil-$CIVERSION-darwin-amd64;
|
|
|
|
GOOS=darwin GOARCH=386 ./build && mv yggdrasil /tmp/upload/yggdrasil-$CIVERSION-darwin-i386;
|
2018-03-02 22:13:20 +03:00
|
|
|
|
|
|
|
- run:
|
|
|
|
name: Build for OpenBSD
|
|
|
|
command: |
|
2018-03-04 04:29:00 +03:00
|
|
|
GOOS=openbsd GOARCH=amd64 ./build && mv yggdrasil /tmp/upload/yggdrasil-$CIVERSION-linux-amd64;
|
|
|
|
GOOS=openbsd GOARCH=386 ./build && mv yggdrasil /tmp/upload/yggdrasil-$CIVERSION-linux-i386;
|
2018-03-02 22:13:20 +03:00
|
|
|
|
|
|
|
- run:
|
|
|
|
name: Build for Windows
|
|
|
|
command: |
|
2018-03-04 04:29:00 +03:00
|
|
|
GOOS=windows GOARCH=amd64 ./build && mv yggdrasil.exe /tmp/upload/yggdrasil-$CIVERSION-windows-amd64.exe;
|
|
|
|
GOOS=windows GOARCH=386 ./build && mv yggdrasil.exe /tmp/upload/yggdrasil-$CIVERSION-windows-i386.exe;
|
2018-03-02 22:13:20 +03:00
|
|
|
|
|
|
|
- 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: /
|