-
Notifications
You must be signed in to change notification settings - Fork 57
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
Clarify logic around dev builds and rebuilding #72
Changes from 1 commit
720fbb9
26ffe7d
0e22925
aae904b
4732c5d
4c489a7
a7c9f53
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ fi | |
|
||
run=true | ||
force_build=false | ||
skip_build=false | ||
validate=false | ||
detach=false | ||
blockscout=false | ||
|
@@ -91,8 +92,19 @@ while [[ $# -gt 0 ]]; do | |
fi | ||
;; | ||
--build) | ||
force_build=true | ||
shift | ||
if [[ $# -eq 0 || $1 == -* ]]; then | ||
# If no argument after --build, set flag to true | ||
force_build=true | ||
else | ||
while [[ $# -gt 0 && $1 != -* ]]; do | ||
if [[ $1 == "false" ]]; then | ||
force_build=false | ||
skip_build=true | ||
fi | ||
shift | ||
done | ||
fi | ||
;; | ||
--validate) | ||
simple=false | ||
|
@@ -177,7 +189,7 @@ while [[ $# -gt 0 ]]; do | |
echo $0 script [SCRIPT-ARGS] | ||
echo | ||
echo OPTIONS: | ||
echo --build rebuild docker images | ||
echo --build rebuild docker images. --build false disables rebuild | ||
echo --dev build nitro and blockscout dockers from source instead of pulling them. Disables simple mode | ||
echo --init remove all data, rebuild, deploy new rollup | ||
echo --pos l1 is a proof-of-stake chain \(using prysm for consensus\) | ||
|
@@ -200,17 +212,17 @@ while [[ $# -gt 0 ]]; do | |
esac | ||
done | ||
|
||
if $force_init; then | ||
if ! $skip_build && $force_init; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems there's currently a lot of disarray in force_build, dev_build_X.. in that way skip_build is reasonable but it adds to the mess instead of removing from it. I think some of the mess comes from the duality of build being used for building contracts/scripts vs used to build local nitro.. maybe there should be different args for that. A final note: external users don't generally use --dev so I don't mind introducing changes that will break usage that does build local nitro. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I've come up with something that clarifies it, PTAL. |
||
force_build=true | ||
fi | ||
|
||
if $dev_build_nitro; then | ||
if ! $skip_build && $dev_build_nitro; then | ||
if [[ "$(docker images -q nitro-node-dev:latest 2> /dev/null)" == "" ]]; then | ||
force_build=true | ||
fi | ||
fi | ||
|
||
if $dev_build_blockscout; then | ||
if ! $skip_build && $dev_build_blockscout; then | ||
if [[ "$(docker images -q blockscout:latest 2> /dev/null)" == "" ]]; then | ||
force_build=true | ||
fi | ||
|
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.
change that to --no-build
not necessarily better, but that's how we currently do all boolean options
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.
(other option is to change no-tokenbridge, no-simple etc..)
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.
--no-build
is cleaner, I'll change it to that.