diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2016-09-08 09:40:23 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2016-09-08 09:40:23 +0200 |
commit | ec22be60678b5ff5138e5ba6d3bba2fe7a5a5fc1 (patch) | |
tree | b286999812d4e4cc1fce2ac1c010b3ed4bcc2299 /appveyor.ps1 | |
parent | 868ed758d043c7aacef7a9cdd87a897b30d47d62 (diff) | |
download | sonar-scanner-cli-ec22be60678b5ff5138e5ba6d3bba2fe7a5a5fc1.tar.gz sonar-scanner-cli-ec22be60678b5ff5138e5ba6d3bba2fe7a5a5fc1.zip |
Don't run ITs on Appveyor
Diffstat (limited to 'appveyor.ps1')
-rw-r--r-- | appveyor.ps1 | 140 |
1 files changed, 2 insertions, 138 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 |