From eed57cf4bbb8b1fa6c7e7de6944ae4ffaa901d6e Mon Sep 17 00:00:00 2001 From: Martin/Geno Date: Tue, 26 Feb 2019 12:11:03 +0100 Subject: [PATCH] init ci --- .ci/build_pkgs.sh | 34 ++++++++++++++++++++++++ .ci/download_sdk.sh | 8 ++++++ .ci/prepare_build_dir.sh | 22 ++++++++++++++++ .gitignore | 56 ++++++++++++++++++++++++++++++++++++++++ .gitlab-ci.yml | 22 ++++++++++++++++ README.md | 11 ++++++-- 6 files changed, 151 insertions(+), 2 deletions(-) create mode 100644 .ci/build_pkgs.sh create mode 100644 .ci/download_sdk.sh create mode 100644 .ci/prepare_build_dir.sh create mode 100644 .gitignore create mode 100644 .gitlab-ci.yml diff --git a/.ci/build_pkgs.sh b/.ci/build_pkgs.sh new file mode 100644 index 0000000..59813fc --- /dev/null +++ b/.ci/build_pkgs.sh @@ -0,0 +1,34 @@ +cd $CI_PROJECT_DIR/wireless/ +PKGS=$(ls) + +cd $CI_PROJECT_DIR/build_dir + +echo "=== Found new/modified packages: $PKGS" +for PKG in $PKGS ; do + echo "===+ Download: $PKG" + make "package/$PKG/download" V=s + + echo "===+ Check package: $PKG" + make "package/$PKG/check" V=s 2>&1 | tee logtmp + + if [ $RET -ne 0 ]; then + echo "=> 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 "=> Package HASH check failed" + exit 1 + fi + echo "=> Package check OK" +done + + + +for PKG in $PKGS ; do + echo "===+ Building: $PKG" + make "package/$PKG/compile" -j3 V=s +done \ No newline at end of file diff --git a/.ci/download_sdk.sh b/.ci/download_sdk.sh new file mode 100644 index 0000000..a63d35c --- /dev/null +++ b/.ci/download_sdk.sh @@ -0,0 +1,8 @@ +mkdir -p $CI_PROJECT_DIR/tmp +cd $CI_PROJECT_DIR/tmp + +curl "https://$SDK_HOST/$SDK_PATH/sha256sums" -sS -o sha256sums +curl "https://$SDK_HOST/$SDK_PATH/sha256sums.asc" -sS -o sha256sums.asc +gpg --with-fingerprint --verify sha256sums.asc sha256sums +rsync -av "$SDK_HOST::downloads/$SDK_PATH/$SDK_FILE" . +sha256sum -c --ignore-missing sha256sums \ No newline at end of file diff --git a/.ci/prepare_build_dir.sh b/.ci/prepare_build_dir.sh new file mode 100644 index 0000000..3eb129d --- /dev/null +++ b/.ci/prepare_build_dir.sh @@ -0,0 +1,22 @@ +mkdir -p $CI_PROJECT_DIR/build_dir +cd $CI_PROJECT_DIR/build_dir + +tar Jxf $CI_PROJECT_DIR/tmp/$SDK_FILE --strip=1 + +cat > feeds.conf < /dev/null +./scripts/feeds install -a > /dev/null + +make defconfig > /dev/null +sed -i 's/# CONFIG_BUILD_LOG is not set/CONFIG_BUILD_LOG=y/' .config \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2c1afc --- /dev/null +++ b/.gitignore @@ -0,0 +1,56 @@ +# Prerequisites +*.d + +# Object files +*.o +*.ko +*.obj +*.elf + +# Linker output +*.ilk +*.map +*.exp + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ +*.su +*.idb +*.pdb + +# Kernel Module Compile Results +*.mod* +*.cmd +.tmp_versions/ +modules.order +Module.symvers +Mkfile.old +dkms.conf + + +tmp/ +build_dir/ \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..4eb9532 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,22 @@ +image: openwrtorg/packages-cci + +variables: + SDK_HOST: "downloads.openwrt.org" + SDK_PATH: "snapshots/targets/ar71xx/generic" + SDK_FILE: "openwrt-sdk-ar71xx-generic_*.Linux-x86_64.tar.xz" + +stages: + - compile + +compile: + stage: compile + script: + - echo "==== Download the SDK ====" + - sh .ci/download_sdk.sh + - echo "==== Prepare build_dir ====" + - sh .ci/prepare_build_dir.sh + - echo "==== build packages ====" + - sh .ci/build_pkgs.sh + artifacts: + paths: + - build_dir/bin/packages \ No newline at end of file diff --git a/README.md b/README.md index 81e5cd0..a633f4f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Wifi control deamon packages feed +[![Build Status](https://dev.sum7.eu/genofire/wifictld/badges/master/build.svg)](https://dev.sum7.eu/genofire/wifictld/pipelines) + ## Description This is an OpenWrt package feed containing community @@ -12,7 +14,7 @@ feeds.conf in the OpenWrt buildroot: ``` -src-git wifictld git@dev.sum7.eu:wifictld/wifictld.git +src-git wifictld gitlab@dev.sum7.eu:wifictld/wifictld.git ``` This feed should be included and enabled by default in the @@ -24,5 +26,10 @@ run: ./scripts/feeds install -a -p wifictld ``` -The wifictld packages should now appear in menuconfig. +The wifictld packages should now appear in menuconfig under wireless. +## Snapshots / Download + +- [wifictld_1.0-1_mips_24kc.ipk](https://dev.sum7.eu/genofire/wifictld/-/jobs/artifacts/master/raw/build_dir/bin/packages/mips_24kc/wifictld/wifictld_1.0-1_mips_24kc.ipk?inline=false&job=compile) +- [wifictld-mini_1.0-1_mips_24kc.ipk](https://dev.sum7.eu/genofire/wifictld/-/jobs/artifacts/master/raw/build_dir/bin/packages/mips_24kc/wifictld/wifictld-mini_1.0-1_mips_24kc.ipk?inline=false&job=compile) +- [respondd-module-wifictld_1-1_mips_24kc.ipk](https://dev.sum7.eu/genofire/wifictld/-/jobs/artifacts/master/raw/build_dir/bin/packages/mips_24kc/wifictld/respondd-module-wifictld_1-1_mips_24kc.ipk?inline=false&job=compile) \ No newline at end of file