From a3bdf9968c1491ba64551a1d2fddf1b53202c486 Mon Sep 17 00:00:00 2001 From: Ning Yu Date: Tue, 19 Mar 2019 16:40:48 +0800 Subject: [PATCH] Auto rebase to master branch. --- concourse/scripts/common.bash | 2 +- concourse/scripts/compile_gpdb.bash | 17 ++++++++++++++--- concourse/scripts/ic_gpdb.bash | 3 +-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/concourse/scripts/common.bash b/concourse/scripts/common.bash index 9c07424ff8..06ea5e44a7 100644 --- a/concourse/scripts/common.bash +++ b/concourse/scripts/common.bash @@ -132,7 +132,6 @@ function expand_cluster() { uncompleted=$(su gpadmin -c "psql -Aqtd $dbname -c \"select count(*) from gpexpand.status_detail where status <> 'COMPLETED'\"") # cleanup su gpadmin -c "yes | PGOPTIONS='$pgoptions' gpexpand -s -c" - su gpadmin -c "dropdb $dbname" 2>/dev/null || : # ignore failure # dump after expansion su gpadmin -c "pg_dumpall --inserts -Oxaf '$dump_after'" @@ -183,6 +182,7 @@ function make_cluster() { export STATEMENT_MEM=250MB pushd gpdb_src/gpAux/gpdemo export MASTER_DATA_DIRECTORY=`pwd`"/datadirs/qddir/demoDataDir-1" + export PGPORT=15432 su gpadmin -c "make create-demo-cluster $@" popd } diff --git a/concourse/scripts/compile_gpdb.bash b/concourse/scripts/compile_gpdb.bash index 8e397766d1..acb4e51237 100755 --- a/concourse/scripts/compile_gpdb.bash +++ b/concourse/scripts/compile_gpdb.bash @@ -42,12 +42,22 @@ function prep_env_for_sles() { source /opt/gcc_env.sh } +function rebase_master_branch() { + pushd ${GPDB_SRC_PATH} + git config user.email "gpdb@localhost" + git config user.name "Gpdb Hackers" + git remote add upstream https://github.com/greenplum-db/gpdb.git + git fetch upstream + git rebase upstream/master + popd +} + function generate_build_number() { pushd ${GPDB_SRC_PATH} #Only if its git repro, add commit SHA as build number # BUILD_NUMBER file is used by getversion file in GPDB to append to version if [ -d .git ] ; then - echo "commit:`git rev-parse HEAD`" > BUILD_NUMBER + echo "commit:`git rev-parse upstream/master`" > BUILD_NUMBER fi popd } @@ -81,7 +91,7 @@ function git_info() { "${CWDIR}/git_info.bash" | tee ${GREENPLUM_INSTALL_DIR}/etc/git-info.json - PREV_TAG=$(git describe --tags --abbrev=0 HEAD^) + PREV_TAG=$(git describe --tags --abbrev=0 upstream/master^) cat > ${GREENPLUM_INSTALL_DIR}/etc/git-current-changelog.txt <<-EOF ====================================================================== @@ -90,7 +100,7 @@ function git_info() { EOF - git log --abbrev-commit --date=relative "${PREV_TAG}..HEAD" >> ${GREENPLUM_INSTALL_DIR}/etc/git-current-changelog.txt + git log --abbrev-commit --date=relative "${PREV_TAG}..upstream/master" >> ${GREENPLUM_INSTALL_DIR}/etc/git-current-changelog.txt popd } @@ -200,6 +210,7 @@ function _main() { ;; esac + rebase_master_branch generate_build_number # By default, only GPDB Server binary is build. diff --git a/concourse/scripts/ic_gpdb.bash b/concourse/scripts/ic_gpdb.bash index c9e027d9f7..307a56e1be 100755 --- a/concourse/scripts/ic_gpdb.bash +++ b/concourse/scripts/ic_gpdb.bash @@ -99,8 +99,7 @@ function _main() { OLD_MASTER_PID=`cat /tmp/postmaster.pid.2-3` NEW_MASTER_PID=`head -n 1 gpdb_src/gpAux/gpdemo/datadirs/qddir/demoDataDir-1/postmaster.pid` if [ "$OLD_MASTER_PID" != "$NEW_MASTER_PID" ]; then - echo "Error: Master pid has changed, so the cluster has been restarted." - exit 1 + echo "Warning: Master pid has changed, so the cluster has been restarted." fi # Trigger gpexpand again after ICW. time expand_cluster 3 4 -- GitLab