Skip to content

Commit

Permalink
SONARPHP-1523 Reformat files
Browse files Browse the repository at this point in the history
  • Loading branch information
GabinL21 committed Nov 6, 2024
1 parent ec6625e commit 9d6f110
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 111 deletions.
32 changes: 16 additions & 16 deletions .cirrus/modules/env.star
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
load(
"github.com/SonarSource/cirrus-modules/cloud-native/env.star@analysis/master",
"artifactory_env",
"cirrus_env",
"gradle_signing_env",
"next_env",
"gradle_env",
"github.com/SonarSource/cirrus-modules/cloud-native/env.star@analysis/master",
"artifactory_env",
"cirrus_env",
"gradle_signing_env",
"next_env",
"gradle_env",
)


def project_version_env():
return {
"PROJECT_VERSION_CACHE_DIR": "project-version",
}
return {
"PROJECT_VERSION_CACHE_DIR": "project-version",
}


def env():
vars = artifactory_env()
vars |= cirrus_env(depth=1)
vars |= gradle_env()
vars |= gradle_signing_env()
vars |= next_env()
vars |= project_version_env()
return {"env": vars}
vars = artifactory_env()
vars |= cirrus_env(depth=1)
vars |= gradle_env()
vars |= gradle_signing_env()
vars |= next_env()
vars |= project_version_env()
return {"env": vars}
42 changes: 21 additions & 21 deletions .cirrus/modules/promote.star
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
load("github.com/SonarSource/cirrus-modules/cloud-native/env.star@analysis/master","promotion_env")
load("github.com/SonarSource/cirrus-modules/cloud-native/env.star@analysis/master", "promotion_env")
load("github.com/SonarSource/cirrus-modules/cloud-native/platform.star@analysis/master", "base_image_container_builder")
load("github.com/SonarSource/cirrus-modules/cloud-native/cache.star@analysis/master", "project_version_cache")
load("github.com/SonarSource/cirrus-modules/cloud-native/conditions.star@analysis/master", "is_branch_qa_eligible")


def promote_script():
return [
"source cirrus-env PROMOTE",
"cirrus_jfrog_promote multi",
"source ${PROJECT_VERSION_CACHE_DIR}/evaluated_project_version.txt",
"github-notify-promotion",
]
return [
"source cirrus-env PROMOTE",
"cirrus_jfrog_promote multi",
"source ${PROJECT_VERSION_CACHE_DIR}/evaluated_project_version.txt",
"github-notify-promotion",
]


