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_path
="${UPLOAD_DIR}/${branch}/${now}-${commit_new:0:8}"
60 local build
="${build_path}/${target}"
63 .
/make.sh
--target="${target}" clean
65 # Download the toolchain if required
66 .
/make.sh
--target="${target}" gettoolchain ||
continue
68 # Download all sources
69 .
/make.sh
--target="${target}" downloadsrc ||
continue
73 .
/make.sh
--target="${target}" build |
tee "${build}/build.log"
74 local ret
=${PIPESTATUS[0]}
77 if [ "${ret}" = "0" ]; then
78 mv -v *.iso
*.img.gz
*.
tar.bz2
*.md5 packages
/ "${build}"
79 extract_installer_from_iso
"${build}"
80 touch "${build}/.success"
88 .
/make.sh
--target="${target}" clean
89 rm -rf "${build_path}"
96 mkdir
-p "${UPLOAD_DIR}"
98 rsync
-avHz --progress ${RSYNC_ARGS} \
99 "${UPLOAD_DIR}/" "${UPLOAD_TO}"
102 for repo
in $
(find ${BASEDIR} -maxdepth 2 -type d
-name ".git"); do
103 [ -d "${repo}" ] ||
continue
105 build
"$(dirname ${repo})"