1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-14 19:41:51 +00:00
openmptcprouter-feeds/.circleci/config.yml

66 lines
2 KiB
YAML
Raw Normal View History

2018-02-22 22:06:07 +00:00
version: 2
jobs:
build:
machine: true
timezone: Europe/Paris
environment:
2018-02-22 22:27:59 +00:00
- OMR_VERSION: $CIRCLE_TAG
2018-02-22 22:06:07 +00:00
- OMR_TARGET: x86_64
2018-02-22 22:27:59 +00:00
- OMR_IMG: yes
2018-02-22 22:06:07 +00:00
working_directory: ~/
steps:
- run:
name: Prepare
command: |
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
echo "cache 1 $OMR_TARGET" > /tmp/cache-target
echo "cache 4 $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
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
- save_cache:
key: cache-{{ checksum "/tmp/cache-target" }}
paths:
- openmptcprouter
- run:
name: Build
no_output_timeout: 30m
2018-02-22 22:11:57 +00:00
command: make -C ~/openmptcprouter/source/$OMR_TARGET package/{compile,install,index} target/install -j2
2018-02-22 22:06:07 +00:00
- run:
name: Deploy
command: |
ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/release
2018-02-22 22:11:57 +00:00
rsync -av --delete-after ~/openmptcprouter/x86_64/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/release/x86_64
2018-02-22 22:06:07 +00:00
rm -rf ~/openmptcprouter/source/bin
- save_cache:
key: cache-{{ checksum "/tmp/cache-version" }}
paths:
- openmptcprouter
2018-02-22 22:27:59 +00:00
workflows:
version: 2
main:
jobs:
- build