catalyst-auto: move git update into main script
All of our config files are doing this already, so move it into the common code.
This commit is contained in:
parent
04b56eaab3
commit
a8e70e1976
|
@ -93,8 +93,7 @@ update_symlinks() {
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
# This is a skeleton function that you can override from the config file.
|
# This is a skeleton function that you can override from the config file.
|
||||||
# It will be executed before the build is started. You can use this to
|
# It will be executed before the build is started.
|
||||||
# update the checkout of the releng repo
|
|
||||||
:
|
:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,6 +183,31 @@ containerize() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Update the git repo if possible. It might modify this script which will probably
|
||||||
|
# make bash fail (since bash parses as it executes). So we have to safely re-exec
|
||||||
|
# the script whenever there's an update.
|
||||||
|
git_update() {
|
||||||
|
# If we've already relaunched, nothing to do.
|
||||||
|
if [[ ${GIT_UPDATE} == "true" ]] ; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
pushd "${REPO_DIR}" >/dev/null
|
||||||
|
git fetch -q
|
||||||
|
revs=$(git rev-list HEAD..FETCH_HEAD)
|
||||||
|
popd >/dev/null
|
||||||
|
if [[ -n ${revs} ]] ; then
|
||||||
|
GIT_UPDATE=true exec bash -c '
|
||||||
|
repo_dir=$1 script=$2
|
||||||
|
shift 2
|
||||||
|
pushd "${repo_dir}" >/dev/null
|
||||||
|
git merge FETCH_HEAD || echo "${script}: WARNING: git repo is dirty"
|
||||||
|
popd >/dev/null
|
||||||
|
exec "${script}" "$@"
|
||||||
|
' -- "${REPO_DIR}" "$0" "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
run_catalyst_commands() {
|
run_catalyst_commands() {
|
||||||
doneconfig=0
|
doneconfig=0
|
||||||
for config_file in "${config_files[@]}"; do
|
for config_file in "${config_files[@]}"; do
|
||||||
|
@ -393,6 +417,9 @@ main() {
|
||||||
# Parse user arguments before we try doing container logic.
|
# Parse user arguments before we try doing container logic.
|
||||||
parse_args "$@"
|
parse_args "$@"
|
||||||
|
|
||||||
|
# Update the release git dir if possible.
|
||||||
|
git_update "$@"
|
||||||
|
|
||||||
# Try to isolate ourselves from the rest of the system.
|
# Try to isolate ourselves from the rest of the system.
|
||||||
containerize "$@"
|
containerize "$@"
|
||||||
|
|
||||||
|
|
|
@ -24,9 +24,6 @@ give_latest_from_dates() {
|
||||||
|
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
cd ${REPO_DIR}
|
|
||||||
git pull
|
|
||||||
|
|
||||||
# Symlink the latest stages3 to build from
|
# Symlink the latest stages3 to build from
|
||||||
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
||||||
pushd $d >/dev/null
|
pushd $d >/dev/null
|
||||||
|
|
|
@ -72,9 +72,6 @@ update_symlinks() {
|
||||||
}
|
}
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
pushd ${REPO_DIR} >/dev/null
|
|
||||||
git pull
|
|
||||||
popd >/dev/null
|
|
||||||
update_symlinks
|
update_symlinks
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,9 +76,6 @@ update_symlinks() {
|
||||||
}
|
}
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
pushd ${REPO_DIR} >/dev/null
|
|
||||||
git pull
|
|
||||||
popd >/dev/null
|
|
||||||
update_symlinks
|
update_symlinks
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,9 +27,6 @@ give_latest_from_dates() {
|
||||||
|
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
cd ${REPO_DIR}
|
|
||||||
git pull
|
|
||||||
|
|
||||||
# Symlink the latest stages3 to build from
|
# Symlink the latest stages3 to build from
|
||||||
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
||||||
pushd $d
|
pushd $d
|
||||||
|
|
|
@ -27,9 +27,6 @@ give_latest_from_dates() {
|
||||||
|
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
cd ${REPO_DIR}
|
|
||||||
git pull
|
|
||||||
|
|
||||||
# Symlink the latest stages3 to build from
|
# Symlink the latest stages3 to build from
|
||||||
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
||||||
pushd $d >/dev/null
|
pushd $d >/dev/null
|
||||||
|
|
|
@ -27,9 +27,6 @@ give_latest_from_dates() {
|
||||||
|
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
cd ${REPO_DIR}
|
|
||||||
git pull
|
|
||||||
|
|
||||||
# Symlink the latest stages3 to build from
|
# Symlink the latest stages3 to build from
|
||||||
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
||||||
pushd $d >/dev/null
|
pushd $d >/dev/null
|
||||||
|
|
|
@ -27,9 +27,6 @@ give_latest_from_dates() {
|
||||||
|
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
cd ${REPO_DIR}
|
|
||||||
git pull
|
|
||||||
|
|
||||||
# Symlink the latest stages3 to build from
|
# Symlink the latest stages3 to build from
|
||||||
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
||||||
pushd $d >/dev/null
|
pushd $d >/dev/null
|
||||||
|
|
|
@ -27,9 +27,6 @@ give_latest_from_dates() {
|
||||||
|
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
cd ${REPO_DIR}
|
|
||||||
git pull
|
|
||||||
|
|
||||||
# Symlink the latest stages3 to build from
|
# Symlink the latest stages3 to build from
|
||||||
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
||||||
pushd $d >/dev/null
|
pushd $d >/dev/null
|
||||||
|
|
|
@ -27,9 +27,6 @@ give_latest_from_dates() {
|
||||||
|
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
cd ${REPO_DIR}
|
|
||||||
git pull
|
|
||||||
|
|
||||||
# Symlink the latest stages3 to build from
|
# Symlink the latest stages3 to build from
|
||||||
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
||||||
pushd $d >/dev/null
|
pushd $d >/dev/null
|
||||||
|
|
|
@ -27,9 +27,6 @@ give_latest_from_dates() {
|
||||||
|
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
cd ${REPO_DIR}
|
|
||||||
git pull
|
|
||||||
|
|
||||||
# Symlink the latest stages3 to build from
|
# Symlink the latest stages3 to build from
|
||||||
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
||||||
pushd $d >/dev/null
|
pushd $d >/dev/null
|
||||||
|
|
|
@ -29,9 +29,6 @@ give_latest_from_dates() {
|
||||||
|
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
cd ${REPO_DIR}
|
|
||||||
git pull
|
|
||||||
|
|
||||||
# Symlink the latest stages3 to build from
|
# Symlink the latest stages3 to build from
|
||||||
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
||||||
pushd $d >/dev/null
|
pushd $d >/dev/null
|
||||||
|
|
|
@ -24,9 +24,6 @@ give_latest_from_dates() {
|
||||||
|
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
cd ${REPO_DIR}
|
|
||||||
git pull
|
|
||||||
|
|
||||||
# Symlink the latest stages3 to build from
|
# Symlink the latest stages3 to build from
|
||||||
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
||||||
pushd $d >/dev/null
|
pushd $d >/dev/null
|
||||||
|
|
|
@ -25,9 +25,6 @@ give_latest_from_dates() {
|
||||||
}
|
}
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
cd ${REPO_DIR}
|
|
||||||
git pull
|
|
||||||
|
|
||||||
# Symlink the latest stages3 to build from
|
# Symlink the latest stages3 to build from
|
||||||
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
||||||
pushd $d >/dev/null
|
pushd $d >/dev/null
|
||||||
|
|
|
@ -27,9 +27,6 @@ give_latest_from_dates() {
|
||||||
|
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
cd ${REPO_DIR}
|
|
||||||
git pull
|
|
||||||
|
|
||||||
# Symlink the latest stages3 to build from
|
# Symlink the latest stages3 to build from
|
||||||
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
||||||
pushd $d >/dev/null
|
pushd $d >/dev/null
|
||||||
|
|
|
@ -24,9 +24,6 @@ give_latest_from_dates() {
|
||||||
|
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
cd ${REPO_DIR}
|
|
||||||
git pull
|
|
||||||
|
|
||||||
# Symlink the latest stages3 to build from
|
# Symlink the latest stages3 to build from
|
||||||
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
||||||
pushd $d >/dev/null
|
pushd $d >/dev/null
|
||||||
|
|
|
@ -24,9 +24,6 @@ give_latest_from_dates() {
|
||||||
|
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
cd ${REPO_DIR}
|
|
||||||
git pull
|
|
||||||
|
|
||||||
# Symlink the latest stages3 to build from
|
# Symlink the latest stages3 to build from
|
||||||
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do
|
||||||
pushd $d >/dev/null
|
pushd $d >/dev/null
|
||||||
|
|
|
@ -24,9 +24,6 @@ give_latest_from_dates() {
|
||||||
|
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
cd ${REPO_DIR}
|
|
||||||
git pull
|
|
||||||
|
|
||||||
# Symlink the latest stages3 to build from
|
# Symlink the latest stages3 to build from
|
||||||
for d in ${BUILD_SRCDIR_BASE}/builds/{default,multilib} ; do
|
for d in ${BUILD_SRCDIR_BASE}/builds/{default,multilib} ; do
|
||||||
pushd $d >/dev/null
|
pushd $d >/dev/null
|
||||||
|
|
|
@ -38,10 +38,6 @@ give_latest_from_dates() {
|
||||||
}
|
}
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
pushd ${REPO_DIR} >/dev/null
|
|
||||||
git pull
|
|
||||||
popd >/dev/null
|
|
||||||
|
|
||||||
# Symlink the latest stages3 to build from
|
# Symlink the latest stages3 to build from
|
||||||
for d in ${BUILD_SRCDIR_BASE}/{default,hardened} ; do
|
for d in ${BUILD_SRCDIR_BASE}/{default,hardened} ; do
|
||||||
pushd $d >/dev/null
|
pushd $d >/dev/null
|
||||||
|
|
|
@ -38,10 +38,6 @@ give_latest_from_dates() {
|
||||||
}
|
}
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
pushd ${REPO_DIR} >/dev/null
|
|
||||||
git pull
|
|
||||||
popd >/dev/null
|
|
||||||
|
|
||||||
# Symlink the latest stages3 to build from
|
# Symlink the latest stages3 to build from
|
||||||
for d in ${BUILD_SRCDIR_BASE}/{default,hardened} ; do
|
for d in ${BUILD_SRCDIR_BASE}/{default,hardened} ; do
|
||||||
pushd $d >/dev/null
|
pushd $d >/dev/null
|
||||||
|
|
Loading…
Reference in a new issue