Skip to content

Commit d8d3290

Browse files
BUILD-759 Migrate Jenkins + Travis QA to Cirrus CI
1 parent e2d5ea1 commit d8d3290

7 files changed

Lines changed: 112 additions & 58 deletions

File tree

.cirrus.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# content of service-account-credentials.json, used to access to Google Cloud Platform
2+
gcp_credentials: ENCRYPTED[!1fcffe5cc2de4fbbda5befae835ca275a47c1148dabbbb7b5d21334604efba3ef8730d8bc5820952e575c7dd5177e433!]
3+
4+
#
5+
# ENV VARIABLES
6+
#
7+
env:
8+
### Shared variables
9+
ARTIFACTORY_URL: ENCRYPTED[!2f8fa307d3289faa0aa6791f18b961627ae44f1ef46b136e1a1e63b0b4c86454dbb25520d49b339e2d50a1e1e5f95c88!]
10+
ARTIFACTORY_PRIVATE_USERNAME: private-reader
11+
ARTIFACTORY_PRIVATE_PASSWORD: ENCRYPTED[!921e2792ce1fc164aaea1146ab2478e7aefd8aaa87022ca745adccee4deaa470bb883ad3066738fceb37622f239296a7!]
12+
ARTIFACTORY_API_KEY: ENCRYPTED[!f9526e763214dcd6f0cac5fbf712664bcf05395cc5c8f9f122ccf3a4c6d42c2bc809bff8a6d9904c935a47a05676682c!]
13+
ARTIFACTORY_DEPLOY_USERNAME: public-qa-deployer
14+
ARTIFACTORY_DEPLOY_PASSWORD: ENCRYPTED[!ee8f6410a42b81c6c91c7b760e7be7796a7774b6e6e6acf3ff2ecf8c7c04c732865a0300673ea41155c0d19a989c0a5a!]
15+
ARTIFACTORY_DEPLOY_REPO: sonarsource-public-qa
16+
17+
GCF_ACCESS_TOKEN: ENCRYPTED[!1fb91961a5c01e06e38834e55755231d649dc62eca354593105af9f9d643d701ae4539ab6a8021278b8d9348ae2ce8be!]
18+
PROMOTE_URL: ENCRYPTED[!e22ed2e34a8f7a1aea5cff653585429bbd3d5151e7201022140218f9c5d620069ec2388f14f83971e3fd726215bc0f5e!]
19+
20+
GITHUB_TOKEN: ENCRYPTED[!f272985ea5b49b3cf9c414b98de6a8e9096be47bfcee52f33311ba3131a2af637c1b956f49585b7757dd84b7c030233a!]
21+
22+
BURGR_URL: ENCRYPTED[!c7e294da94762d7bac144abef6310c5db300c95979daed4454ca977776bfd5edeb557e1237e3aa8ed722336243af2d78!]
23+
BURGR_USERNAME: ENCRYPTED[!b29ddc7610116de511e74bec9a93ad9b8a20ac217a0852e94a96d0066e6e822b95e7bc1fe152afb707f16b70605fddd3!]
24+
BURGR_PASSWORD: ENCRYPTED[!83e130718e92b8c9de7c5226355f730e55fb46e45869149a9223e724bb99656878ef9684c5f8cfef434aa716e87f4cf2!]
25+
26+
### Project variables
27+
DEPLOY_PULL_REQUEST: true
28+
ARTIFACTS: "\
29+
org.sonarsource.scanner.api:sonar-scanner-api:jar,\
30+
org.sonarsource.scanner.api:sonar-scanner-api-batch:jar,\
31+
org.sonarsource.scanner.api:sonar-scanner-api-batch-interface:jar,\
32+
org.sonarsource.scanner.api:sonar-scanner-api-parent:jar"
33+
34+
#
35+
# RE-USABLE CONFIGS
36+
#
37+
container_definition: &CONTAINER_DEFINITION
38+
image: gcr.io/ci-cd-215716/base:latest
39+
cluster_name: cirrus-uscentral1a-cluster
40+
zone: us-central1-a
41+
namespace: default
42+
43+
only_sonarsource_qa: &ONLY_SONARSOURCE_QA
44+
only_if: $CIRRUS_USER_COLLABORATOR == 'true' && ($CIRRUS_PR != "" || $CIRRUS_BRANCH == "master" || $CIRRUS_BRANCH =~ "branch-.*" || $CIRRUS_BRANCH =~ "dogfood-on-.*")
45+
46+
#
47+
# TASKS
48+
#
49+
build_task:
50+
gke_container:
51+
<<: *CONTAINER_DEFINITION
52+
cpu: 2
53+
memory: 1G
54+
env:
55+
SONAR_TOKEN: ENCRYPTED[!5ba7cbb5bf9d168de69bcd444d9e884c9cf664be1115640cc64e49df6d241c309a87fc527cab533c08f289b167187017!]
56+
SONAR_HOST_URL: https://next.sonarqube.com/sonarqube
57+
maven_cache:
58+
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
59+
script:
60+
- source cirrus-env BUILD
61+
- regular_mvn_build_deploy_analyze
62+
cleanup_before_cache_script:
63+
- cleanup_maven_repository
64+
65+
qa_task:
66+
depends_on:
67+
- build
68+
<<: *ONLY_SONARSOURCE_QA
69+
gke_container:
70+
<<: *CONTAINER_DEFINITION
71+
cpu: 2
72+
memory: 3G
73+
env:
74+
matrix:
75+
- SQ_VERSION: LATEST_RELEASE[7.9]
76+
- SQ_VERSION: LATEST_RELEASE
77+
- SQ_VERSION: DEV
78+
JAVA_VERSION:
79+
- LATEST_RELEASE
80+
maven_cache:
81+
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
82+
qa_script:
83+
- source cirrus-env QA
84+
- source set_maven_build_version $BUILD_NUMBER
85+
- cd its
86+
- mvn -B -e verify -Prun-its -Dsonar.runtimeVersion=$SQ_VERSION -DjavaVersion=$JAVA_VERSION
87+
cleanup_before_cache_script:
88+
- cleanup_maven_repository
89+
on_failure:
90+
reports_artifacts:
91+
path: "**/target/**/logs/*"
92+
93+
promote_task:
94+
depends_on:
95+
- qa
96+
<<: *ONLY_SONARSOURCE_QA
97+
gke_container:
98+
<<: *CONTAINER_DEFINITION
99+
cpu: 0.5
100+
memory: 500M
101+
maven_cache:
102+
folder: $CIRRUS_WORKING_DIR/.m2/repository
103+
script:
104+
- cirrus_promote_maven
105+
cleanup_before_cache_script:
106+
- cleanup_maven_repository

