]> git.ipfire.org Git - people/ms/nightly-builds.git/commitdiff
build.sh: Drop support for multiple targets
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 27 Apr 2020 15:09:16 +0000 (15:09 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 27 Apr 2020 15:09:16 +0000 (15:09 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
build.sh

index db8b738c59aaaedb4340fd78d06cf67b8366ba70..44a9d2181765872fcb210c51fe4dc8a03b631dc6 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -108,7 +108,7 @@ build() {
 
        # Search for the latest core branch
        if [ "${branch}" = "core" ]; then
-               branch=$(git branch -r | awk -F/ '{ print $NF }' | grep ^core | sort --version-sort | tail -n1)
+               branch="$(git branch -r | awk -F/ '{ print $NF }' | grep ^core | sort --version-sort | tail -n1)"
        fi
 
        local commit_new="$(git rev-parse origin/${branch})"
@@ -128,52 +128,53 @@ build() {
 
        local now="$(git log --format="%ci" -1 "${commit_new}")"
 
-       local targets="$(git config build.targets)"
-       [ -z "${targets}" ] && targets="i586"
-
-       local target
-       for target in ${targets}; do
-               local build_path="${UPLOAD_DIR}/${branch}/${now}-${commit_new:0:8}"
-               local build="${build_path}/${target}"
-               local status="failed"
-
-               # Ready for build: Download toolchain and sources
-               for action in clean gettoolchain downloadsrc; do
-                       if ! ./make.sh --target="${target}" "${action}"; then
-                               touch "${dir}/.force-build"
-                               continue
-                       fi
-               done
-
-               # Execute the build
-               mkdir -p "${build}"
-               ./make.sh --target="${target}" build | tee "${build}/build.log"
-               local ret=${PIPESTATUS[0]}
-
-               # Save the changelog
-               git log -50 > "${build}/changelog.txt"
-
-               # Save the result
-               if [ "${ret}" = "0" ]; then
-                       status="success"
-                       touch "${build}/.success"
-
-                       # Copy images
-                       mv -v *.iso *.img.gz *.img.xz *.tar.bz2 *.md5 packages/ "${build}"
-                       extract_installer_from_iso "${build}"
-               fi
-               mv -v log/ "${build}"
+       local target="$(git config build.target)"
+       [ -z "${target}" ] && target="$(uname -m)"
 
-               # Upload the result
-               sync
+       local build_path="${UPLOAD_DIR}/${branch}/${now}-${commit_new:0:8}"
+       local build="${build_path}/${target}"
+       local status="failed"
 
-               # Send an email notification
-               send_email "${status}" "${target}" "${branch}" "${commit_new}" "${build}"
+       # Remove marker
+       unlink "${dir}/.force-build"
 
-               # Cleanup the build environment
-               ./make.sh --target="${target}" clean
+       # Ready for build: Download toolchain and sources
+       local action
+       for action in clean gettoolchain downloadsrc; do
+               if ! ./make.sh --target="${target}" "${action}"; then
+                       touch "${dir}/.force-build"
+                       continue
+               fi
        done
 
+       # Execute the build
+       mkdir -p "${build}"
+       ./make.sh --target="${target}" build | tee "${build}/build.log"
+       local ret=${PIPESTATUS[0]}
+
+       # Save the changelog
+       git log -50 > "${build}/changelog.txt"
+
+       # Save the result
+       if [ "${ret}" = "0" ]; then
+               status="success"
+               touch "${build}/.success"
+
+               # Copy images
+               mv -v *.iso *.img.gz *.img.xz *.tar.bz2 *.md5 packages/ "${build}"
+               extract_installer_from_iso "${build}"
+       fi
+       mv -v log/ "${build}"
+
+       # Upload the result
+       sync
+
+       # Send an email notification
+       send_email "${status}" "${target}" "${branch}" "${commit_new}" "${build}"
+
+       # Cleanup the build environment
+       ./make.sh --target="${target}" clean
+
        popd
 }