From ec22be60678b5ff5138e5ba6d3bba2fe7a5a5fc1 Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Thu, 8 Sep 2016 09:40:23 +0200 Subject: [PATCH] Don't run ITs on Appveyor --- appveyor.ps1 | 140 +-------------------------------------------------- appveyor.yml | 8 --- 2 files changed, 2 insertions(+), 146 deletions(-) diff --git a/appveyor.ps1 b/appveyor.ps1 index c3fa1d9..968c088 100644 --- a/appveyor.ps1 +++ b/appveyor.ps1 @@ -1,104 +1,5 @@ $ErrorActionPreference = "Stop" -function FetchAndUnzip -{ - param ([string]$Url, [string]$Out) - - $tmp = [System.IO.Path]::GetTempFileName() - [System.Reflection.Assembly]::LoadWithPartialName('System.Net.Http') | Out-Null - $client = (New-Object System.Net.Http.HttpClient) - try - { - if (-not([string]::IsNullOrEmpty($env:GITHUB_TOKEN))) - { - $credentials = [string]::Format([System.Globalization.CultureInfo]::InvariantCulture, "{0}:", $env:GITHUB_TOKEN); - $credentials = [Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($credentials)); - $client.DefaultRequestHeaders.Authorization = (New-Object System.Net.Http.Headers.AuthenticationHeaderValue("Basic", $credentials)); - } - $contents = $client.GetByteArrayAsync($url).Result; - [System.IO.File]::WriteAllBytes($tmp, $contents); - } - finally - { - $client.Dispose() - } - - if (-not(Test-Path $Out)) - { - mkdir $Out | Out-Null - } - [System.Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem') | Out-Null - [System.IO.Compression.ZipFile]::ExtractToDirectory($tmp, $Out) -} - -function InstallAppveyorTools -{ - $travisUtilsVersion = "16" - $localPath = "$env:USERPROFILE\.local" - $travisUtilsPath = "$localPath\travis-utils-$travisUtilsVersion" - if (Test-Path $travisUtilsPath) - { - echo "Reusing the Travis Utils version $travisUtilsVersion already downloaded under $travisUtilsPath" - } - else - { - $url = "https://github.com/SonarSource/travis-utils/archive/v$travisUtilsVersion.zip" - echo "Downloading Travis Utils version $travisUtilsVersion from $url into $localPath" - FetchAndUnzip $url $localPath - } - - $mavenLocalRepository = "$env:USERPROFILE\.m2\repository" - if (-not(Test-Path $mavenLocalRepository)) - { - mkdir $mavenLocalRepository | Out-Null - } - echo "Installating Travis Utils closed source Maven projects into $mavenLocalRepository" - Copy-Item "$travisUtilsPath\m2repo\*" $mavenLocalRepository -Force -Recurse - - $env:ORCHESTRATOR_CONFIG_URL = "" - $env:TRAVIS = "ORCH-332" -} - -function Build -{ - param ([string]$Project, [string]$Sha1) - - $msg = "Fetch [" + $Project + ":" + $Sha1 + "]" - echo $msg - - $url = "https://github.com/$Project/archive/$Sha1.zip" - $tmp = "c:\snapshot" - if (Test-Path $tmp) - { - Cmd /C "rmdir /S /Q $tmp" - } - - FetchAndUnzip $url $tmp - - $msg = "Build [" + $Project + ":" + $Sha1 + "]" - echo $msg - - pushd $tmp\* - try - { - mvn install "--batch-mode" "-DskipTests" "-Pdev" - CheckLastExitCode - } - finally - { - popd - } -} - -function BuildSnapshot -{ - param ([string]$Project) - - echo "Fetch and build snapshot of [$Project]" - - Build $Project "HEAD" -} - function CheckLastExitCode { param ([int[]]$SuccessCodes = @(0)) @@ -113,43 +14,6 @@ CALLSTACK:$(Get-PSCallStack | Out-String) } } -BuildSnapshot "SonarSource/sonar-scanner-api" -switch ($env:RUN) -{ - "ci" - { - mvn verify "--batch-mode" "-B" "-e" "-V" - CheckLastExitCode - } - - "it" - { - InstallAppveyorTools - BuildSnapshot "SonarSource/orchestrator" - - mvn install "--batch-mode" "-Dsource.skip=true" "-Dmaven.test.skip=true" - CheckLastExitCode - - if ($env:SQ_VERSION -eq "DEV") - { - BuildSnapshot "SonarSource/sonarqube" - } - - pushd it - try - { - mvn install "--batch-mode" "-DsonarRunner.version=""2.5-SNAPSHOT""" "-Dsonar.runtimeVersion=""$env:SQ_VERSION""" "-Dmaven.test.redirectTestOutputToFile=false" - CheckLastExitCode - } - finally - { - popd - } - } - - default - { - throw "Unexpected RUN mode: $env:RUN" - } -} +mvn verify "--batch-mode" "-B" "-e" "-V" +CheckLastExitCode diff --git a/appveyor.yml b/appveyor.yml index 0f55aa4..476843b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,13 +13,5 @@ install: - set JAVA_HOME=C:\Program Files\Java\jdk1.8.0 - set PATH=%JAVA_HOME%\bin;%PATH%;C:\bin\apache-maven-%MAVEN_VERSION%\bin -environment: - matrix: - - RUN: ci - - RUN: it - SQ_VERSION: DEV - - RUN: it - SQ_VERSION: LTS - build_script: - ps: ./appveyor.ps1 -- 2.39.5