|
@@ -18,7 +18,7 @@
|
|
|
# MAKEJOBS = number of compiler processes running in parallel (default: number of CPUs/Cores)
|
|
|
# PRIORITY = determines the number of day a rollout phase should last at most
|
|
|
# PUBLISH = 0 (default) or 1, publish firmware at the end
|
|
|
-# SITE_ID = specific site repository commit-id (leave blank to use HEAD)
|
|
|
+# SITE = site repository version (branch, tag or commit, default: '$BRANCH')
|
|
|
# TARGETS = a space separated list of target platforms (if unset, all platforms will be build)
|
|
|
# VERBOSE = 0 (default) or 1, call the make commands with 'V=s' to see actual errors better
|
|
|
# VERSIONS_DIR = specify directory for version files
|
|
@@ -69,6 +69,7 @@ fi
|
|
|
[ -n "${MAKEJOBS}" ] || MAKEJOBS=$(grep -c "^processor" /proc/cpuinfo)
|
|
|
[ -n "${PRIORITY}" ] || PRIORITY=0
|
|
|
[ -n "${PUBLISH}" ] || PUBLISH=0
|
|
|
+[ -n "${SITE}" ] || SITE=${BRANCH}
|
|
|
[ -n "${VERBOSE}" ] || VERBOSE=0
|
|
|
|
|
|
if [ -n "${VERSIONS_DIR}" ]; then
|
|
@@ -131,24 +132,16 @@ popd > /dev/null #${CODE_DIR}
|
|
|
### CHECKOUT SITE REPO
|
|
|
progress "Checking out SITE REPO ..."
|
|
|
pushd ${SITE_DIR} > /dev/null
|
|
|
-if [ $(git remote | wc -l) -ge "1" ]; then
|
|
|
- git fetch
|
|
|
- # TODO: check if site got modified locally and bail out if necessary
|
|
|
- if [ -z "${SITE_ID}" ]; then
|
|
|
- # no specific site given - get the most current one
|
|
|
- git checkout -q ${BRANCH}
|
|
|
- git branch -r | grep ${BRANCH} > /dev/null
|
|
|
- if [ "$?" -eq "0" ]; then
|
|
|
- git rebase
|
|
|
- [ "$?" -eq "0" ] || abort "Failed to get newest '${BRANCH}' in site repository, mimimi."
|
|
|
- fi
|
|
|
- else
|
|
|
- # fetch site repo updates
|
|
|
- git fetch || true
|
|
|
- # commit given - use this one
|
|
|
- git checkout -q ${SITE_ID}
|
|
|
- [ "$?" -eq "0" ] || abort "Failed to checkout requested site commit '${SITE_ID}', mimimi."
|
|
|
- fi
|
|
|
+# check if site repo got modified and bail out if necessary
|
|
|
+[ "$(git status --porcelain)" ] && abort "Local changes to site directory. Cowardly refusing to update repository." >&2
|
|
|
+git fetch
|
|
|
+git show-ref --verify --quiet refs/remotes/origin/${SITE}
|
|
|
+if [ "$?" -eq "0" ]; then
|
|
|
+ git checkout -B build origin/${SITE}
|
|
|
+ [ "$?" -eq "0" ] || abort "Failed to checkout site repo 'origin/${SITE}'."
|
|
|
+else
|
|
|
+ git checkout -q ${SITE}
|
|
|
+ [ "$?" -eq "0" ] || abort "Failed to checkout site repo '${SITE}'." >&2
|
|
|
fi
|
|
|
SITE_COMMIT=$(git rev-list --max-count=1 HEAD)
|
|
|
popd > /dev/null #${SITE_DIR}
|
|
@@ -187,7 +180,7 @@ touch $(dirname ${build_info_path})
|
|
|
echo "VERSION=${VERSION}" >> ${build_info_path}
|
|
|
echo "GLUON=${GLUON_COMMIT} # ${BASE}" >> ${build_info_path}
|
|
|
echo "BRANCH=${BRANCH}" >> ${build_info_path}
|
|
|
-echo "SITE=${SITE_COMMIT} # ${VERSION}" >> ${build_info_path}
|
|
|
+echo "SITE=${SITE_COMMIT} # ${SITE}" >> ${build_info_path}
|
|
|
echo "TARGETS='${TARGETS}'" >> ${build_info_path}
|
|
|
echo "TS=${BUILD_TS}" >> ${build_info_path}
|
|
|
|