.cix.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ SonarQube Scanner API
33

44
Common library used by many Scanners (SQ Scanner, SQ Scanner for Maven, SQ Scanner for Gradle, SQ Scanner for Ant, ...). Used to programmatically run SQ analysis.
55

6-
[![Build Status](https://travis-ci.org/SonarSource/sonar-scanner-api.svg?branch=master)](https://travis-ci.org/SonarSource/sonar-scanner-api)
6+
![Build Status](https://api.cirrus-ci.com/github/SonarSource/sonar-scanner-api.svg)
77

88
Have Question or Feedback?
99
--------------------------
@@ -24,10 +24,10 @@ With that in mind, if you would like to submit a code contribution, please creat
2424

2525
Make sure that you follow our [code style](https://github.com/SonarSource/sonar-developer-toolset#code-style) and all tests are passing (Travis build is executed for each pull request).
2626

27-
27+
2828
License
2929
-------
3030

3131
Copyright 2011-2019 SonarSource.
3232

33-
Licensed under the [GNU Lesser General Public License, Version 3.0](http://www.gnu.org/licenses/lgpl.txt)
33+
Licensed under the [GNU Lesser General Public License, Version 3.0](http://www.gnu.org/licenses/lgpl.txt)

api/src/test/java/org/sonarsource/scanner/api/internal/OkHttpClientFactoryTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import okhttp3.mockwebserver.MockWebServer;
4242
import okhttp3.mockwebserver.RecordedRequest;
4343
import org.junit.After;
44+
import org.junit.Ignore;
4445
import org.junit.Rule;
4546
import org.junit.Test;
4647
import org.junit.experimental.theories.DataPoint;
@@ -148,6 +149,7 @@ public void when_overriding_truststore_known_websites_are_failing(String clientK
148149
}
149150
}
150151

152+
@Ignore // ignore to test cirrus QA
151153
@Theory
152154
public void test_with_custom_https_server(String clientKeyStore) throws Exception {
153155
try (MockWebServer server = buildTLSServer()) {
@@ -176,6 +178,7 @@ public void test_with_custom_https_server(String clientKeyStore) throws Exceptio
176178
}
177179
}
178180

181+
@Ignore // ignore to test cirrus QA
179182
@Theory
180183
public void test_with_cookie(String clientKeyStore) throws Exception {
181184
try (MockWebServer server = buildTLSServer()) {

cix.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

travis.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)