Skip to content

Commit 59fc2cb

Browse files
committed
fix pipeline to not release when compiling PR's
1 parent 4df24e2 commit 59fc2cb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ before_install:
1414
- echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust
1515
- mvn clean -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -B -q && echo "CLEAN DONE"
1616
- mvn package -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -B -q && echo "PACKAGE AND LOCAL INSTALL DONE"
17-
- if [[ $TRAVIS_BRANCH == "master" && $SONAR_ENABLED == "true" ]]; then mvn sonar:sonar -q "-Dsonar.branch.name=${TRAVIS_BRANCH}" "-Dsonar.host.url=${SONAR_URL}" "-Dsonar.login=${SONAR_TOKEN}" "-Dsonar.organization=${SONAR_ORGANISATION}" && echo "SONAR ON ${TRAVIS_BRANCH} DONE"; fi
17+
- if [[ $TRAVIS_BRANCH == "master" && $SONAR_ENABLED == "true" && $TRAVIS_PULL_REQUEST == "false" ]]; then mvn sonar:sonar -q "-Dsonar.branch.name=${TRAVIS_BRANCH}" "-Dsonar.host.url=${SONAR_URL}" "-Dsonar.login=${SONAR_TOKEN}" "-Dsonar.organization=${SONAR_ORGANISATION}" && echo "SONAR ON ${TRAVIS_BRANCH} DONE"; fi
1818
- if [[ $TRAVIS_BRANCH != "master" && $SONAR_ENABLED == "true" ]]; then mvn sonar:sonar -q "-Dsonar.branch.name=${TRAVIS_BRANCH}" "-Dsonar.branch.target=master" "-Dsonar.host.url=${SONAR_URL}" "-Dsonar.login=${SONAR_TOKEN}" "-Dsonar.organization=${SONAR_ORGANISATION}" && echo "SONAR ON ${TRAVIS_BRANCH} DONE"; fi
1919
- export GIT_RELEASE_NOTES="$(git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%h - %s (%an)")"
2020
- echo "READY"
@@ -27,14 +27,14 @@ install:
2727

2828
## Build and release to maven central
2929
script:
30-
- if [[ $TRAVIS_BRANCH == "master" ]]; then mvn clean deploy --settings default.xml -B -Prelease; fi
30+
- if [[ $TRAVIS_BRANCH == "master" && $TRAVIS_PULL_REQUEST == "false" ]]; then mvn clean deploy --settings default.xml -B -Prelease; fi
3131

3232
## Get the project version, only tag if tag does not exist
3333
before_deploy:
3434
- export CURRENT_VERSION=$(mvn help:evaluate -q -DforceStdout -Dexpression=project.version)
3535
- echo CURRENT_VERSION=$CURRENT_VERSION
3636
- export TRAVIS_TAG=$CURRENT_VERSION
37-
- if [[ $TRAVIS_BRANCH == "master" ]] && [[ -z $(git tag -l "$CURRENT_VERSION") ]]; then git tag $TRAVIS_TAG; fi
37+
- if [[ $TRAVIS_BRANCH == "master" && $TRAVIS_PULL_REQUEST == "false" ]] && [[ -z $(git tag -l "$CURRENT_VERSION") ]]; then git tag $TRAVIS_TAG; fi
3838

3939
## Create release in GitHub
4040
deploy:
@@ -53,9 +53,9 @@ deploy:
5353
on:
5454
branch: master
5555
- provider: script
56-
script: if [[ $TRAVIS_BRANCH == "master" ]]; then bash docker run --rm aemdesign/travis-trigger-build sbb --github_user=${REPO_SLUG_ARRAY[0]} --github_repo=aem --github_branch=6.5.0-bundle --travis_token=${TRAVIS_TOKEN}; fi
56+
script: if [[ $TRAVIS_BRANCH == "master" && $TRAVIS_PULL_REQUEST == "false" ]]; then bash docker run --rm aemdesign/travis-trigger-build sbb --github_user=${REPO_SLUG_ARRAY[0]} --github_repo=aem --github_branch=6.5.0-bundle --travis_token=${TRAVIS_TOKEN}; fi
5757
- provider: script
58-
script: if [[ $TRAVIS_BRANCH == "master" ]]; then bash docker run --rm aemdesign/travis-trigger-build sbb --github_user=${REPO_SLUG_ARRAY[0]} --github_repo=aem --github_branch=6.4.0-bundle --travis_token=${TRAVIS_TOKEN}; fi
58+
script: if [[ $TRAVIS_BRANCH == "master" && $TRAVIS_PULL_REQUEST == "false" ]]; then bash docker run --rm aemdesign/travis-trigger-build sbb --github_user=${REPO_SLUG_ARRAY[0]} --github_repo=aem --github_branch=6.4.0-bundle --travis_token=${TRAVIS_TOKEN}; fi
5959

6060
#notifications:
6161
# email: false

0 commit comments

Comments
 (0)