From 4404739668e94d1b7361dcd8db57794406b9a01d Mon Sep 17 00:00:00 2001 From: Ycarus Date: Wed, 21 Feb 2018 15:09:20 +0100 Subject: [PATCH] Test new build script --- build.sh | 24 ++++++++++++------------ circle.yml | 34 ++++++++++++++++------------------ 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/build.sh b/build.sh index 000cdf33..b0cb7836 100755 --- a/build.sh +++ b/build.sh @@ -32,7 +32,7 @@ if [ ! -f "$OMR_TARGET_CONFIG" ]; then fi #_get_repo source https://github.com/ysurac/openmptcprouter-source "master" -_get_repo source https://github.com/lede-project/source.git "lede-17.01" +_get_repo "$OMR_TARGET/source" https://github.com/lede-project/source.git "lede-17.01" _get_repo feeds/packages https://github.com/openwrt/packages "master" _get_repo feeds/luci https://github.com/openwrt/luci "lede-17.01" @@ -47,10 +47,10 @@ if [ -n "$1" ] && [ -f "$OMR_FEED/$1/Makefile" ]; then fi if [ "$OMR_KEEPBIN" = "no" ]; then - rm -rf source/bin + rm -rf "$OMR_TARGET/source/bin" fi -rm -rf source/files source/tmp -cp -rf root/* source +rm -rf "$OMR_TARGET/source/files" "$OMR_TARGET/source/tmp" +cp -rf root/* "$OMR_TARGET/source" cat >> source/package/base-files/files/etc/banner < source/.config < "$OMR_TARGET/source/.config" <> source/.config - echo 'CONFIG_VMDK_IMAGES=y' >> source/.config + echo 'CONFIG_VDI_IMAGES=y' >> "$OMR_TARGET/source/.config" + echo 'CONFIG_VMDK_IMAGES=y' >> "$OMR_TARGET/source/.config" fi echo "Building $OMR_DIST for the target $OMR_TARGET" -cd source +cd "$OMR_TARGET/source" if [ "$OMR_UEFI" = "yes" ] && [ "$OMR_TARGET" = "x86_64" ]; then - if ! patch -Rf -N -p1 -s --dry-run < ../patches/uefi.patch; then - patch -N -p1 -s < ../patches/uefi.patch + if ! patch -Rf -N -p1 -s --dry-run < ../../patches/uefi.patch; then + patch -N -p1 -s < ../../patches/uefi.patch fi else - if ! patch -Nf -p1 -s --dry-run < ../patches/uefi.patch; then - patch -N -R -p1 -s < ../patches/uefi.patch + if ! patch -Nf -p1 -s --dry-run < ../../patches/uefi.patch; then + patch -N -R -p1 -s < ../../patches/uefi.patch fi fi echo "Done" diff --git a/circle.yml b/circle.yml index b943b8c2..4396d85c 100644 --- a/circle.yml +++ b/circle.yml @@ -12,34 +12,30 @@ dependencies: OMR_TARGET: x86_64 OMR_KEEPBIN: yes timeout: 7200 + - sh build.sh package/{compile,install,preconfig,index} -j2 : + timeout: 7200 + environment: + OMR_TARGET: x86_64 + OMR_KEEPBIN: yes - sh build.sh prepare {tools,toolchain}/install -j2 : environment: OMR_TARGET: rpi3 OMR_KEEPBIN: yes timeout: 7200 + - sh build.sh package/{compile,install,preconfig,index} -j2 : + timeout: 7200 + environment: + OMR_TARGET: rpi3 + OMR_KEEPBIN: yes cache_directories: - "source" - "feeds" compile: override: - - sh build.sh package/{compile,install,preconfig,index} -j2 : + - make -C x86_64/source target/install -j2 : timeout: 7200 - environment: - OMR_TARGET: x86_64 - OMR_KEEPBIN: yes - - make -C source target/install -j2 : - timeout: 7200 - - sh build.sh package/{compile,install,preconfig,index} -j2 : - timeout: 7200 - environment: - OMR_TARGET: rpi3 - OMR_KEEPBIN: yes - - make -C source target/compile -j2 : - timeout: 7200 - - make -C source package/compile -j2 : - timeout: 7200 - - make -C source target/install -j2 : + - make -C rpi3/source target/install -j2 : timeout: 7200 test: @@ -51,9 +47,11 @@ deployment: branch: /.*/ commands: - ssh -p $OMR_DEPLOY_PORT deploy@$OMR_DEPLOY_HOST mkdir -p deploy/$OMR_PATH - - rsync -av --delete-after source/bin/ -e "ssh -q -p $OMR_DEPLOY_PORT" deploy@$OMR_DEPLOY_HOST:deploy/$OMR_PATH + - rsync -av --delete-after x86_64/source/bin/ -e "ssh -q -p $OMR_DEPLOY_PORT" deploy@$OMR_DEPLOY_HOST:deploy/dev/x86_64 + - rsync -av --delete-after rpi3/source/bin/ -e "ssh -q -p $OMR_DEPLOY_PORT" deploy@$OMR_DEPLOY_HOST:deploy/dev/rpi3 release: tag: /v[0-9]+(\.[0-9]+)*/ commands: - ssh -p $OMR_DEPLOY_PORT deploy@$OMR_DEPLOY_HOST mkdir -p deploy/release - - rsync -av --delete-after source/bin/ -e "ssh -q -p $OMR_DEPLOY_PORT" deploy@$OMR_DEPLOY_HOST:deploy/release + - rsync -av --delete-after x86_64/source/bin/ -e "ssh -q -p $OMR_DEPLOY_PORT" deploy@$OMR_DEPLOY_HOST:deploy/release/x86_64 + - rsync -av --delete-after rpi3/source/bin/ -e "ssh -q -p $OMR_DEPLOY_PORT" deploy@$OMR_DEPLOY_HOST:deploy/release/rpi3