From 686b111e82e126542b27e3eff1ec54783d7304bb Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 8 Feb 2020 17:33:47 -0800 Subject: [PATCH 1/2] Stop multipe changelog generators from crashing into each other --- .build/generate_changelog.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.build/generate_changelog.sh b/.build/generate_changelog.sh index 58867c20c..ea586f4cd 100755 --- a/.build/generate_changelog.sh +++ b/.build/generate_changelog.sh @@ -1,5 +1,20 @@ #!/usr/bin/env bash +BRANCH=$TRAVIS_BRANCH +if [[ $TRAVIS_BRANCH == $TRAVIS_TAG ]]; then + BRANCH='master' +fi + +# Check if branch has been updated since this build started +# This tends to happen if multiple things have been merged in at the same time. +if [[ -z $TRAVIS_TAG ]]; then + git fetch origin + if [[ $(git rev-parse "origin/${BRANCH}") != $TRAVIS_COMMIT ]]; then + echo "${BRANCH} has been updated since build started. Aborting changelog." + exit 0 + fi +fi + FILENAME='CHANGELOG.md' # get the latest git tags @@ -40,11 +55,6 @@ docker run -it --rm -v "$(pwd)":/usr/local/src/your-app ferrarimarco/github-chan # Put back our link (instead of the broken one) sed -i 's!https://pypi.org/project/jrnl/HEAD/!https://github.com/jrnl-org/jrnl/!' "$FILENAME" -BRANCH=$TRAVIS_BRANCH -if [[ $TRAVIS_BRANCH == $TRAVIS_TAG ]]; then - BRANCH='master' -fi - git config --global user.email "jrnl.bot@gmail.com" git config --global user.name "Jrnl Bot" git checkout $BRANCH From 28c0d848455b99f9ad74e04e3a386f05d14dc6f5 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 8 Feb 2020 18:20:06 -0800 Subject: [PATCH 2/2] get rid of debug code --- .travis.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4753a731c..0ddf4c61a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,14 +9,8 @@ git: depth: false autocrlf: false -addons: - apt: - packages: - - tree - before_install: - date - - tree install: - pip install poetry