Skip to content

Commit

Permalink
ci: Add repository check to semaphore scripts
Browse files Browse the repository at this point in the history
This fixes the condition of build failure when someone creates a
pull request from the master branch. It now check that the project
is coala/corobo repo and then execute build steps

Fixes coala#583
  • Loading branch information
Man-Jain committed Oct 14, 2018
1 parent aed83ca commit 1823d47
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .ci/semaphore.answers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pull_and_build() {
docker build -t meetmangukiya/corobo-answers answers/
}

if [[ $BRANCH_NAME != "master" ]]
if [[ $BRANCH_NAME != "master" && $SEMAPHORE_REPO_SLUG != "coala/corobo" ]]
then
.ci/check_docker.py
if [[ $? == 1 ]]
Expand Down
2 changes: 1 addition & 1 deletion .ci/semaphore.docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ docker run --user root meetmangukiya/corobo /bin/sh -c "
python -m pytest
"

if [[ $BRANCH_NAME == "master" ]]
if [[ $BRANCH_NAME == "master" && $SEMAPHORE_REPO_SLUG == "coala/corobo" ]]
then echo "pushing..." && docker push meetmangukiya/corobo && docker push meetmangukiya/corobo-answers
fi

0 comments on commit 1823d47

Please sign in to comment.