3 BASEDIR
="/build/nightly"
5 UPLOAD_DIR
="${BASEDIR}/upload"
6 UPLOAD_TO
="pakfire@git.ipfire.org:/pub/nightly"
7 RSYNC_ARGS
="--bwlimit=1M"
9 export MAKETUNING
="-j2"
11 extract_installer_from_iso
() {
14 local tmpdir
="$(mktemp -d)"
15 mkdir
-p "${dir}/images"
18 for file in ${dir}/*.iso
; do
19 if mount
-o loop
,ro
"${file}" "${tmpdir}"; then
21 for f
in vmlinuz instroot
; do
22 cp -f "${tmpdir}/boot/isolinux/${f}" "${dir}/images"
38 local branch
="$(git config build.branch)"
39 [ -z "${branch}" ] && branch
="master"
41 local commit_old
="$(git rev-parse HEAD)"
44 # If the branch was not updated, we won't build
45 local commit_new
="$(git rev-parse origin/${branch})"
46 [ "${commit_old}" = "${commit_new}" ] && return 2
48 # Checkout the latest commit
49 git
reset --hard "${commit_new}"
51 #local now="$(date -u +"%Y-%m-%d-%H:%M")"
52 local now
="$(git log --format="%cI
" -1 "${commit_new}")"
54 local targets
="$(git config build.targets)"
55 [ -z "${targets}" ] && targets
="i586"
58 for target
in ${targets}; do
59 local build
="${UPLOAD_DIR}/${branch}/${now}-${commit_new:0:8}/${target}"
62 .
/make.sh
--target="${target}" clean
64 # Download the toolchain if required
65 .
/make.sh
--target="${target}" gettoolchain ||
continue
67 # Download all sources
68 .
/make.sh
--target="${target}" downloadsrc ||
continue
72 .
/make.sh
--target="${target}" build |
tee "${build}/build.log"
73 local ret
=${PIPESTATUS[0]}
76 if [ "${ret}" = "0" ]; then
77 mv -v *.iso
*.img.gz
*.
tar.bz2
*.md5 packages
/ "${build}"
78 extract_installer_from_iso
"${build}"
79 touch "${build}/.success"
87 .
/make.sh
--target="${target}" clean
88 rm -rf "$(dirname "${build}")"
95 mkdir
-p "${UPLOAD_DIR}"
97 rsync
-avHz --progress ${RSYNC_ARGS} \
98 "${UPLOAD_DIR}/" "${UPLOAD_TO}"
101 for repo
in $
(find ${BASEDIR} -maxdepth 2 -type d
-name ".git"); do
102 [ -d "${repo}" ] ||
continue
104 build
"$(dirname ${repo})"