From ad239bd651c1ccd555c4f84111416bb0b2aefe0b Mon Sep 17 00:00:00 2001 From: Tom Date: Fri, 27 May 2016 17:14:46 +0200 Subject: [PATCH] reverse deploy exclusion cause they fails QA --- distribution.sh | 78 -------------------------------------- pom.xml | 99 +------------------------------------------------ travis.sh | 17 +++------ 3 files changed, 7 insertions(+), 187 deletions(-) delete mode 100755 distribution.sh diff --git a/distribution.sh b/distribution.sh deleted file mode 100755 index 9679c3d6899..00000000000 --- a/distribution.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash -# - -set -euo pipefail - -# -# Evaluate a Maven expression -# - -function maven_expression() { - mvn help:evaluate -Dexpression=$1 | grep -v '^\[\|Download\w\+\:' -} - -ARTIFACTID="`maven_expression project.artifactId`" -VERSION="`maven_expression project.version`" -BINTRAY_REPO=Distribution -BINTRAY_ACCOUNT=sonarsource - -if [[ "$VERSION" =~ "-build" ]] || [[ "$VERSION" =~ "-SNAPSHOT" ]]; then - echo "This is a dev build, not releasing" - exit 0 -else - echo "About to release sonarqube" -fi - -cd sonar-application - -GROUPID="`maven_expression project.groupId`" -ARTIFACTID="`maven_expression project.artifactId`" -echo "$GROUPID $ARTIFACTID $VERSION" -GROUPIDPATH=`echo $GROUPID | sed 's/\./\//g'` - -echo "Uploading sonarqube-$VERSION.zip to $BINTRAY_ACCOUNT/$BINTRAY_REPO" -cd target - -#zip file - -HTTP_CODE=`curl --write-out %{http_code} -T sonarqube-$VERSION.zip -u$BINTRAY_USER:$BINTRAY_TOKEN https://api.bintray.com/content/$BINTRAY_ACCOUNT/$BINTRAY_REPO/SonarQube/$VERSION/sonarqube/` - -echo $HTTP_CODE - -if [[ "$HTTP_CODE" =~ "201" ]]; then - echo "Uploaded to bintray" - echo "https://bintray.com/$BINTRAY_ACCOUNT/$BINTRAY_REPO/SonarQube/$VERSION/view#files" -else - echo "Upload to bintray failed -> $HTTP_CODE" - exit -1 -fi - -#md5 file - -HTTP_CODE=`curl --write-out %{http_code} -T sonarqube-$VERSION.zip.md5 -u$BINTRAY_USER:$BINTRAY_TOKEN https://api.bintray.com/content/$BINTRAY_ACCOUNT/$BINTRAY_REPO/SonarQube/$VERSION/sonarqube/` - -echo $HTTP_CODE - -if [[ "$HTTP_CODE" =~ "201" ]]; then - echo "Uploaded to bintray" - echo "https://bintray.com/$BINTRAY_ACCOUNT/$BINTRAY_REPO/SonarQube/$VERSION/view#files" -else - echo "Upload to bintray failed -> $HTTP_CODE" - exit -1 -fi - -#sha file - -HTTP_CODE=`curl --write-out %{http_code} -T sonarqube-$VERSION.zip.sha -u$BINTRAY_USER:$BINTRAY_TOKEN https://api.bintray.com/content/$BINTRAY_ACCOUNT/$BINTRAY_REPO/SonarQube/$VERSION/sonarqube/` - -echo $HTTP_CODE - -if [[ "$HTTP_CODE" =~ "201" ]]; then - echo "Uploaded to bintray" - echo "https://bintray.com/$BINTRAY_ACCOUNT/$BINTRAY_REPO/SonarQube/$VERSION/view#files" -else - echo "Upload to bintray failed -> $HTTP_CODE" - exit -1 -fi - - \ No newline at end of file diff --git a/pom.xml b/pom.xml index a34f6b8360b..4d96a5a9148 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,6 @@ sonarqube - @@ -1122,9 +1121,6 @@ release - - **/sonar-application* - @@ -1515,100 +1511,7 @@ it tests - - - deploy-sonarsource - - - - org.apache.maven.plugins - maven-enforcer-plugin - - - enforce-deploy-settings - - enforce - - - - - gitRepositoryName - You must set name of Git repository in your pom - - - ARTIFACTORY_URL - - - ARTIFACTORY_DEPLOY_REPO - - - ARTIFACTORY_DEPLOY_USERNAME - - - ARTIFACTORY_DEPLOY_PASSWORD - - - true - - - - - - - org.jfrog.buildinfo - artifactory-maven-plugin - ${version.artifactory.plugin} - - - build-info - - publish - - - - - *password*,*PASSWORD*,*secret*,*MAVEN_CMD_LINE_ARGS*,sun.java.command,*token*,*TOKEN*,*LOGIN*,*login* - - true - 60 - - - {{GIT_COMMIT|TRAVIS_COMMIT}} - {{GIT_BRANCH|TRAVIS_BRANCH}} - ${gitRepositoryName} - {{BUILD_ID|TRAVIS_BUILD_NUMBER}} - - - true - false - true - project,provided - licences-control@sonarsource.com - - - ${env.ARTIFACTORY_URL} - ${env.ARTIFACTORY_DEPLOY_REPO} - ${env.ARTIFACTORY_DEPLOY_USERNAME} - ${env.ARTIFACTORY_DEPLOY_PASSWORD} - true - true - ${artifactoryExclusion} - true - - - ${gitRepositoryName} - {{BUILD_ID|TRAVIS_BUILD_NUMBER}} - {{CI_BUILD_URL|BUILD_URL}} - {{GIT_COMMIT|TRAVIS_COMMIT}} - - - - - - - - + diff --git a/travis.sh b/travis.sh index 284f0def7a0..74820c6fae8 100755 --- a/travis.sh +++ b/travis.sh @@ -37,21 +37,16 @@ CI) if [[ $CURRENT_VERSION =~ "-SNAPSHOT" ]]; then echo "======= Found SNAPSHOT version =======" # Do not deploy a SNAPSHOT version but the release version related to this build - set_maven_build_version $TRAVIS_BUILD_NUMBER - # analysis is currently executed by SonarSource internal infrastructure - mvn deploy \ - -Pdeploy-sonarsource \ - -B -e -V + set_maven_build_version $TRAVIS_BUILD_NUMBER else echo "======= Found RELEASE version =======" - # analysis is currently executed by SonarSource internal infrastructure - mvn deploy \ - -Pdeploy-sonarsource,release \ - -B -e -V - ./distribution.sh - fi + # analysis is currently executed by SonarSource internal infrastructure + mvn deploy \ + -Pdeploy-sonarsource \ + -B -e -V + elif [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ -n "${GITHUB_TOKEN:-}" ]; then -- 2.39.5