Skip to content

Commit

Permalink
travis: Don't split edit & commit the README
Browse files Browse the repository at this point in the history
The current code edit the README, and try to edit/push the change on the
specfile which leads to a git error :
    error: cannot pull with rebase: You have unstaged changes.

To avoid this case, commit_changed_readme() now edits the readme.
This way a single function is responsible of doing the change.

Signed-off-by: Erwan Velu <erwan@redhat.com>
  • Loading branch information
Erwan Velu committed Nov 22, 2018
1 parent 4e9e8fb commit a5fd548
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions contrib/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ PENULTIMATE_TAG=$(git describe --abbrev=0 --tags "$(git rev-list --tags --skip=1
#############
# FUNCTIONS #
#############
function edit_readme {
# we replace the n-1 tag with the last one
sed -i "s/$PENULTIMATE_TAG/$TRAVIS_TAG/g" README.md
}

function setup_git {
git config --global user.email "buils@travis-ci.com"
Expand All @@ -36,6 +32,8 @@ function commit_spec_file {
}

function commit_changed_readme {
# we replace the n-1 tag with the last one
sed -i "s/$PENULTIMATE_TAG/$TRAVIS_TAG/g" README.md
git add README.md
commit_and_push "Readme: Bump the new release tag: $TRAVIS_TAG"
}
Expand Down Expand Up @@ -65,7 +63,6 @@ if [[ "$1" == "tag-release" ]]; then
echo "I'm running on tag $TRAVIS_TAG, let's build a new release!"
./contrib/release.sh -g "$GITHUB_TOKEN" -t "$TRAVIS_TAG" -p "$PENULTIMATE_TAG" -b "master"
git checkout master
edit_readme
setup_git
commit_spec_file
commit_changed_readme
Expand Down

0 comments on commit a5fd548

Please sign in to comment.