diff --git a/files/dictionary.dic b/files/dictionary.dic index 0e695eb..705252a 100644 --- a/files/dictionary.dic +++ b/files/dictionary.dic @@ -170,5 +170,5 @@ yandex Хостелы цій ывро -явника який +явника diff --git a/files/push.sh b/files/push.sh deleted file mode 100644 index 58a2e8c..0000000 --- a/files/push.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -setup_git() { - git config --global user.email "travis@travis-ci.org" - git config --global user.name "Travis CI" -} - -commit_files() { - git checkout master - git add . - git commit --message "Travis build: $TRAVIS_BUILD_NUMBER" -} - -upload_files() { - git remote add origin-master https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git > /dev/null 2>&1 - git push --quiet --set-upstream origin-master master -} - -setup_git -commit_files -upload_files diff --git a/files/run_on_master.sh b/files/run_on_master.sh index 3539608..c18ab6f 100644 --- a/files/run_on_master.sh +++ b/files/run_on_master.sh @@ -4,28 +4,45 @@ set -e skip() { echo "$@" 1>&2 - echo "Exiting..." 1>&2 exit 0 } + [ "${TRAVIS_COMMIT_MESSAGE}" == "${TRAVIS_COMMIT_MESSAGE/Travis build/}" ] || \ - skip "Skip for travis updates." + skip "Skipped... because this is travis autocommit." [ "${TRAVIS_PULL_REQUEST}" = "false" ] || \ - skip "Not running master-only script for pull-requests." + skip "Skipped... because this is pull request." [ "${TRAVIS_BRANCH}" = "master" ] || \ - skip "Running master-only for updates on 'master' branch (current: ${TRAVIS_BRANCH})." + skip "Skipped... because this is not a master branch (current: ${TRAVIS_BRANCH})." [ "${TRAVIS_REPO_SLUG}" = "ru-de/faq" ] || \ - skip "Running master-only for updater on main repo (current: ${TRAVIS_REPO_SLUG})." + skip "Skipped... because this is not an original repository (current: ${TRAVIS_REPO_SLUG})." [ "${GH_TOKEN+set}" = set ] || \ - skip "GitHub access token not available, skipping dict check." + skip "Skipped... GitHub access token not available" -dict_check() { - LC_ALL=ru_RU.UTF8 sort files/dictionary.dic -C || \ - (LC_ALL=ru_RU.UTF8 sort files/dictionary.dic -o files/dictionary.dic -f && bash files/push.sh) -} +git config --global user.email "travis@travis-ci.org" +git config --global user.name "Travis CI" -dict_check +git remote add upstream https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git > /dev/null 2>&1 +git fetch upstream --depth=3 +git checkout upstream/master -q + +LC_ALL=ru_RU.UTF8 sort files/dictionary.dic -o files/dictionary.dic -f + +if ! git diff --quiet; then + git commit -q --message "Travis #$TRAVIS_BUILD_NUMBER: dictionary rearrangement" + git push + echo "Dictionary was rearranged" +fi + +git checkout upstream/gh-pages +bash update.sh + +if ! git diff --quiet; then + git commit -q --message "Travis #$TRAVIS_BUILD_NUMBER: sync github pages" + git push + echo "Github pages was updated" +fi diff --git a/Консульство.md b/Консульство.md index 2f26483..d7b70ae 100644 --- a/Консульство.md +++ b/Консульство.md @@ -43,3 +43,5 @@ * Оплату за паспорт принимают строго *только ЕС* картой. Не принимают наличку, не принимают нормальные карты. Пришлось искать человека в очереди с ЕС картой и просить его заплатить за меня, а ему деньги наличкой отдать. * Делать второй загранпаспорт выгоднее до переезда, в РФ это 2500 рублей (вроде была скидка, если оформлять через госуслуги), здесь же - *77 евро* * Миф - второй загранпаспорт дается на срок действия первого - это давно уже неправда. Новый паспорт *на новые 10 лет с даты изготовления*. + +тест \ No newline at end of file