Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch OptaPlanner 8: shell script changes #1376

Merged
merged 9 commits into from
Jul 1, 2020
1 change: 1 addition & 0 deletions script/branched-7-repository-list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
optaplanner
2 changes: 1 addition & 1 deletion script/checks/oldbranches.pl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ ()
chomp;
s/^..([^ ]+).*/$1/;
if( s#remotes/$source/## ) {
if( m/r?\d\.\d\.(\d\.((M\d|Beta\d|GA)\.)?)?(x|Final)|HEAD|master$/ ) {
if( m/r?\d\.(\d\.(\d\.((M\d|Beta\d|GA)\.)?)?)?(x|Final)|HEAD|master$/ ) {
if( $verbose ) {
print " $_\n";
}
Expand Down
62 changes: 0 additions & 62 deletions script/git-clone-others.bat

This file was deleted.

24 changes: 19 additions & 5 deletions script/git-clone-others.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ additionalGitOptions=()

# default repository list is stored in the repository-list.txt file
REPOSITORY_LIST=`cat "${scriptDir}/repository-list.txt"`
# Repositories that need to use the branch 7.x instead of master
BRANCHED_7_REPOSITORY_LIST=`cat "${scriptDir}/branched-7-repository-list.txt"`

for arg in "$@"
do
Expand Down Expand Up @@ -103,20 +105,32 @@ for repository in $REPOSITORY_LIST ; do
if [ "x${additionalGitOptions}" != "x" ]; then
echo -- additional Git options: ${additionalGitOptions[@]} --
fi

if [ $(echo "$BRANCHED_7_REPOSITORY_LIST" | grep "^$repository$") ] ; then
if [[ ${additionalGitOptions[0]} == "-b" ]] || [[ ${additionalGitOptions[0]} == "--branch" ]]; then
if [[ ${additionalGitOptions[1]} == "master" ]]; then
echo "ERROR"
echo " The script argument (-b master) is not supported because you might want 7.x instead on some repo's."
exit 1
fi
else
additionalGitOptions="-b 7.x ${additionalGitOptions}"
fi
fi
git clone ${additionalGitOptions[@]} ${gitUrlPrefix}${repository}.git ${repository}

ge0ffrey marked this conversation as resolved.
Show resolved Hide resolved
returnCode=$?
if [ $returnCode != 0 ] ; then
exit $returnCode
fi

if [ "$UPSTREAM" = true ]; then
upstreamGitUrlPrefix=`echo ${gitUrlPrefix} | sed 's|\(.*github\.com[:/]\).*|\1kiegroup/|'`
echo -- adding upstream remote "${upstreamGitUrlPrefix}${repository}.git"
cd ${repository}
git remote add upstream ${upstreamGitUrlPrefix}${repository}.git
cd ..
fi

returnCode=$?
if [ $returnCode != 0 ] ; then
exit $returnCode
fi
fi
done

Expand Down
10 changes: 7 additions & 3 deletions script/utils/revapi-clean.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#!/bin/sh
# How to clean ignores in revapi-config.json files:
#
# export REVAPI_REPOSITORIES=droolsjbpm-build-bootstrap,droolsjbpm-knowledge,drools,jbpm,droolsjbpm-integration,optaplanner
# export MASTER_REVAPI_REPOSITORIES=droolsjbpm-build-bootstrap,droolsjbpm-knowledge,drools,jbpm,droolsjbpm-integration
# export BRANCHED_7_REVAPI_REPOSITORIES=optaplanner
# export REVAPI_REPOSITORIES=$MASTER_REVAPI_REPOSITORIES,$BRANCHED_7_REVAPI_REPOSITORIES
#
# ./git-clone-others.sh --repo-list=$REVAPI_REPOSITORIES --add-upstream-remote
# ./git-all.sh --repo-list=$REVAPI_REPOSITORIES checkout master
# ./git-all.sh --repo-list=$REVAPI_REPOSITORIES pull --rebase upstream master
# ./git-all.sh --repo-list=MASTER_REVAPI_REPOSITORIES checkout master
# ./git-all.sh --repo-list=MASTER_REVAPI_REPOSITORIES pull --rebase upstream master
# ./git-all.sh --repo-list=BRANCHED_7_REVAPI_REPOSITORIES checkout 7.x
# ./git-all.sh --repo-list=BRANCHED_7_REVAPI_REPOSITORIES pull --rebase upstream 7.x
# ./git-all.sh --repo-list=$REVAPI_REPOSITORIES checkout -b revapi-7.23.0.Final
# Copy this script to root of all repositories and run it there, ./revapi-clean.sh 7.23.0.Final
# Update <revapi.oldKieVersion> in kie-parent
Expand Down