summaryrefslogtreecommitdiffstats
path: root/scripts/coin/create_baseline/create_baseline.sh
blob: 83fd290161408117db74a10e67e5baa86a4e7001 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash -e
# Copyright (C) 2017 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

# This script will clone coin repository and build its binaries.

########### Variables #############

. utils
basepath=$(dirname $(readlink -f create_baseline.sh))  # absolute script path
commit_template_file=$basepath/commit-msg-template
test_script=$basepath/test_baseline.sh
workdir=$repodir

########### Main #############

is_user_vmbuilder

# 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.."
 mkdir -p $rootdir
 clone_coin_repo $repodir
fi

# merge master branch into production
cd $repodir
git checkout production 1>/dev/null
git fetch 1>/dev/null
git reset --hard origin/production 1>/dev/null
git merge origin/master --no-ff --no-edit 1>/dev/null

# amend commit template
commit_msg="$(cat $commit_template_file && echo "" && cat $basepath/schedules/run_builds | egrep -v '(^#.*|^$)')"
git commit --amend -m "$commit_msg"

# create change log
changelog=~/product_baseline_$(date +"%Y%m%d").log
git log origin/production..HEAD --no-merges > $changelog

# print log
git log origin/production..HEAD --no-merges --decorate --oneline

cat <<EOF

Changelog: $changelog

To continue testing baseline, execute:
 $test_script

EOF