Skip to content

Commit cb3a9c2

Browse files
committed
unify publish-artifacts and publish-provisional-artifacts commands
Previously, we used two similar commands to publish artifacts: * `pkg/cmd/publish-artifacts` * `pkg/cmd/publish-provisional-artifacts` The unified command maintains all existing functionality while providing a cleaner interface with 'edge' and 'release' subcommands. Changes: - Refactored `pkg/cmd/publish-artifacts/main.go` to support subcommands using `cobra`. - Added `edge` and `release` subcommands - Removed `--provisional` flag; now handled by subcommands - Removed `--release` flag; it is redundant - Updated build scripts to use new unified command structure - Removed `pkg/cmd/publish-provisional-artifacts` directory - Merged test suites from both commands into unified test file - Removed support for the old `provisional_yyyymmddhhmm_` naming scheme Epic: none Release note: none
1 parent 9919801 commit cb3a9c2

File tree

12 files changed

+551
-1368
lines changed

12 files changed

+551
-1368
lines changed

build/teamcity/cockroach/post-merge/publish-bleeding-edge-per-platform.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ export google_credentials="$gcs_credentials"
2727
source "build/teamcity-support.sh" # For log_into_gcloud
2828
log_into_gcloud
2929
export GOOGLE_APPLICATION_CREDENTIALS="$PWD/.google-credentials.json"
30-
$BAZEL_BIN/pkg/cmd/publish-artifacts/publish-artifacts_/publish-artifacts --gcs-bucket="$gcs_bucket" --platform="$platform"
30+
$BAZEL_BIN/pkg/cmd/publish-artifacts/publish-artifacts_/publish-artifacts edge --gcs-bucket="$gcs_bucket" --platform="$platform"
3131
EOF

build/teamcity/internal/release/process/build-cockroach-release-per-platform.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,8 @@ tc_end_block "Variable Setup"
5151

5252

5353
tc_start_block "Make and publish release artifacts"
54-
# Using publish-provisional-artifacts here is funky. We're directly publishing
55-
# the official binaries, not provisional ones. Legacy naming. To clean up...
5654
BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e TC_BUILDTYPE_ID -e TC_BUILD_BRANCH=$version -e gcs_credentials -e gcs_bucket=$gcs_bucket -e platform=$platform -e telemetry_disabled=$telemetry_disabled -e cockroach_archive_prefix=$cockroach_archive_prefix" run_bazel << 'EOF'
57-
bazel build //pkg/cmd/publish-provisional-artifacts
55+
bazel build //pkg/cmd/publish-artifacts
5856
BAZEL_BIN=$(bazel info bazel-bin)
5957
export google_credentials="$gcs_credentials"
6058
source "build/teamcity-support.sh" # For log_into_gcloud
@@ -80,7 +78,7 @@ done
8078
8179
tr -d '\r' < /tmp/THIRD-PARTY-NOTICES.txt.tmp > /tmp/THIRD-PARTY-NOTICES.txt
8280
83-
$BAZEL_BIN/pkg/cmd/publish-provisional-artifacts/publish-provisional-artifacts_/publish-provisional-artifacts -provisional -release --gcs-bucket="$gcs_bucket" --output-directory=artifacts --platform=$platform --third-party-notices-file=/tmp/THIRD-PARTY-NOTICES.txt --telemetry-disabled=$telemetry_disabled --cockroach-archive-prefix=$cockroach_archive_prefix
81+
$BAZEL_BIN/pkg/cmd/publish-artifacts/publish-artifacts_/publish-artifacts release --gcs-bucket="$gcs_bucket" --output-directory=artifacts --platform=$platform --third-party-notices-file=/tmp/THIRD-PARTY-NOTICES.txt --telemetry-disabled=$telemetry_disabled --cockroach-archive-prefix=$cockroach_archive_prefix
8482
EOF
8583
tc_end_block "Make and publish release artifacts"
8684

build/teamcity/internal/release/process/make-and-publish-build-artifacts-per-platform.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ tc_end_block "Tag the release"
7777

7878
tc_start_block "Compile and publish artifacts"
7979
BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e TC_BUILDTYPE_ID -e TC_BUILD_BRANCH=$build_name -e build_name=$build_name -e gcs_credentials -e gcs_bucket=$gcs_bucket -e platform=$platform -e telemetry_disabled=$telemetry_disabled -e cockroach_archive_prefix=$cockroach_archive_prefix" run_bazel << 'EOF'
80-
bazel build //pkg/cmd/publish-provisional-artifacts
80+
bazel build //pkg/cmd/publish-artifacts
8181
BAZEL_BIN=$(bazel info bazel-bin)
8282
export google_credentials="$gcs_credentials"
8383
source "build/teamcity-support.sh" # For log_into_gcloud
@@ -103,7 +103,7 @@ done
103103
104104
tr -d '\r' < /tmp/THIRD-PARTY-NOTICES.txt.tmp > /tmp/THIRD-PARTY-NOTICES.txt
105105
106-
$BAZEL_BIN/pkg/cmd/publish-provisional-artifacts/publish-provisional-artifacts_/publish-provisional-artifacts -provisional -release --gcs-bucket="$gcs_bucket" --output-directory=artifacts --build-tag-override="$build_name" --platform $platform --third-party-notices-file=/tmp/THIRD-PARTY-NOTICES.txt --telemetry-disabled=$telemetry_disabled --cockroach-archive-prefix=$cockroach_archive_prefix
106+
$BAZEL_BIN/pkg/cmd/publish-artifacts/publish-artifacts_/publish-artifacts release --gcs-bucket="$gcs_bucket" --output-directory=artifacts --build-tag-override="$build_name" --platform $platform --third-party-notices-file=/tmp/THIRD-PARTY-NOTICES.txt --telemetry-disabled=$telemetry_disabled --cockroach-archive-prefix=$cockroach_archive_prefix
107107
108108
EOF
109109
tc_end_block "Compile and publish artifacts"

pkg/BUILD.bazel

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ ALL_TESTS = [
145145
"//pkg/cmd/microbench-ci:microbench-ci_test",
146146
"//pkg/cmd/mirror/go:go_test",
147147
"//pkg/cmd/publish-artifacts:publish-artifacts_test",
148-
"//pkg/cmd/publish-provisional-artifacts:publish-provisional-artifacts_test",
149148
"//pkg/cmd/reduce/reduce/reducesql:reducesql_test",
150149
"//pkg/cmd/reduce/reduce:reduce_test",
151150
"//pkg/cmd/release:release_test",
@@ -1209,9 +1208,6 @@ GO_TARGETS = [
12091208
"//pkg/cmd/publish-artifacts:publish-artifacts",
12101209
"//pkg/cmd/publish-artifacts:publish-artifacts_lib",
12111210
"//pkg/cmd/publish-artifacts:publish-artifacts_test",
1212-
"//pkg/cmd/publish-provisional-artifacts:publish-provisional-artifacts",
1213-
"//pkg/cmd/publish-provisional-artifacts:publish-provisional-artifacts_lib",
1214-
"//pkg/cmd/publish-provisional-artifacts:publish-provisional-artifacts_test",
12151211
"//pkg/cmd/reduce/reduce/reducesql:reducesql",
12161212
"//pkg/cmd/reduce/reduce/reducesql:reducesql_test",
12171213
"//pkg/cmd/reduce/reduce:reduce",

pkg/cmd/publish-artifacts/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ go_library(
88
deps = [
99
"//pkg/release",
1010
"@com_github_kr_pretty//:pretty",
11+
"@com_github_spf13_cobra//:cobra",
1112
],
1213
)
1314

0 commit comments

Comments
 (0)