diff options
author | Julien Carsique <julien.carsique@sonarsource.com> | 2023-12-27 19:01:16 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-01-23 20:04:15 +0000 |
commit | d26c2ca7db6af4b2cfc24d3f560e5354d0692f9e (patch) | |
tree | a97d938a49630b8ed3c61ccc22dbb8eb52978deb /.cirrus.star | |
parent | 29f0fde0bf04408dd3c35d5122bacda8289e6926 (diff) | |
download | sonarqube-d26c2ca7db6af4b2cfc24d3f560e5354d0692f9e.tar.gz sonarqube-d26c2ca7db6af4b2cfc24d3f560e5354d0692f9e.zip |
BUILD-3755 migrate Travis to Cirrus CI
Diffstat (limited to '.cirrus.star')
-rw-r--r-- | .cirrus.star | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/.cirrus.star b/.cirrus.star index 28b17b70fc3..ae0a6b69209 100644 --- a/.cirrus.star +++ b/.cirrus.star @@ -1,4 +1,22 @@ load("github.com/SonarSource/cirrus-modules@v2", "load_features") +load("cirrus", "env", "fs", "yaml") + def main(ctx): - return load_features(ctx) + if env.get("CIRRUS_REPO_FULL_NAME") == 'SonarSource/sonar-enterprise': + features = yaml.dumps(load_features(ctx, only_if=dict())) + doc = fs.read("private/.cirrus.yml") + else: + if env.get("CIRRUS_USER_PERMISSION") in ["write", "admin"]: + features = yaml.dumps(load_features(ctx, features=["build_number"])) + else: + # workaround for BUILD-4413 (build number on public CI) + features = yaml.dumps( + { + 'env': { + 'CI_BUILD_NUMBER': env.get("CIRRUS_PR", "1") + }, + } + ) + doc = fs.read(".cirrus/.cirrus.yml") + return features + doc |