summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAapo Keskimolo <aapo.keskimolo@qt.io>2019-02-26 20:58:55 +0000
committerAapo Keskimolo <aapo.keskimolo@qt.io>2019-03-11 11:36:59 +0000
commit23d755c8d06f8bc6d85db7ac3a5fe1ddfa421a9d (patch)
tree8bbd7587430e3536bd0414215be15511b7b36649
parent1cbb514e1aee59841fd05abcb40691c218d111c4 (diff)
Clean up baseline creation scripts
Change-Id: I8fb4f9cf61bac9afc3861572a8b0c55ad2e7b492 Reviewed-by: Aapo Keskimolo <aapo.keskimolo@qt.io>
-rwxr-xr-xscripts/coin/create_baseline/create_baseline.sh71
-rwxr-xr-xscripts/coin/create_baseline/test_baseline.sh21
2 files changed, 25 insertions, 67 deletions
diff --git a/scripts/coin/create_baseline/create_baseline.sh b/scripts/coin/create_baseline/create_baseline.sh
index 1194d063..035890eb 100755
--- a/scripts/coin/create_baseline/create_baseline.sh
+++ b/scripts/coin/create_baseline/create_baseline.sh
@@ -28,10 +28,6 @@
#############################################################################
# This script will clone coin repository and build its binaries.
-#
-# Usage:
-# ./create_baseline
-# ./create_baseline {commit-id}
########### Variables #############
@@ -41,26 +37,10 @@ commit_template_file=$basepath/commit-msg-template
test_script=$basepath/test_baseline.sh
workdir=$repodir
-########### Functions #############
-
-remove_dir() {
- rm -rf $1
-}
-
-clone_coin_repo() {
- git clone -b production ssh://codereview.qt-project.org:29418/qtqa/tqtc-coin-ci $1
- scp citest@$vmbuilder_ip:hooks/pre-push $1/.git/hooks/ && chmod +x $1/.git/hooks/pre-push
-}
-
########### Main #############
is_user_vmbuilder
-if [ ! -z "$1" ]; then
- master_commit_id=$1
- echo "Merging master commit-id:" $master_commit_id "into production"
-fi
-
# if local coin repo does not exist, clone it from git
if [ ! -d $repodir/.git ]; then
echo "Local coin repository $repodir does not exist. Cloning from git.."
@@ -68,46 +48,29 @@ if [ ! -d $repodir/.git ]; then
clone_coin_repo $repodir
fi
+# merge master branch into production
cd $repodir
-echo "Changed working directory:" $(pwd)
-
-# checkout current production head, update git refs and perform hard reset to discard local changes
-git checkout production
-git fetch
-git reset --hard origin/production
-
-# merge master into production branch
-if [ -z "$master_commit_id" ]; then
- echo "Merging origin/master to production..."
- git merge origin/master --no-edit
-else
- echo "Merging $master_commit to production..."
- git merge "$master_commit_id" --no-edit
-fi
+git checkout production 1>/dev/null
+git fetch 1>/dev/null
+git reset --hard origin/production 1>/dev/null
+git merge origin/master --no-edit 1>/dev/null
-# amend commit message
+# amend commit template
commit_msg="$(cat $commit_template_file && echo "" && cat $basepath/schedules/run_builds | egrep -v '(^#.*|^$)')"
git commit --amend -m "$commit_msg"
-merge_tip_commit=$(git log --no-merges -1)
-merge_tip_commit_short=$(git log --no-merges -1 --oneline)
-
-# display commits that were added on top of the current production
-if [ ! -z "$skip" ]; then
- gitdir=$(git rev-parse --git-dir)
- scp -p -P 29418 codereview.qt-project.org:hooks/commit-msg .git/hooks/
- git submodule update --init --checkout secrets
- echo -e "\nProduction baseline has been created in $workdir/$repo"
-else
- exit 2
-fi
+# create change log
+changelog=~/product_baseline_$(date +"%Y%m%d").log
+git log origin/production..HEAD --no-merges > $changelog
-echo -e "\nMerge log:"
+# print log
git log origin/production..HEAD --no-merges --decorate --oneline
-changelog=~/product_baseline_$(date +"%Y%m%d").log
-git log origin/production..HEAD --no-merges > $changelog
-echo "Changelog saved:" $changelog
+cat <<EOF
+
+Changelog: $changelog
+
+To continue testing baseline, execute:
+ $test_script
-echo ""
-echo "To continue testing the baseline, run script" $test_script
+EOF
diff --git a/scripts/coin/create_baseline/test_baseline.sh b/scripts/coin/create_baseline/test_baseline.sh
index c7a6606e..5588b758 100755
--- a/scripts/coin/create_baseline/test_baseline.sh
+++ b/scripts/coin/create_baseline/test_baseline.sh
@@ -36,15 +36,6 @@
basepath=$(dirname $(readlink -f test_baseline.sh)) # absolute script path
mode=remote
-########### Functions #############
-
-function exec_builds() {
- ./run_ci -r --tmux-no-attach
- sleep 2
- echo "Scheduled builds:"
- /bin/bash -x $basepath/schedules/run_builds
-}
-
########### Main #############
if [ ! "$1" == "local" ]; then
@@ -56,14 +47,18 @@ else
mode="local"
fi
-# schedule integrations
cd $repodir
-exec_builds
+./run_ci -m "Rebuilding..."
+sleep 2
+git clean -xdff
+make
+./run_ci -r --skip-make --tmux-no-attach
+echo "Scheduling builds..."
+/bin/bash -x $basepath/schedules/run_builds
-# display browser link
display_webserver_link $mode
-cat << EOF
+cat << -EOF
If test are successful, you may push the production merge to gerrit:
cd $repodir
git push origin HEAD:refs/for/production%r=aapo.keskimolo@qt.io,r=tony.sarajarvi@qt.io,r=simo.falt@qt.io