-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script to automatically bump omicron (#942)
* script to automatically bump omicron * better logic for failing on non-main commits * check that omicron is in the right spot * shellcheck * add description at the top * use short commit hash to avoid branch name collisions
- Loading branch information
1 parent
09657b0
commit fa7edc6
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
# Automatically update tools/console_version in ../omicron with current console | ||
# commit hash and tarball hash. Then create PR in Omicron with that change. | ||
# | ||
# Requirements/assumptions: | ||
# | ||
# - GitHub CLI | ||
# - Omicron is a sibling dir to console | ||
|
||
set -o errexit | ||
set -o pipefail | ||
|
||
if ! command -v gh &> /dev/null; then | ||
echo "Error: GitHub CLI not found. This script needs it to create a PR. Please install it and try again." | ||
exit | ||
fi | ||
|
||
if [ ! -d "../omicron" ]; then | ||
echo "Error: This script assumes omicron shares a parent directory with console." | ||
exit | ||
fi | ||
|
||
# note that this will fail unless the current console commit has a release on | ||
# dl.oxide.computer, i.e., it is a commit on main that has been pushed to GH. | ||
CONSOLE_VERSION=$(git rev-parse HEAD) | ||
# short hash used in branch name to avoid collisions | ||
CONSOLE_VERSION_SHORT=$(git rev-parse --short HEAD) | ||
SHA2=$(curl --fail-with-body "https://dl.oxide.computer/releases/console/$CONSOLE_VERSION.sha256.txt") | ||
|
||
cd ../omicron | ||
git checkout main | ||
git pull | ||
git checkout -b "bump-console-$CONSOLE_VERSION_SHORT" | ||
|
||
cat <<EOF > tools/console_version | ||
COMMIT="$CONSOLE_VERSION" | ||
SHA2="$SHA2" | ||
EOF | ||
|
||
git add --all | ||
git commit -m "Bump console to latest main" | ||
gh pr create --fill --web |
fa7edc6
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.
Successfully deployed to the following URLs:
console-ui-storybook – ./
console-ui-storybook-oxidecomputer.vercel.app
console-ui-storybook.vercel.app
console-ui-storybook-git-main-oxidecomputer.vercel.app