Skip to content

Commit

Permalink
Fix the script to correctly modify the upstream remote for official i…
Browse files Browse the repository at this point in the history
…mages
  • Loading branch information
jsternberg committed Oct 25, 2017
1 parent 8327ea1 commit 47997f8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,13 @@ pipeline {
}

sh """
if ! git remote | grep upstream &> /dev/null; then
git remote add upstream git://github.com/docker-library/official-images.git
desired_remote_url=git://github.com/docker-library/official-images.git
if current_remote_url=$(git remote get-url upstream 2> /dev/null); then
if [ "\$current_remote_url" != "\$desired_remote_url" ]; then
git remote set-url upstream "\$desired_remote_url"
fi
else
git remote set-url upstream git://github.com/docker-library/official-images.git
git remote add upstream "\$desired_remote_url"
fi
"""

Expand Down

0 comments on commit 47997f8

Please sign in to comment.