2020-10-07 07:22:15 -05:00
|
|
|
load(
|
2021-09-07 04:15:04 -05:00
|
|
|
'scripts/drone/steps/lib.star',
|
2021-11-17 03:25:55 -06:00
|
|
|
'download_grabpl_step',
|
|
|
|
'initialize_step',
|
2021-11-15 11:14:33 -06:00
|
|
|
'lint_drone_step',
|
2020-10-07 07:22:15 -05:00
|
|
|
'lint_backend_step',
|
2021-09-30 02:56:08 -05:00
|
|
|
'lint_frontend_step',
|
2020-10-07 07:22:15 -05:00
|
|
|
'codespell_step',
|
|
|
|
'shellcheck_step',
|
|
|
|
'build_backend_step',
|
|
|
|
'build_frontend_step',
|
|
|
|
'build_plugins_step',
|
2021-08-24 10:07:06 -05:00
|
|
|
'test_backend_step',
|
2021-10-11 04:23:55 -05:00
|
|
|
'test_backend_integration_step',
|
2021-08-24 10:07:06 -05:00
|
|
|
'test_frontend_step',
|
2020-10-07 07:22:15 -05:00
|
|
|
'package_step',
|
|
|
|
'e2e_tests_server_step',
|
|
|
|
'e2e_tests_step',
|
2021-12-24 03:43:32 -06:00
|
|
|
'e2e_tests_artifacts',
|
2020-10-07 07:22:15 -05:00
|
|
|
'build_storybook_step',
|
2020-10-14 07:35:55 -05:00
|
|
|
'build_frontend_docs_step',
|
2020-10-07 07:22:15 -05:00
|
|
|
'build_docs_website_step',
|
|
|
|
'copy_packages_for_docker_step',
|
|
|
|
'build_docker_images_step',
|
|
|
|
'postgres_integration_tests_step',
|
|
|
|
'mysql_integration_tests_step',
|
2021-04-06 08:50:54 -05:00
|
|
|
'redis_integration_tests_step',
|
2021-04-07 08:06:10 -05:00
|
|
|
'memcached_integration_tests_step',
|
2020-10-07 07:22:15 -05:00
|
|
|
'benchmark_ldap_step',
|
2021-09-07 02:21:49 -05:00
|
|
|
'validate_scuemata_step',
|
2021-10-08 07:47:55 -05:00
|
|
|
'ensure_cuetsified_step',
|
2021-11-10 06:35:03 -06:00
|
|
|
'test_a11y_frontend_step',
|
2021-09-07 02:21:49 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
load(
|
2021-09-07 04:15:04 -05:00
|
|
|
'scripts/drone/services/services.star',
|
2020-10-07 07:22:15 -05:00
|
|
|
'integration_test_services',
|
2021-12-15 06:48:59 -06:00
|
|
|
'integration_test_services_volumes',
|
2021-09-07 02:21:49 -05:00
|
|
|
'ldap_service',
|
|
|
|
)
|
|
|
|
|
|
|
|
load(
|
2021-09-07 04:15:04 -05:00
|
|
|
'scripts/drone/utils/utils.star',
|
2021-11-29 12:08:13 -06:00
|
|
|
'notify_pipeline',
|
2021-09-07 02:21:49 -05:00
|
|
|
'pipeline',
|
2021-11-29 12:08:13 -06:00
|
|
|
'failure_template',
|
|
|
|
'drone_change_template',
|
2020-10-07 07:22:15 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
ver_mode = 'pr'
|
|
|
|
|
|
|
|
def pr_pipelines(edition):
|
2021-04-06 08:50:54 -05:00
|
|
|
services = integration_test_services(edition)
|
2021-12-15 06:48:59 -06:00
|
|
|
volumes = integration_test_services_volumes()
|
2021-09-10 09:10:47 -05:00
|
|
|
variants = ['linux-x64', 'linux-x64-musl', 'osx64', 'win64', 'armv6',]
|
2021-01-06 06:22:20 -06:00
|
|
|
include_enterprise2 = edition == 'enterprise'
|
2021-11-17 03:25:55 -06:00
|
|
|
test_steps = [
|
2021-11-15 11:14:33 -06:00
|
|
|
lint_drone_step(),
|
2020-10-07 07:22:15 -05:00
|
|
|
codespell_step(),
|
|
|
|
shellcheck_step(),
|
2021-05-04 08:05:39 -05:00
|
|
|
lint_backend_step(edition=edition),
|
2021-09-30 02:56:08 -05:00
|
|
|
lint_frontend_step(),
|
2021-08-24 10:07:06 -05:00
|
|
|
test_backend_step(edition=edition),
|
2021-10-11 04:23:55 -05:00
|
|
|
test_backend_integration_step(edition=edition),
|
2020-10-07 07:22:15 -05:00
|
|
|
test_frontend_step(),
|
2021-11-17 03:25:55 -06:00
|
|
|
]
|
|
|
|
build_steps = [
|
2020-10-07 07:22:15 -05:00
|
|
|
build_backend_step(edition=edition, ver_mode=ver_mode, variants=variants),
|
|
|
|
build_frontend_step(edition=edition, ver_mode=ver_mode),
|
|
|
|
build_plugins_step(edition=edition),
|
2021-09-07 02:21:49 -05:00
|
|
|
validate_scuemata_step(),
|
2021-10-08 07:47:55 -05:00
|
|
|
ensure_cuetsified_step(),
|
2021-01-06 06:22:20 -06:00
|
|
|
]
|
2021-11-17 03:25:55 -06:00
|
|
|
integration_test_steps = [
|
2021-11-19 14:50:34 -06:00
|
|
|
postgres_integration_tests_step(edition=edition, ver_mode=ver_mode),
|
|
|
|
mysql_integration_tests_step(edition=edition, ver_mode=ver_mode),
|
2021-11-17 03:25:55 -06:00
|
|
|
]
|
2021-01-06 06:22:20 -06:00
|
|
|
|
|
|
|
if include_enterprise2:
|
|
|
|
edition2 = 'enterprise2'
|
2021-11-17 03:25:55 -06:00
|
|
|
build_steps.append(benchmark_ldap_step())
|
2021-01-06 06:22:20 -06:00
|
|
|
services.append(ldap_service())
|
2021-11-17 03:25:55 -06:00
|
|
|
test_steps.extend([
|
2021-05-04 08:05:39 -05:00
|
|
|
lint_backend_step(edition=edition2),
|
2021-08-24 10:07:06 -05:00
|
|
|
test_backend_step(edition=edition2),
|
2021-10-11 04:23:55 -05:00
|
|
|
test_backend_integration_step(edition=edition2),
|
2021-11-17 03:25:55 -06:00
|
|
|
])
|
|
|
|
build_steps.extend([
|
2021-01-06 06:22:20 -06:00
|
|
|
build_backend_step(edition=edition2, ver_mode=ver_mode, variants=['linux-x64']),
|
|
|
|
])
|
|
|
|
|
2021-11-17 03:25:55 -06:00
|
|
|
# Insert remaining build_steps
|
|
|
|
build_steps.extend([
|
2021-10-21 01:59:12 -05:00
|
|
|
package_step(edition=edition, ver_mode=ver_mode, include_enterprise2=include_enterprise2, variants=variants),
|
2020-12-23 08:42:20 -06:00
|
|
|
e2e_tests_server_step(edition=edition),
|
2021-11-24 04:20:11 -06:00
|
|
|
e2e_tests_step('dashboards-suite', edition=edition),
|
|
|
|
e2e_tests_step('smoke-tests-suite', edition=edition),
|
|
|
|
e2e_tests_step('panels-suite', edition=edition),
|
|
|
|
e2e_tests_step('various-suite', edition=edition),
|
2021-12-24 03:43:32 -06:00
|
|
|
e2e_tests_artifacts(edition=edition),
|
2020-10-07 07:22:15 -05:00
|
|
|
build_storybook_step(edition=edition, ver_mode=ver_mode),
|
2021-11-10 06:35:03 -06:00
|
|
|
test_a11y_frontend_step(ver_mode=ver_mode, edition=edition),
|
2020-10-14 07:35:55 -05:00
|
|
|
build_frontend_docs_step(edition=edition),
|
2020-10-07 07:22:15 -05:00
|
|
|
build_docs_website_step(),
|
|
|
|
copy_packages_for_docker_step(),
|
|
|
|
build_docker_images_step(edition=edition, ver_mode=ver_mode, archs=['amd64',]),
|
2021-01-06 06:22:20 -06:00
|
|
|
])
|
|
|
|
|
|
|
|
if include_enterprise2:
|
2021-11-17 03:25:55 -06:00
|
|
|
integration_test_steps.extend([
|
2021-11-19 14:50:34 -06:00
|
|
|
redis_integration_tests_step(edition=edition2, ver_mode=ver_mode),
|
|
|
|
memcached_integration_tests_step(edition=edition, ver_mode=ver_mode),
|
2021-11-17 03:25:55 -06:00
|
|
|
])
|
|
|
|
build_steps.extend([
|
2021-10-21 01:59:12 -05:00
|
|
|
package_step(edition=edition2, ver_mode=ver_mode, include_enterprise2=include_enterprise2, variants=['linux-x64']),
|
2020-12-23 08:42:20 -06:00
|
|
|
])
|
|
|
|
|
2020-10-07 07:22:15 -05:00
|
|
|
trigger = {
|
|
|
|
'event': ['pull_request',],
|
|
|
|
}
|
2021-11-17 03:25:55 -06:00
|
|
|
|
2020-10-07 07:22:15 -05:00
|
|
|
return [
|
|
|
|
pipeline(
|
2021-11-17 03:25:55 -06:00
|
|
|
name='pr-test', edition=edition, trigger=trigger, services=[], steps=[download_grabpl_step()] + initialize_step(edition, platform='linux', ver_mode=ver_mode)
|
|
|
|
+ test_steps,
|
|
|
|
), pipeline(
|
|
|
|
name='pr-build-e2e', edition=edition, trigger=trigger, services=[], steps=[download_grabpl_step()] + initialize_step(edition, platform='linux', ver_mode=ver_mode)
|
|
|
|
+ build_steps,
|
|
|
|
), pipeline(
|
2021-12-15 06:48:59 -06:00
|
|
|
name='pr-integration-tests', edition=edition, trigger=trigger, services=services,
|
2022-01-04 07:17:20 -06:00
|
|
|
steps=[download_grabpl_step()] + integration_test_steps,
|
2021-12-15 06:48:59 -06:00
|
|
|
volumes=volumes,
|
2020-10-07 07:22:15 -05:00
|
|
|
),
|
|
|
|
]
|