From e5c48ac9454a8513d526384751b953ff98d12ecb Mon Sep 17 00:00:00 2001 From: Dimitris Sotirakis Date: Mon, 6 Feb 2023 17:15:42 +0200 Subject: [PATCH] CI: Remove variants arg from `package` step (#62858) * Remove variants arg from package step # Conflicts: # .drone.yml * Fix starlark lint * Default to releaseModeConfig.Variants * Check for empty variants arg --- .drone.yml | 6 +++--- pkg/build/cmd/package.go | 15 +++++++++------ scripts/drone/events/release.star | 1 - scripts/drone/pipelines/build.star | 10 +--------- scripts/drone/steps/lib.star | 11 ++--------- 5 files changed, 15 insertions(+), 28 deletions(-) diff --git a/.drone.yml b/.drone.yml index 852a347dee4..49aff16c4b6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -600,7 +600,7 @@ steps: name: build-plugins - commands: - . scripts/build/gpg-test-vars.sh && ./bin/build package --jobs 8 --edition oss - --build-id ${DRONE_BUILD_NUMBER} --variants linux-amd64,linux-amd64-musl,darwin-amd64,windows-amd64 + --build-id ${DRONE_BUILD_NUMBER} depends_on: - build-plugins - build-backend @@ -6270,7 +6270,7 @@ steps: name: build-backend-enterprise2 - commands: - ./bin/build package --jobs 8 --edition enterprise2 --build-id ${DRONE_BUILD_NUMBER} - --variants linux-amd64 --sign + --sign depends_on: - build-plugins - build-backend-enterprise2 @@ -6656,6 +6656,6 @@ kind: secret name: aws_secret_access_key --- kind: signature -hmac: 9fb8fede2b16c30dd646d16f157f8647de8ef9faddcb1eb071d02ec8405ad586 +hmac: bf02735eb33a58809b6ff6f786bd6170213f090a2f1d13166c982272a3f99620 ... diff --git a/pkg/build/cmd/package.go b/pkg/build/cmd/package.go index 729856f6834..6b961512ec1 100644 --- a/pkg/build/cmd/package.go +++ b/pkg/build/cmd/package.go @@ -38,14 +38,17 @@ func Package(c *cli.Context) error { ctx := context.Background() - variantStrs := strings.Split(c.String("variants"), ",") variants := []config.Variant{} - for _, varStr := range variantStrs { - if varStr == "" { - continue + variantStrs := strings.Split(c.String("variants"), ",") + if c.String("variants") != "" { + for _, varStr := range variantStrs { + if varStr == "" { + continue + } + variants = append(variants, config.Variant(varStr)) } - - variants = append(variants, config.Variant(varStr)) + } else { + variants = releaseModeConfig.Variants } if len(variants) == 0 { diff --git a/scripts/drone/events/release.star b/scripts/drone/events/release.star index 4c0d3b786ae..280a6132d32 100644 --- a/scripts/drone/events/release.star +++ b/scripts/drone/events/release.star @@ -475,7 +475,6 @@ def enterprise2_pipelines(prefix = "", ver_mode = ver_mode, trigger = release_tr package_step( edition = "enterprise2", ver_mode = ver_mode, - variants = ["linux-amd64"], ), upload_cdn, copy_packages_for_docker_step(edition = "enterprise2"), diff --git a/scripts/drone/pipelines/build.star b/scripts/drone/pipelines/build.star index 7be28f7569b..adf005df612 100644 --- a/scripts/drone/pipelines/build.star +++ b/scripts/drone/pipelines/build.star @@ -62,7 +62,6 @@ def build_e2e(trigger, ver_mode): ] build_steps = [] - variants = None if ver_mode == "pr": build_steps.extend( @@ -72,20 +71,13 @@ def build_e2e(trigger, ver_mode): ], ) - variants = [ - "linux-amd64", - "linux-amd64-musl", - "darwin-amd64", - "windows-amd64", - ] - build_steps.extend( [ 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, ver_mode = ver_mode), - package_step(edition = edition, variants = variants, ver_mode = ver_mode), + package_step(edition = edition, ver_mode = ver_mode), grafana_server_step(edition = edition), e2e_tests_step("dashboards-suite"), e2e_tests_step("smoke-tests-suite"), diff --git a/scripts/drone/steps/lib.star b/scripts/drone/steps/lib.star index 5c7ca3c8535..2863630faef 100644 --- a/scripts/drone/steps/lib.star +++ b/scripts/drone/steps/lib.star @@ -779,7 +779,7 @@ def codespell_step(): ], } -def package_step(edition, ver_mode, variants = None): +def package_step(edition, ver_mode): """Packages Grafana with the Grafana build tool. Args: @@ -787,9 +787,6 @@ def package_step(edition, ver_mode, variants = None): ver_mode: controls whether the packages are signed for a release. If ver_mode != 'release', use the DRONE_BUILD_NUMBER environment variable as a build identifier. - variants: a list of variants be passed to the package subcommand - using the --variants option. - Defaults to None. Returns: Drone step. @@ -801,10 +798,6 @@ def package_step(edition, ver_mode, variants = None): "build-frontend-packages", ] - variants_str = "" - if variants: - variants_str = " --variants {}".format(",".join(variants)) - if ver_mode in ("main", "release", "release-branch"): sign_args = " --sign" env = { @@ -831,7 +824,7 @@ def package_step(edition, ver_mode, variants = None): build_no = "${DRONE_BUILD_NUMBER}" cmds = [ "{}./bin/build package --jobs 8 --edition {} ".format(test_args, edition) + - "--build-id {}{}{}".format(build_no, variants_str, sign_args), + "--build-id {}{}".format(build_no, sign_args), ] return {