CI: add the grabpl build-backend command into the repo (#52673)

* Move the grabpl build-backend command and clean it up a bit
This commit is contained in:
Kevin Minehart
2022-07-28 10:11:22 -04:00
committed by GitHub
parent f215a35caf
commit d567f199dd
35 changed files with 1720 additions and 49 deletions
+6 -2
View File
@@ -42,7 +42,8 @@ load(
'verify_gen_cue_step',
'publish_images_step',
'trigger_oss',
'artifacts_page_step'
'artifacts_page_step',
'compile_build_cmd',
)
load(
@@ -59,6 +60,7 @@ load(
'failure_template',
'drone_change_template',
)
load('scripts/drone/vault.star', 'from_secret', 'github_token', 'pull_secret', 'drone_token', 'prerelease_bucket')
def store_npm_packages_step():
@@ -162,6 +164,7 @@ def get_steps(edition, ver_mode):
verify_gen_cue_step(edition),
wire_install_step(),
yarn_install_step(),
compile_build_cmd(),
]
test_steps = []
@@ -302,7 +305,8 @@ def get_enterprise_pipelines(trigger, ver_mode):
download_grabpl_step(),
identify_runner_step(),
clone_enterprise_step(ver_mode),
init_enterprise_step(ver_mode)
init_enterprise_step(ver_mode),
compile_build_cmd(),
]
for step in [wire_install_step(), yarn_install_step(), gen_version_step(ver_mode), verify_gen_cue_step(edition)]:
step.update(deps_on_clone_enterprise_step)
+37 -35
View File
@@ -1,41 +1,42 @@
load(
'scripts/drone/steps/lib.star',
'download_grabpl_step',
'build_image',
'identify_runner_step',
'gen_version_step',
'wire_install_step',
'yarn_install_step',
'build_backend_step',
'build_frontend_step',
'build_frontend_package_step',
'build_plugins_step',
'package_step',
'grafana_server_step',
'e2e_tests_step',
'e2e_tests_artifacts',
'build_storybook_step',
'copy_packages_for_docker_step',
'build_docker_images_step',
'publish_images_step',
'postgres_integration_tests_step',
'mysql_integration_tests_step',
'redis_integration_tests_step',
'memcached_integration_tests_step',
'get_windows_steps',
'benchmark_ldap_step',
'enterprise_downstream_step',
'frontend_metrics_step',
'store_storybook_step',
'release_canary_npm_packages_step',
'upload_packages_step',
'store_packages_step',
'upload_cdn_step',
'verify_gen_cue_step',
'test_a11y_frontend_step',
'trigger_oss',
'betterer_frontend_step',
'trigger_test_release'
'build_image',
'identify_runner_step',
'gen_version_step',
'wire_install_step',
'yarn_install_step',
'build_backend_step',
'build_frontend_step',
'build_frontend_package_step',
'build_plugins_step',
'package_step',
'grafana_server_step',
'e2e_tests_step',
'e2e_tests_artifacts',
'build_storybook_step',
'copy_packages_for_docker_step',
'build_docker_images_step',
'publish_images_step',
'postgres_integration_tests_step',
'mysql_integration_tests_step',
'redis_integration_tests_step',
'memcached_integration_tests_step',
'get_windows_steps',
'benchmark_ldap_step',
'enterprise_downstream_step',
'frontend_metrics_step',
'store_storybook_step',
'release_canary_npm_packages_step',
'upload_packages_step',
'store_packages_step',
'upload_cdn_step',
'verify_gen_cue_step',
'test_a11y_frontend_step',
'trigger_oss',
'betterer_frontend_step',
'trigger_test_release',
'compile_build_cmd',
)
load(
@@ -48,6 +49,7 @@ def build_e2e(trigger, ver_mode, edition):
init_steps = [
identify_runner_step(),
download_grabpl_step(),
compile_build_cmd(),
gen_version_step(ver_mode),
verify_gen_cue_step(edition="oss"),
wire_install_step(),
+2
View File
@@ -12,6 +12,7 @@ load(
'build_frontend_docs_step',
'build_frontend_package_step',
'build_docs_website_step',
'compile_build_cmd',
)
load(
@@ -37,6 +38,7 @@ def docs_pipelines(edition, ver_mode, trigger):
build_frontend_package_step(edition=edition, ver_mode=ver_mode),
build_frontend_docs_step(edition=edition),
build_docs_website_step(),
compile_build_cmd(),
]
return pipeline(
@@ -6,6 +6,7 @@ load(
'wire_install_step',
'postgres_integration_tests_step',
'mysql_integration_tests_step',
'compile_build_cmd',
)
load(
@@ -25,6 +26,7 @@ def integration_tests(trigger, ver_mode, edition):
volumes = integration_test_services_volumes()
init_steps = [
download_grabpl_step(),
compile_build_cmd(),
identify_runner_step(),
verify_gen_cue_step(edition="oss"),
wire_install_step(),
+3 -1
View File
@@ -3,7 +3,8 @@ load(
'identify_runner_step',
'gen_version_step',
'download_grabpl_step',
'store_packages_step'
'store_packages_step',
'compile_build_cmd',
)
load(
@@ -15,6 +16,7 @@ def publish(trigger, ver_mode, edition):
steps = [
download_grabpl_step(),
gen_version_step(ver_mode),
compile_build_cmd(),
identify_runner_step(),
store_packages_step(edition=edition, ver_mode=ver_mode),
]
@@ -11,6 +11,7 @@ load(
'test_backend_step',
'test_backend_integration_step',
'verify_gen_cue_step',
'compile_build_cmd',
)
load(
@@ -22,6 +23,7 @@ def test_backend(trigger, ver_mode):
init_steps = [
identify_runner_step(),
download_grabpl_step(),
compile_build_cmd(),
gen_version_step(ver_mode),
verify_gen_cue_step(edition="oss"),
wire_install_step(),
@@ -7,6 +7,7 @@ load(
'lint_frontend_step',
'betterer_frontend_step',
'test_frontend_step',
'compile_build_cmd',
)
load(
@@ -20,6 +21,7 @@ def test_frontend(trigger, ver_mode):
download_grabpl_step(),
gen_version_step(ver_mode),
yarn_install_step(),
compile_build_cmd(),
]
test_steps = [
lint_frontend_step(),
+15 -2
View File
@@ -376,14 +376,14 @@ def build_backend_step(edition, ver_mode, variants=None):
# TODO: Convert number of jobs to percentage
if ver_mode == 'release':
cmds = [
'./bin/grabpl build-backend --jobs 8 --edition {} ${{DRONE_TAG}}'.format(
'./bin/build build-backend --jobs 8 --edition {} ${{DRONE_TAG}}'.format(
edition,
),
]
else:
build_no = '${DRONE_BUILD_NUMBER}'
cmds = [
'./bin/grabpl build-backend --jobs 8 --edition {} --build-id {}{}'.format(
'./bin/build build-backend --jobs 8 --edition {} --build-id {}{}'.format(
edition, build_no, variants_str,
),
]
@@ -394,6 +394,7 @@ def build_backend_step(edition, ver_mode, variants=None):
'depends_on': [
'gen-version',
'wire-install',
'compile-build-cmd',
],
'commands': cmds,
}
@@ -1211,3 +1212,15 @@ def end_to_end_tests_deps(edition):
'end-to-end-tests-smoke-tests-suite' + enterprise2_suffix(edition),
'end-to-end-tests-various-suite' + enterprise2_suffix(edition),
]
def compile_build_cmd():
return {
'name': 'compile-build-cmd',
'image': 'golang:1.17',
'commands': [
"go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd",
],
'environment': {
'CGO_ENABLED': 0,
},
}