def promote_task():
return {
"promote_task": {
"only_if": is_branch_qa_eligible(),
"depends_on": [
"build",
"qa_os_win",
"qa_ruling",
"qa_plugin"
],
"env": promotion_env(),
"eks_container": base_image_container_builder(cpu=1, memory="2G"),
"project_version_cache": project_version_cache(),
"script": promote_script()
}
return {
"promote_task": {
"only_if": is_branch_qa_eligible(),
"depends_on": [
"build",
"qa_os_win",
"qa_ruling",
"qa_plugin"
],
"env": promotion_env(),
"eks_container": base_image_container_builder(cpu=1, memory="2G"),
"project_version_cache": project_version_cache(),
"script": promote_script()
}
}
148 changes: 74 additions & 74 deletions .cirrus/modules/qa.star
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ load("github.com/SonarSource/cirrus-modules/cloud-native/conditions.star@analysi
load("github.com/SonarSource/cirrus-modules/cloud-native/env.star@analysis/master", "artifactory_reader_env")
load("build.star", "profile_report_artifacts")
load(
"github.com/SonarSource/cirrus-modules/cloud-native/cache.star@analysis/master",
"gradle_cache",
"cleanup_gradle_script",
"gradle_wrapper_cache",
"orchestrator_cache",
"set_orchestrator_home_script",
"mkdir_orchestrator_home_script",
"github.com/SonarSource/cirrus-modules/cloud-native/cache.star@analysis/master",
"gradle_cache",
"cleanup_gradle_script",
"gradle_wrapper_cache",
"orchestrator_cache",
"set_orchestrator_home_script",
"mkdir_orchestrator_home_script",
)

QA_PLUGIN_GRADLE_TASK = "its:plugin:tests:integrationTest"
Expand All @@ -20,77 +20,77 @@ QA_QUBE_LATEST_RELEASE = "LATEST_RELEASE"


def on_failure():
return default_gradle_on_failure() | {
"junit_artifacts": {
"path": "**/test-results/**/*.xml",
"format": "junit"
}
return default_gradle_on_failure() | {
"junit_artifacts": {
"path": "**/test-results/**/*.xml",
"format": "junit"
}
}


#
# Windows
#

def qa_win_script():
return [
"git config --global core.autocrlf input",
"source cirrus-env CI",
"./gradlew ${GRADLE_COMMON_FLAGS} test"
]
return [
"git config --global core.autocrlf input",
"source cirrus-env CI",
"./gradlew ${GRADLE_COMMON_FLAGS} test"
]


def qa_os_win_task():
return {
"qa_os_win_task": {
"only_if": is_branch_qa_eligible(),
"depends_on": "build",
"ec2_instance": ec2_instance_builder(),
"env": artifactory_reader_env(),
"gradle_cache": gradle_cache(),
"gradle_wrapper_cache": gradle_wrapper_cache(),
"build_script": qa_win_script(),
"on_success": profile_report_artifacts(),
"on_failure": on_failure(),
}
return {
"qa_os_win_task": {
"only_if": is_branch_qa_eligible(),
"depends_on": "build",
"ec2_instance": ec2_instance_builder(),
"env": artifactory_reader_env(),
"gradle_cache": gradle_cache(),
"gradle_wrapper_cache": gradle_wrapper_cache(),
"build_script": qa_win_script(),
"on_success": profile_report_artifacts(),
"on_failure": on_failure(),
}
}


#
# Commons
#

def qa_task(env, run_its_script):
return {
"only_if": is_branch_qa_eligible(),
"depends_on": "build",
"eks_container": base_image_container_builder(cpu=4, memory="10G"),
"env": env,
"gradle_cache": gradle_cache(),
"gradle_wrapper_cache": gradle_wrapper_cache(),
"set_orchestrator_home_script": set_orchestrator_home_script(),
"mkdir_orchestrator_home_script": mkdir_orchestrator_home_script(),
"orchestrator_cache": orchestrator_cache(),
"run_its_script": run_its_script,
"on_failure": on_failure(),
"cleanup_gradle_script": cleanup_gradle_script(),
}
return {
"only_if": is_branch_qa_eligible(),
"depends_on": "build",
"eks_container": base_image_container_builder(cpu=4, memory="10G"),
"env": env,
"gradle_cache": gradle_cache(),
"gradle_wrapper_cache": gradle_wrapper_cache(),
"set_orchestrator_home_script": set_orchestrator_home_script(),
"mkdir_orchestrator_home_script": mkdir_orchestrator_home_script(),
"orchestrator_cache": orchestrator_cache(),
"run_its_script": run_its_script,
"on_failure": on_failure(),
"cleanup_gradle_script": cleanup_gradle_script(),
}


#
# Plugin
#

def qa_plugin_env():
return {
"GRADLE_TASK": QA_PLUGIN_GRADLE_TASK,
"KEEP_ORCHESTRATOR_RUNNING": "true",
"matrix": [
{"SQ_VERSION": QA_QUBE_LATEST_RELEASE},
{"SQ_VERSION": "DEV"},
],
"GITHUB_TOKEN": "VAULT[development/github/token/licenses-ro token]",
}
return {
"GRADLE_TASK": QA_PLUGIN_GRADLE_TASK,
"KEEP_ORCHESTRATOR_RUNNING": "true",
"matrix": [
{"SQ_VERSION": QA_QUBE_LATEST_RELEASE},
{"SQ_VERSION": "DEV"},
],
"GITHUB_TOKEN": "VAULT[development/github/token/licenses-ro token]",
}


def qa_plugin_script():
Expand All @@ -103,32 +103,32 @@ def qa_plugin_script():


def qa_plugin_task():
return {
"qa_plugin_task": qa_task(qa_plugin_env(), qa_plugin_script())
}
return {
"qa_plugin_task": qa_task(qa_plugin_env(), qa_plugin_script())
}


#
# Ruling
#

def qa_ruling_env():
return {
"GRADLE_TASK": QA_RULING_GRADLE_TASK,
"SQ_VERSION": QA_QUBE_LATEST_RELEASE,
"KEEP_ORCHESTRATOR_RUNNING": "true",
"matrix": [
{"PHP_PROJECT": "Flysystem"},
{"PHP_PROJECT": "Monica"},
{"PHP_PROJECT": "PhpCodeSniffer"},
{"PHP_PROJECT": "PhpMailer"},
{"PHP_PROJECT": "Psysh"},
{"PHP_PROJECT": "PhpWord"},
{"PHP_PROJECT": "RubixML"},
{"PHP_PROJECT": "PhpSpreadsheet"},
],
"GITHUB_TOKEN": "VAULT[development/github/token/licenses-ro token]",
}
return {
"GRADLE_TASK": QA_RULING_GRADLE_TASK,
"SQ_VERSION": QA_QUBE_LATEST_RELEASE,
"KEEP_ORCHESTRATOR_RUNNING": "true",
"matrix": [
{"PHP_PROJECT": "Flysystem"},
{"PHP_PROJECT": "Monica"},
{"PHP_PROJECT": "PhpCodeSniffer"},
{"PHP_PROJECT": "PhpMailer"},
{"PHP_PROJECT": "Psysh"},
{"PHP_PROJECT": "PhpWord"},
{"PHP_PROJECT": "RubixML"},
{"PHP_PROJECT": "PhpSpreadsheet"},
],
"GITHUB_TOKEN": "VAULT[development/github/token/licenses-ro token]",
}


def qa_ruling_script():
Expand All @@ -141,9 +141,9 @@ def qa_ruling_script():


def qa_ruling_task():
return {
"qa_ruling_task": qa_task(qa_ruling_env(), qa_ruling_script())
}
return {
"qa_ruling_task": qa_task(qa_ruling_env(), qa_ruling_script())
}


#
Expand Down

0 comments on commit 9d6f110

Please sign in to comment.