-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Script for the PublishRelease TC build configuration #50053
Script for the PublishRelease TC build configuration #50053
Conversation
# Work around headless d-bus problem by forcing docker to use | ||
# plain-text credentials for dockerhub. | ||
# https://github.com/docker/docker-credential-helpers/issues/105#issuecomment-420480401 | ||
mkdir -p ~/.docker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this section of docker login may make sense to modularise
5d5463b
to
4d29a21
Compare
4d29a21
to
663a76c
Compare
663a76c
to
ae88bb9
Compare
bors ping |
pong |
f62d96e
to
5a06605
Compare
# for the `metadata` part at the end because Docker tags don't support | ||
# `+` in the tag name. | ||
# https://github.com/cockroachdb/cockroach/blob/master/pkg/util/version/version.go#L75 | ||
build_name="$(echo "${NAME}" | grep -E -o '^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[-.0-9A-Za-z]+)?$')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried using +dryrun
instead of .dryrun
or -dryrun
and found docker image tags don't allow +
in the tag name. I chose to not allow +
in the build name so this problem isn't encountered. This means we can't have releases (or even internal builds that we want CC to consume) with +
's in them. I'm open to alternative ways of solving this if you've any ideas.
|
||
# TODO: update publish-artifacts with option to leave one or more cockroach binaries in the local filesystem | ||
curl -f -s -S -o- "https://${s3_download_hostname}/cockroach-${build_name}.linux-amd64.tgz" | tar ixfz - --strip-components 1 | ||
cp cockroach build/deploy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only copying cockroach (and not the libgeo libs) so this can be backported to v20.1 and before. Will make a follow-on PR to add libgeo for master.
AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" \ | ||
AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" \ | ||
TC_BUILD_BRANCH="$build_name" \ | ||
publish-provisional-artifacts -bless -release -bucket "${bucket}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not copying / linking the files for dryrun
but it should for binaries.cockroachdb.com
since it is used in bless provisional artifacts already. I'll fix this post this PR.
# example: v20.1-latest | ||
if [[ -z "$PRE_RELEASE" ]]; then | ||
#TODO: implement me! | ||
echo "Pushing latest-RELEASE_BRANCH S3 binaries and archive is not implemented." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a new feature and not necessary for this initial test, leaving this for implementation in a subsequent PR.
s3_download_hostname="${bucket}" | ||
git_repo_for_tag="cockroachdb/cockroach" | ||
else | ||
bucket="${BUCKET:-cockroach-builds-test}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you all think about using the binaries-test.cockroachdb.com
here? (I'm not sure what the history is of the bucket.)
5a06605
to
c5bf9b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - with minor comments
# Matching the version name regex from within the cockroach code except | ||
# for the `metadata` part at the end because Docker tags don't support | ||
# `+` in the tag name. | ||
# https://github.com/cockroachdb/cockroach/blob/master/pkg/util/version/version.go#L75 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm worried about this link rotting - maybe using the permalink (
cockroach/pkg/util/version/version.go
Line 75 in 4c6864b
`^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[0-9A-Za-z-.]+)?(\+[0-9A-Za-z-.]+|)?$`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. Updated.
# ^major ^minor ^patch ^preRelease | ||
|
||
if [[ -z "$build_name" ]] ; then | ||
echo 'Invalid NAME. Must be of the format "vMAJOR.MINOR.PATCH(-PRERELEASE)?".' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also print the NAME that we're trying to parse here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be helpful. Added.
exit 1 | ||
fi | ||
|
||
release_branch=$(echo ${build_name} | grep -E -o '^v[0-9]+\.[0-9]+') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to check if we've successfully parse the release_branch here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't think so because this is a subset of what is checked for build_name
and if the build_name
fails then it won't make it here.
290c240
to
9d126ac
Compare
TFTR! bors r=pbardea |
🕐 Waiting for PR status (Github check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set. |
Before: the script wasn't implemented. Now: Part of the new release process, this script - tags the selected SHA to the provided name - compiles the binaries and archive and uploads them to S3 as the versioned name - uploads the docker image to docker.io/cockroachdb/cockroach - pushes the tag to github.com/cockroachdb/cockroach - push all the artificats to their respective `latest` locations as appropriate Release note: None
9d126ac
to
d73710d
Compare
👎 Rejected by PR status |
bors r=pbardea |
Build succeeded: |
Before: the script wasn't implemented.
Now:
Part of the new release process, this script
versioned name
latest
locations asappropriate
Release note: None