5 - image: docker.io/openwrtorg/packages-cci:v1.0.1
7 - SDK_BASE_URL: "https://downloads.openwrt.org/snapshots/targets/ar71xx/generic"
8 - SDK_FILE: "openwrt-sdk-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64.tar.xz"
12 path: ~/openwrt_packages
15 name: Check changes / verify commits
16 working_directory: ~/openwrt_packages
18 cat >> $BASH_ENV <<EOF
19 echo_red() { printf "\033[1;31m\$*\033[m\n"; }
20 echo_green() { printf "\033[1;32m\$*\033[m\n"; }
21 echo_blue() { printf "\033[1;34m\$*\033[m\n"; }
26 for commit in $(git rev-list HEAD ^origin/$BRANCH); do
27 echo_blue "=== Checking commit '$commit'"
28 if git show --format='%P' -s $commit | grep -qF ' '; then
29 echo_red "Pull request should not include merge commits"
33 author="$(git show -s --format=%aN $commit)"
34 if echo $author | grep -q '\S\+\s\+\S\+'; then
35 echo_green "Author name ($author) seems ok"
37 echo_red "Author name ($author) need to be your real name 'firstname lastname'"
41 subject="$(git show -s --format=%s $commit)"
42 if echo "$subject" | grep -q -e '^[0-9A-Za-z,+/_-]\+: ' -e '^Revert '; then
43 echo_green "Commit subject line seems ok ($subject)"
45 echo_red "Commit subject line MUST start with '<package name>: ' ($subject)"
49 body="$(git show -s --format=%b $commit)"
50 sob="$(git show -s --format='Signed-off-by: %aN <%aE>' $commit)"
51 if echo "$body" | grep -qF "$sob"; then
52 echo_green "Signed-off-by match author"
54 echo_red "Signed-off-by is missing or doesn't match author (should be '$sob')"
62 name: Download the SDK
63 working_directory: ~/sdk
65 curl "$SDK_BASE_URL/sha256sums" -sS -o sha256sums
66 curl "$SDK_BASE_URL/sha256sums.asc" -sS -o sha256sums.asc
67 gpg --with-fingerprint --verify sha256sums.asc sha256sums
68 curl "$SDK_BASE_URL/$SDK_FILE" -sS -o "$SDK_FILE"
69 sha256sum -c --ignore-missing sha256sums
72 name: Prepare build_dir
73 working_directory: ~/build_dir
75 tar Jxf ~/sdk/$SDK_FILE --strip=1
76 cat > feeds.conf <<EOF
77 src-git base https://github.com/openwrt/openwrt.git;$BRANCH
78 src-link packages $HOME/openwrt_packages
79 src-git luci https://github.com/openwrt/luci.git;$BRANCH
82 ./scripts/feeds update -a > /dev/null
83 ./scripts/feeds install -a > /dev/null
84 make defconfig > /dev/null
86 sed -i 's/# CONFIG_BUILD_LOG is not set/CONFIG_BUILD_LOG=y/' .config
89 name: Download source, check package, compile
90 working_directory: ~/build_dir
93 PKGS=$(cd ~/openwrt_packages; git diff --diff-filter=d --name-only "origin/$BRANCH..." | grep 'Makefile$' | grep -v '/files/' | awk -F/ '{ print $(NF-1) }')
94 if [ -z "$PKGS" ] ; then
95 echo_blue "WARNING: No new or modified packages found!"
99 echo_blue "=== Found new/modified packages: $PKGS"
100 for PKG in $PKGS ; do
101 echo_blue "===+ Download: $PKG"
102 make "package/$PKG/download" V=s
104 echo_blue "===+ Check package: $PKG"
105 make "package/$PKG/check" V=s 2>&1 | tee logtmp
108 if [ $RET -ne 0 ]; then
109 echo_red "=> Package check failed: $RET)"
113 badhash_msg="HASH does not match "
114 badhash_msg+="|HASH uses deprecated hash,"
115 badhash_msg+="|HASH is missing,"
116 if grep -qE "$badhash_msg" logtmp; then
117 echo_red "=> Package HASH check failed"
120 echo_green "=> Package check OK"
123 for PKG in $PKGS ; do
124 echo_blue "===+ Building: $PKG"
125 make "package/$PKG/compile" -j3 V=s
129 path: ~/build_dir/logs
132 path: ~/build_dir/bin