CI: Introduce build-frontend-packages step (#45824)
* Split frontend build * Fix command name * Update grabpl
This commit is contained in:
@@ -5,7 +5,6 @@ load(
|
||||
'lint_frontend_step',
|
||||
'codespell_step',
|
||||
'shellcheck_step',
|
||||
'build_frontend_step',
|
||||
'test_frontend_step',
|
||||
'build_storybook_step',
|
||||
'build_frontend_docs_step',
|
||||
|
||||
@@ -12,6 +12,7 @@ load(
|
||||
'test_frontend_step',
|
||||
'build_backend_step',
|
||||
'build_frontend_step',
|
||||
'build_frontend_package_step',
|
||||
'build_plugins_step',
|
||||
'package_step',
|
||||
'grafana_server_step',
|
||||
@@ -79,6 +80,7 @@ def get_steps(edition, is_downstream=False):
|
||||
enterprise_downstream_step(edition=edition),
|
||||
build_backend_step(edition=edition, ver_mode=ver_mode, is_downstream=is_downstream),
|
||||
build_frontend_step(edition=edition, ver_mode=ver_mode, is_downstream=is_downstream),
|
||||
build_frontend_package_step(edition=edition, ver_mode=ver_mode, is_downstream=is_downstream),
|
||||
build_plugins_step(edition=edition, sign=True),
|
||||
validate_scuemata_step(),
|
||||
ensure_cuetsified_step(),
|
||||
|
||||
@@ -9,6 +9,7 @@ load(
|
||||
'shellcheck_step',
|
||||
'build_backend_step',
|
||||
'build_frontend_step',
|
||||
'build_frontend_package_step',
|
||||
'build_plugins_step',
|
||||
'test_backend_step',
|
||||
'test_backend_integration_step',
|
||||
@@ -71,6 +72,7 @@ def pr_pipelines(edition):
|
||||
build_steps = [
|
||||
build_backend_step(edition=edition, ver_mode=ver_mode, variants=variants),
|
||||
build_frontend_step(edition=edition, ver_mode=ver_mode),
|
||||
build_frontend_package_step(edition=edition, ver_mode=ver_mode),
|
||||
build_plugins_step(edition=edition),
|
||||
validate_scuemata_step(),
|
||||
ensure_cuetsified_step(),
|
||||
|
||||
@@ -16,6 +16,7 @@ load(
|
||||
'test_frontend_step',
|
||||
'build_backend_step',
|
||||
'build_frontend_step',
|
||||
'build_frontend_package_step',
|
||||
'build_plugins_step',
|
||||
'package_step',
|
||||
'grafana_server_step',
|
||||
@@ -179,6 +180,7 @@ def get_steps(edition, ver_mode):
|
||||
build_steps = [
|
||||
build_backend_step(edition=edition, ver_mode=ver_mode),
|
||||
build_frontend_step(edition=edition, ver_mode=ver_mode),
|
||||
build_frontend_package_step(edition=edition, ver_mode=ver_mode),
|
||||
build_plugins_step(edition=edition, sign=True),
|
||||
validate_scuemata_step(),
|
||||
ensure_cuetsified_step(),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
load('scripts/drone/vault.star', 'from_secret', 'github_token', 'pull_secret', 'drone_token', 'prerelease_bucket')
|
||||
|
||||
grabpl_version = 'v2.9.5'
|
||||
grabpl_version = 'v2.9.7'
|
||||
build_image = 'grafana/build-container:1.5.1'
|
||||
publish_image = 'grafana/grafana-ci-deploy:1.3.1'
|
||||
deploy_docker_image = 'us.gcr.io/kubernetes-dev/drone/plugins/deploy-image'
|
||||
@@ -241,6 +241,7 @@ def build_storybook_step(edition, ver_mode):
|
||||
'depends_on': [
|
||||
# Best to ensure that this step doesn't mess with what's getting built and packaged
|
||||
'build-frontend',
|
||||
'build-frontend-packages',
|
||||
],
|
||||
'environment': {
|
||||
'NODE_OPTIONS': '--max_old_space_size=4096',
|
||||
@@ -421,6 +422,36 @@ def build_frontend_step(edition, ver_mode, is_downstream=False):
|
||||
'commands': cmds,
|
||||
}
|
||||
|
||||
def build_frontend_package_step(edition, ver_mode, is_downstream=False):
|
||||
if not is_downstream:
|
||||
build_no = '${DRONE_BUILD_NUMBER}'
|
||||
else:
|
||||
build_no = '$${SOURCE_BUILD_NUMBER}'
|
||||
|
||||
# TODO: Use percentage for num jobs
|
||||
if ver_mode == 'release':
|
||||
cmds = [
|
||||
'./bin/grabpl build-frontend-packages --jobs 8 --github-token $${GITHUB_TOKEN} ' + \
|
||||
'--edition {} --no-pull-enterprise ${{DRONE_TAG}}'.format(edition),
|
||||
]
|
||||
else:
|
||||
cmds = [
|
||||
'./bin/grabpl build-frontend-packages --jobs 8 --edition {} '.format(edition) + \
|
||||
'--build-id {} --no-pull-enterprise'.format(build_no),
|
||||
]
|
||||
|
||||
return {
|
||||
'name': 'build-frontend-packages',
|
||||
'image': build_image,
|
||||
'depends_on': [
|
||||
'initialize',
|
||||
],
|
||||
'environment': {
|
||||
'NODE_OPTIONS': '--max_old_space_size=8192',
|
||||
},
|
||||
'commands': cmds,
|
||||
}
|
||||
|
||||
|
||||
def build_frontend_docs_step(edition):
|
||||
return {
|
||||
@@ -607,6 +638,7 @@ def package_step(edition, ver_mode, include_enterprise2=False, variants=None, is
|
||||
'build-plugins',
|
||||
'build-backend',
|
||||
'build-frontend',
|
||||
'build-frontend-packages',
|
||||
]
|
||||
if include_enterprise2:
|
||||
sfx = '-enterprise2'
|
||||
@@ -682,6 +714,7 @@ def grafana_server_step(edition, port=3001):
|
||||
'build-plugins',
|
||||
'build-backend',
|
||||
'build-frontend',
|
||||
'build-frontend-packages',
|
||||
],
|
||||
'environment': environment,
|
||||
'commands': [
|
||||
|
||||
Reference in New Issue
Block a user