diff --git a/release b/release index b8c7e3273d4..8310ce8c8d6 100755 --- a/release +++ b/release @@ -9,6 +9,14 @@ CHDATE=$(LC_ALL=C date -R | sed -e 's/,/\\,/g') # Заменим запятую # Собирать пакет с конфигурационными файлами для Яндекс.Метрики. BUILD_PACKAGE_FOR_METRIKA=$([ -f 'private/Server/metrika/config.xml' ] && echo 'yes') +# Don't sign packages, don't upload, don't create tags. +if [[ $1 == '--standalone' ]] +then + STANDALONE='yes' + DEBUILD_NOSIGN_OPTIONS="-us -uc" + shift +fi + # Список демонов для сборки может быть указан в аргументах командной строки. if [ $# -gt 0 ] then @@ -25,6 +33,9 @@ make_control "$CONTROL" "$DAEMONS" gen_changelog "$REVISION" "$CHDATE" "$AUTHOR" "$CHLOG" "$DAEMONS" # Сборка (только бинарных пакетов). -debuild -e DAEMONS="${DAEMONS}" -e DISABLE_MONGODB -e CC -e CXX -b +debuild -e DAEMONS="${DAEMONS}" -e DISABLE_MONGODB -e CC -e CXX -b ${DEBUILD_NOSIGN_OPTIONS} -upload_debs "$REVISION" "$DAEMONS" +if [[ $STANDALONE != 'yes' ]] +then + upload_debs "$REVISION" "$DAEMONS" +fi diff --git a/release_lib.sh b/release_lib.sh index a3ad694c4d6..f30c2587761 100644 --- a/release_lib.sh +++ b/release_lib.sh @@ -61,43 +61,48 @@ function gen_revision_author { IS_IT_GITHUB=$( git config --get remote.origin.url | grep 'github') REVISION=$( git tag | tag_filter | tail -1 ) - MAX_REVISION=$(($REVISION + 10)) # Максимальное количество попыток отправить тег в Git. + REVISION_FULL_NAME=$REVISION - # Создадим номер ревизии и попытаемся залить на сервер. - succeeded=0 - attempts=0 - max_attempts=5 - while [ $succeeded -eq 0 ] && [ $attempts -le $max_attempts ] - do - REVISION=$(($REVISION + 1)) - attempts=$(($attempts + 1)) + if [[ $STANDALONE != 'yes' ]] + then + MAX_REVISION=$(($REVISION + 10)) # Максимальное количество попыток отправить тег в Git. - [ "$REVISION" -ge "$MAX_REVISION" ] && exit 1 + # Создадим номер ревизии и попытаемся залить на сервер. + succeeded=0 + attempts=0 + max_attempts=5 + while [ $succeeded -eq 0 ] && [ $attempts -le $max_attempts ] + do + REVISION=$(($REVISION + 1)) + attempts=$(($attempts + 1)) - REVISION_FULL_NAME=$REVISION + [ "$REVISION" -ge "$MAX_REVISION" ] && exit 1 - if [[ "$IS_IT_GITHUB" = "" ]] - then - REVISION_FULL_NAME=$REVISION_FULL_NAME-mobmet - fi + REVISION_FULL_NAME=$REVISION - echo -e "\nTrying to create revision:" $REVISION_FULL_NAME - if git tag $REVISION_FULL_NAME - then - echo -e "\nTrying to push revision to origin:" $REVISION_FULL_NAME - git push origin $REVISION_FULL_NAME - if [ $? -ne 0 ]; + if [[ "$IS_IT_GITHUB" = "" ]] then - git tag -d $REVISION_FULL_NAME - else - succeeded=1 + REVISION_FULL_NAME=$REVISION_FULL_NAME-mobmet fi - fi - done - if [ $succeeded -eq 0 ]; then - echo "Fail to create tag" - exit 1 + echo -e "\nTrying to create revision:" $REVISION_FULL_NAME + if git tag $REVISION_FULL_NAME + then + echo -e "\nTrying to push revision to origin:" $REVISION_FULL_NAME + git push origin $REVISION_FULL_NAME + if [ $? -ne 0 ]; + then + git tag -d $REVISION_FULL_NAME + else + succeeded=1 + fi + fi + done + + if [ $succeeded -eq 0 ]; then + echo "Fail to create tag" + exit 1 + fi fi AUTHOR=$(git config --get user.name)