|
@ -28,46 +28,46 @@ then |
|
|
gitchangelog > CHANGELOG.md && |
|
|
gitchangelog > CHANGELOG.md && |
|
|
(git add CHANGELOG.md > /dev/null && |
|
|
(git add CHANGELOG.md > /dev/null && |
|
|
git commit -m 'Update CHANGELOG.md' > /dev/null && |
|
|
git commit -m 'Update CHANGELOG.md' > /dev/null && |
|
|
git push --tags --porcelain > /dev/null) || |
|
|
|
|
|
|
|
|
git push --tags > /dev/null) || |
|
|
(echo -e "Cannot push released tag into remote repository\n" && |
|
|
(echo -e "Cannot push released tag into remote repository\n" && |
|
|
exit 1) |
|
|
exit 1) |
|
|
else |
|
|
else |
|
|
VERSION=$VERSION_PREVIOUS |
|
|
VERSION=$VERSION_PREVIOUS |
|
|
fi |
|
|
fi |
|
|
git push --porcelain > /dev/null || exit 1 |
|
|
|
|
|
|
|
|
git push > /dev/null || exit 1 |
|
|
|
|
|
|
|
|
MESSAGE="Update ${PATH_LIB} on ${VERSION}" |
|
|
|
|
|
|
|
|
MESSAGE="\nUpdate ${PATH_LIB} on ${VERSION}\n" |
|
|
CURRENT_DIR=`pwd` |
|
|
CURRENT_DIR=`pwd` |
|
|
for project in "${PROJECTS[@]}" |
|
|
for project in "${PROJECTS[@]}" |
|
|
do |
|
|
do |
|
|
echo -e "Update lib for ${i}...\n" |
|
|
|
|
|
|
|
|
echo -e "\nUpdate lib for ${project}...\n" |
|
|
(cd "${project}${PATH_LIB}" && |
|
|
(cd "${project}${PATH_LIB}" && |
|
|
git fetch > /dev/null && |
|
|
git fetch > /dev/null && |
|
|
git checkout $VERSION > /dev/null) || |
|
|
|
|
|
(echo -e "Failed to checkout lib on tag ${VERSION}\n" && |
|
|
|
|
|
|
|
|
git checkout $VERSION 2> /dev/null) || |
|
|
|
|
|
(echo -e "\nFailed to checkout lib on tag ${VERSION}\n" && |
|
|
exit 1) |
|
|
exit 1) |
|
|
cd "${project}" |
|
|
cd "${project}" |
|
|
git diff-index --quiet HEAD "${PATH_LIB#'/'}" |
|
|
|
|
|
|
|
|
git diff-index --quiet HEAD "`echo ${PATH_LIB#'/'}`" |
|
|
LIB_NEW_COMMITS=`echo $?` |
|
|
LIB_NEW_COMMITS=`echo $?` |
|
|
if [ $LIB_NEW_COMMITS == 1 ] |
|
|
if [ $LIB_NEW_COMMITS == 1 ] |
|
|
then |
|
|
then |
|
|
(git reset > /dev/null |
|
|
|
|
|
git add "${PATH_LIB#'/'}" > /dev/null && |
|
|
|
|
|
|
|
|
(git reset > /dev/null && |
|
|
|
|
|
git add "`echo ${PATH_LIB#'/'}`" > /dev/null && |
|
|
git commit -m $MESSAGE > /dev/null) || |
|
|
git commit -m $MESSAGE > /dev/null) || |
|
|
(echo -e "Failed to update lib for ${project}\n" && |
|
|
|
|
|
|
|
|
(echo -e "\nFailed to update lib for ${project}\n" && |
|
|
exit 1) |
|
|
exit 1) |
|
|
if [ $project == "/var/www/d753_common" ] |
|
|
if [ $project == "/var/www/d753_common" ] |
|
|
then |
|
|
then |
|
|
(git push origin master > /dev/null && |
|
|
(git push origin master > /dev/null && |
|
|
cd /var/www/d753/ && ./merge-from-master.sh > /dev/null |
|
|
cd /var/www/d753/ && ./merge-from-master.sh > /dev/null |
|
|
cd /var/www/d753_10ballov/ && ./merge-from-master.sh > /dev/null) || |
|
|
cd /var/www/d753_10ballov/ && ./merge-from-master.sh > /dev/null) || |
|
|
(echo -e "Failed to update dependency d753 branches... Please resolve that problem by hand\n" && |
|
|
|
|
|
|
|
|
(echo -e "\nFailed to update dependency d753 branches... Please resolve that problem by hand\n" && |
|
|
exit 1) |
|
|
exit 1) |
|
|
fi |
|
|
fi |
|
|
else |
|
|
else |
|
|
echo -e "Already update\n" |
|
|
|
|
|
|
|
|
echo -e "\nAlready update\n" |
|
|
fi |
|
|
fi |
|
|
done |
|
|
done |
|
|
|
|
|
|
|
|
echo -e "All operations succeed\n" |
|
|
|
|
|
|
|
|
echo -e "\nAll operations succeed\n" |
|
|
exit 0 |
|
|
exit 0 |