CircleCI: [18.06] branch specific version.
Add package checks and HASH verify from Travis. Fix build log generation. Signed-off-by: Ted Hess <thess@kitschensync.net>
This commit is contained in:
parent
c95a1d3da8
commit
3e4fae2465
|
@ -2,7 +2,7 @@ version: 2.0
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
docker:
|
docker:
|
||||||
- image: docker.io/champtar/openwrtpackagesci@sha256:96ef72edc70cba371ea5676fba15ee25b3a94f538f648a27454b699edce61da0
|
- image: docker.io/openwrtorg/packages-cci:v1.0.1
|
||||||
environment:
|
environment:
|
||||||
- SDK_BASE_URL: "https://downloads.openwrt.org/releases/18.06.1/targets/ar71xx/generic"
|
- SDK_BASE_URL: "https://downloads.openwrt.org/releases/18.06.1/targets/ar71xx/generic"
|
||||||
- SDK_FILE: "openwrt-sdk-18.06.1-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64.tar.xz"
|
- SDK_FILE: "openwrt-sdk-18.06.1-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64.tar.xz"
|
||||||
|
@ -69,8 +69,8 @@ jobs:
|
||||||
sha256sum -c --ignore-missing sha256sums
|
sha256sum -c --ignore-missing sha256sums
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Prepare build_dir
|
name: Prepare work_dir
|
||||||
working_directory: ~/build_dir
|
working_directory: ~/work_dir
|
||||||
command: |
|
command: |
|
||||||
tar Jxf ~/sdk/$SDK_FILE --strip=1
|
tar Jxf ~/sdk/$SDK_FILE --strip=1
|
||||||
cat > feeds.conf <<EOF
|
cat > feeds.conf <<EOF
|
||||||
|
@ -79,16 +79,17 @@ jobs:
|
||||||
src-git luci https://github.com/openwrt/luci.git;$BRANCH
|
src-git luci https://github.com/openwrt/luci.git;$BRANCH
|
||||||
EOF
|
EOF
|
||||||
cat feeds.conf
|
cat feeds.conf
|
||||||
# enable BUILD_LOG
|
|
||||||
sed -i '1s/^/config BUILD_LOG\n\tbool\n\tdefault y\n\n/' Config-build.in
|
|
||||||
./scripts/feeds update -a > /dev/null
|
./scripts/feeds update -a > /dev/null
|
||||||
./scripts/feeds install -a > /dev/null
|
./scripts/feeds install -a > /dev/null
|
||||||
make defconfig > /dev/null
|
make defconfig > /dev/null
|
||||||
|
# enable BUILD_LOG
|
||||||
|
sed -i 's/# CONFIG_BUILD_LOG is not set/CONFIG_BUILD_LOG=y/' .config
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Download source/check/compile
|
name: Download source, check package, compile
|
||||||
working_directory: ~/build_dir
|
working_directory: ~/work_dir
|
||||||
command: |
|
command: |
|
||||||
|
set +o pipefail
|
||||||
PKGS=$(cd ~/openwrt_packages; git diff --diff-filter=d --name-only "origin/$BRANCH..." | grep 'Makefile$' | grep -v '/files/' | awk -F/ '{ print $(NF-1) }')
|
PKGS=$(cd ~/openwrt_packages; git diff --diff-filter=d --name-only "origin/$BRANCH..." | grep 'Makefile$' | grep -v '/files/' | awk -F/ '{ print $(NF-1) }')
|
||||||
if [ -z "$PKGS" ] ; then
|
if [ -z "$PKGS" ] ; then
|
||||||
echo_blue "WARNING: No new or modified packages found!"
|
echo_blue "WARNING: No new or modified packages found!"
|
||||||
|
@ -97,9 +98,26 @@ jobs:
|
||||||
|
|
||||||
echo_blue "=== Found new/modified packages: $PKGS"
|
echo_blue "=== Found new/modified packages: $PKGS"
|
||||||
for PKG in $PKGS ; do
|
for PKG in $PKGS ; do
|
||||||
echo_blue "===+ Download/check: $PKG"
|
echo_blue "===+ Download: $PKG"
|
||||||
make "package/$PKG/download" V=s
|
make "package/$PKG/download" V=s
|
||||||
make "package/$PKG/check" V=s
|
|
||||||
|
echo_blue "===+ Check package: $PKG"
|
||||||
|
make "package/$PKG/check" V=s 2>&1 | tee logtmp
|
||||||
|
RET=${PIPESTATUS[0]}
|
||||||
|
|
||||||
|
if [ $RET -ne 0 ]; then
|
||||||
|
echo_red "=> Package check failed: $RET)"
|
||||||
|
exit $RET
|
||||||
|
fi
|
||||||
|
|
||||||
|
badhash_msg="HASH does not match "
|
||||||
|
badhash_msg+="|HASH uses deprecated hash,"
|
||||||
|
badhash_msg+="|HASH is missing,"
|
||||||
|
if grep -qE "$badhash_msg" logtmp; then
|
||||||
|
echo_red "=> Package HASH check failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo_green "=> Package check OK"
|
||||||
done
|
done
|
||||||
|
|
||||||
for PKG in $PKGS ; do
|
for PKG in $PKGS ; do
|
||||||
|
@ -108,10 +126,10 @@ jobs:
|
||||||
done
|
done
|
||||||
|
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: ~/build_dir/logs
|
path: ~/work_dir/logs
|
||||||
|
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: ~/build_dir/bin
|
path: ~/work_dir/bin
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
|
|
Loading…
Reference in New Issue