From 60b29b17bf17506cd6d4c4daa9a4a3fec8d38174 Mon Sep 17 00:00:00 2001 From: Ycarus Date: Wed, 23 May 2018 10:56:36 +0200 Subject: [PATCH] Generate x86 image --- .circleci/config.yml | 63 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 117452f5a..7561d4209 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,7 @@ jobs: sudo apt-get update sudo apt-get install -yq build-essential git unzip ncurses-dev libz-dev libssl-dev python subversion gettext gawk wget curl rsync perl - build_x86: + build_x86_64: machine: true timezone: Europe/Paris @@ -71,6 +71,64 @@ jobs: paths: - openmptcprouter + build_x86: + machine: true + timezone: Europe/Paris + + environment: + - OMR_VERSION: $CIRCLE_TAG + - OMR_TARGET: x86 + + working_directory: ~/ + + steps: + - run: + name: cache + command: | + echo "cache 5 $OMR_TARGET" > /tmp/cache-target + echo "cache 9 $OMR_TARGET $OMR_VERSION" > /tmp/cache-version + + - restore_cache: + keys: + - cache-{{ checksum "/tmp/cache-version" }} + - cache-{{ checksum "/tmp/cache-target" }} + + - run: + name: Build toolchain + no_output_timeout: 30m + command: | + git clone https://github.com/ysurac/openmptcprouter || true + cd openmptcprouter + git pull || true + export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" + export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" + export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" + sh build.sh prepare {tools,toolchain}/install -j2 + echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build + echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub + + - save_cache: + key: cache-{{ checksum "/tmp/cache-target" }} + paths: + - openmptcprouter + + - run: + name: Build + no_output_timeout: 30m + command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/install -j2 + + - run: + name: Deploy + command: | + ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/release + rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/release/$OMR_TARGET + rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin + + - save_cache: + key: cache-{{ checksum "/tmp/cache-version" }} + paths: + - openmptcprouter + build_rpi3: machine: true timezone: Europe/Paris @@ -192,6 +250,9 @@ workflows: main: jobs: - prepare + - build_x86_64: + requires: + - prepare - build_x86: requires: - prepare