-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
AVRO-3423: Add build.sh step to encapsulate all the steps needed during release #1570
AVRO-3423: Add build.sh step to encapsulate all the steps needed during release #1570
Conversation
This is a proposed way to simplify the release process for the C#. Step #9 in https://cwiki.apache.org/confluence/display/AVRO/How+To+Release#HowToRelease-Publishing could be reduced to the following if running from the ../lang/csharp folder:
This step requires that Other languages might follow this pattern so the release step would become a series of |
lang/csharp/build.sh
Outdated
@@ -76,6 +76,35 @@ do | |||
cp -pr build/doc/* ${ROOT}/build/avro-doc-${VERSION}/api/csharp | |||
;; | |||
|
|||
release) | |||
# "dist" step must be executed before this step |
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 think about the following:
extract all the logic in dist)
to a function, so it will look like:
...
dist)
dist()
release)
release()
...
This way the first few lines of release()
could check if there are artifacts created by dist()
and call dist()
if there are no such. Something like:
function release() {
if [ ! -f .../some/file ]; then
dist()
fi
# release stuff
}
lang/csharp/build.sh
Outdated
# If not specified use default location | ||
[ "$NUGET_SOURCE" ] || NUGET_SOURCE="https://api.nuget.org/v3/index.json" | ||
|
||
# Set NUGET_KEY beofre executing script. E.g. `NUGET_KEY="YOUR_KEY" ./build.sh release` |
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.
typo in before
@martin-g I can check if the tar.gz exists and all the needed nupkgs exist, if not execute the dist() function as you described above. I have it implemented locally and I can commit it. However, what about if there is no release action, but
|
I like it! |
This runs
Is there any place where the NUGET_KEY is stored already on the "release" machine? SO I can default the value to it if NUGET_KEY is not set. |
I still like the a new
|
Added a verify-release step to simplify and harden the verisifcation step after the release. It iterates through all the supported dotnet code SDKS to make sure that all the libs and tool can be installed from nuget for all the SDKs. |
I really like one advantage of this -- I have tons of notes (in addition to the wiki) for releasing binary artifacts and doing the equivalent of Unfortunately, I'm kind of skittish about delegating these steps to a script and generalizing them to all languages... I'd find it hard to "trust" doing a Note that the Wiki process isn't immune to that either (check out the Python SDK release 1.9.2.1 as an example of fixing a bad deploy!) I don't have any good ideas for that other than prompting |
Adding a
Btw, couls you post how the release is happening now? Are you executing the steps from the wiki page in blocks, or each line one by one from those code snipptes for each step? |
@RyanSkraba Added a ask function to the script and usage to the verify-release step as an example. It asks for each SDKs how to proceed. If there is any error anytime, the script stops.
|
(Please excuse the delay! I've been playing catch-up with emails)
Effectively, I've been doing commands from the wiki page -- the commands that can be reverted or backed out in blocks and the commands that (permanently) publish artifacts one at a time. Usually one SDK at a time. Even if it's a bit fussy, it's really only about an hours work! I like the Perhaps a future feature would be to not |
I added soem better command line argument parsing and option fro dry run, answer yes to all questions .... It is better to have a more standard way of handling wehn the number of options start to inscrease. It is possible to put most of these build.sh framework into |
…sizmadia/avro into avro-3424-add-build-sh-release-csharp
Added |
Modded the C build.sh script as well. Only C++ is left. That script might need some rework, since it has some "non-standard" targets, like |
@martin-g Should be able to provide the CARGO_API_TOKEN from the command line as well? |
Env var should work too. I'm fine with both. |
lang/rust/build.sh
Outdated
{ | ||
execute cargo build --release --lib --all-features | ||
execute cargo package | ||
execute mkdir -p "$BUILD_ROOT/dist/rust" |
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.
execute mkdir -p "$BUILD_ROOT/dist/rust" | |
execute mkdir -p "$dist_dir" |
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
@jklamer Please review 69772c3 |
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
@martin-g will review soon. Currently on vacation but will get to it ASAP |
|
||
clean() { | ||
git clean -xdf '*.avpr' \ | ||
function command_clean() |
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.
Please remove the function
keyword from everywhere else instead of adding it here. There is very little practical difference, except that we should default to fewer characters when there is no reasonable argument for more.
function prepare_build() | ||
{ | ||
command_clean | ||
execute mkdir -p "$build_dir" |
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.
Where is execute
defined?
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.
share/build-helper.sh
in the PR. The main reason behind the execute
concept was to be able to have a --dry-run
option, where the build.sh just prints out what would be running. The user can copy paste it and run it manually step by step if needed, or just simply checking the steps. Additionally there is a step option, IIRC I implemented it :) Wit enables to user to execute the build scripts step by step.
The build helper is pretty much the common code between all the build scripts and all build scripts include it. It has the execute implementation, the common help, the colored logging, etc.
execute make -C "$build_dir" package_source | ||
execute rm "$root_dir"/docs/*.html | ||
if [ ! -d "$dist_dir" ]; then | ||
execute mkdir -p "$dist_dir" |
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.
If we're using mkdir -p
we don't need to check if the dir already exists first.
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.
Roger. I followed the original build.sh scripts as much to the letter as possible. At this stage my objective was to be able to easily compare roiginal build shells cripts with the new ones.
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 understand but since you're adding execute
doesn't that make it kind of moot?
Make sure you have checked all steps below.
Jira
Tests
Commits
Documentation