Browse Source

Удаление push_update.sh

master
Alexander Demidov 11 years ago
parent
commit
f78d7e5de9
  1. 7
      CHANGELOG.md
  2. 91
      push-update.sh

7
CHANGELOG.md

@ -1,9 +1,16 @@
Changelog Changelog
========= =========
0.0.19 (2014-04-03)
-------------------
- Удаление push_update.sh. [Alexander Demidov]
0.0.18 (2014-02-18) 0.0.18 (2014-02-18)
------------------- -------------------
- Update CHANGELOG.md. [Alexander Demidov]
- MIRSPORTA-255 Добавление/редактирование - MIRSPORTA-255 Добавление/редактирование
цветов в карточке товара [Alexander Demidov] цветов в карточке товара [Alexander Demidov]

91
push-update.sh

@ -1,91 +0,0 @@
#!/bin/bash
REMOTE_REPOSITORY='origin'
REMOTE_BRANCH='master'
PATH_LIB='/lib/Image'
PROJECTS=( "/var/www/10ballov" "/var/www/predelanet" "/var/www/zelenoemore" "/var/www/d753_common" "/var/www/d753_predelanet" "/var/www/d753_10ballov" )
if [ ! -f "CHANGELOG.md" ]
then
echo "CHANGELOG.md not exists\n"
exit 1
fi
test -n "`tail CHANGELOG.md`"
CHANGELOG_EMPTY=`echo $?`
if [ $CHANGELOG_EMPTY == 1 ]
then
echo -e "CHANGELOG.md is empty\n"
exit 1
fi
git diff-index --quiet HEAD --
REPO_CHANGED=`echo $?`
if [ $REPO_CHANGED == 1 ]
then
echo -e "Please commit all changes in repository\n"
exit 1
fi
VERSION_PREVIOUS=`sed -n '4,4p' CHANGELOG.md | cut -d "(" -f1 | tr -d ' '`
if [ `git rev-parse ${VERSION_PREVIOUS}` != `git rev-parse HEAD` ]
then
VERSION=`echo ${VERSION_PREVIOUS} | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{if(length($NF+1)>length($NF))$(NF-1)++; $NF=sprintf("%0*d", length($NF), ($NF+1)%(10^length($NF))); print}'`
git tag "$VERSION" &&
gitchangelog > CHANGELOG.md &&
{
git add CHANGELOG.md >/dev/null &&
git commit -m "Update CHANGELOG.md" > /dev/null &&
git tag -d "$VERSION" >/dev/null &&
git tag "$VERSION" >/dev/null &&
git push "${REMOTE_REPOSITORY}" --tags >/dev/null 2>/dev/null
} || {
echo -e "Cannot push released tag into remote repository\n"
exit 1
}
else
VERSION=$VERSION_PREVIOUS
fi
git push "${REMOTE_REPOSITORY}" HEAD:"${REMOTE_BRANCH}" >/dev/null || exit 1
MESSAGE="Update ${PATH_LIB} on ${VERSION}"
CURRENT_DIR=`pwd`
for project in "${PROJECTS[@]}"
do
echo -e "Update lib for ${project}...\n"
{
cd "${project}${PATH_LIB}" &&
git fetch "${REMOTE_REPOSITORY}" >/dev/null 2>/dev/null &&
git checkout "$VERSION" 2>/dev/null;
} || {
echo -e "Failed to checkout lib on tag ${VERSION}\n" &&
exit 1;
}
# cd "${project}"
# LIB_DIR=`echo ${PATH_LIB#'/'}`
# git diff-index --quiet HEAD "$LIB_DIR"
# LIB_NEW_COMMITS=`echo $?`
# if [ $LIB_NEW_COMMITS == 1 ]
# then
# {
# git reset >/dev/null &&
# git add "$LIB_DIR" >/dev/null &&
# git commit -m "$MESSAGE" >/dev/null
# } || {
# echo -e "Failed to update lib for ${project}\n"
# exit 1
# }
# if [ $project == "/var/www/d753_common" ]
# then
# {
# git push origin master > /dev/null &&
# cd /var/www/d753_predelanet/ && ./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"
# exit 1
# }
# fi
# else
# echo -e "Already update\n"
# fi
done
echo -e "All operations succeed\n"
exit 0
Loading…
Cancel
Save