Prepare commands and docs for v1.1.0 release #733
Conversation
# Conflicts: # rel/commands/config.sh
@@ -41,6 +41,10 @@ For other platforms or for a more advanced setup, see also manual installation b | |||
|
|||
- [Bare metal installation](docs/setup/bare_metal.md) | |||
|
|||
### Upgrade | |||
|
|||
Upgrading to a newer version? See [Upgrading the eWallet Server](docs/setup/upgrading). |
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.
Maybe the eWallet server application?
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 try to call it "OmiseGO eWallet Server" everywhere if possible.
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.
and then there's the Suite...
Hence I'm going to create a new page called Glossary to discuss & pin this down for good.
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.
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.
👍
@sirn I splitted And made a bit of changes to Can you have a look? |
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.
Few comments here and there. Also can you run ShellCheck against all the shell scripts?
.gitignore
Outdated
@@ -24,5 +24,8 @@ erl_crash.dump | |||
.elixir_ls | |||
Thumbs.db | |||
|
|||
# asdf | |||
.tool-versions |
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.
Whyyyyy
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.
Eh. Thought that this is supposed to be user-specific.
But using this to semi-enforce dev users to use the same tool versions is fine I guess. Removing.
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 thing actually saved my life quite few times already since I run editor outside of my Docker VM which has different Elixir version than the one in omisego-images/docker-ewallet (and .tool-versions yell at me to install 1.6.5 which is nice…)
apps/ewallet/lib/ewallet/cli.ex
Outdated
# Mix is not available with distillery releases. | ||
# Link: https://github.com/elixir-lang/elixir/blob/v1.6.5/lib/mix/lib/mix/shell/io.ex#L54 | ||
answer = IO.gets(message <> " [Yn] ") | ||
is_binary(answer) and String.trim(answer) in ["" | @yes_inputs] |
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.
Might worth to use EWallet.Helper.to_boolean
instead as that one handle plenty of… weird cases.
|
||
def run(opts \\ []) do | ||
# Make sure the settings seed has been run | ||
_ = Seed.run_settings_no_stop() |
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.
Would prefer this to re-implement the seed
apps initialization because it serves different purpose na.
rel/commands/config.sh
Outdated
|
||
KEY="$(printf "%s" "$1" | base64)"; shift | ||
VALUE="$(printf "%s" "$1" | base64)"; shift | ||
if [ $ACTION = migrate ]; then |
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 think the better way to implement this is to do:
run_migrate() {
# exec ...
}
run_set() {
# exec...
}
case "$ACTION" in
set ) run_set;;
migrate ) run_migrate;;
* )
print_usage
exit 1
esac
I try to use exit 1
for hard error (e.g. wrong arguments, etc.), and exit 2
for informative errors (printing usage, etc.) because it's pretty common to check for exit 1 for detecting errors.
rel/commands/config.sh
Outdated
KEY="$(printf "%s" "$1" | base64)"; shift | ||
VALUE="$(printf "%s" "$1" | base64)"; shift | ||
if [ $ACTION = migrate ]; then | ||
$RELEASE_ROOT_DIR/bin/ewallet command Elixir.EWallet.ReleaseTasks.Seed run_settings && |
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.
Why do you need &&
here? If you want to detect that the command ran successfully, better use:
if ! $RELEASE_ROOT_DIR/bin/ewallet command Elixir.EWallet.ReleaseTasks.Seed run_settings; then
printf "The error occurred during seeding settings data.\\n"
exit 1
fi
rel/commands/config.sh
Outdated
|
||
exec "$RELEASE_ROOT_DIR/bin/ewallet" command Elixir.EWallet.ReleaseTasks config_base64 "$KEY" "$VALUE" | ||
if [ "$ASK_CONFIRM" = true ]; then | ||
exec "$RELEASE_ROOT_DIR/bin/ewallet" command Elixir.EWallet.ReleaseTasks.ConfigMigration run_ask_confirm |
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.
Try to have only one exec
at the end of execution because it can be confusing since exec
is essentially the end of shell script. So here better do:
MIGRATION_FN = "run_ask_confirm"
if [ "$ASK_CONFIRM" = true ]; then
MIGRATION_FN = "run_skip_confirm"
fi
exec …
This reverts commit ae106d2.
# Conflicts: # rel/commands/config.sh
@sirn Updated. Please check again. |
Issue/Task Number: #684
Overview
This PR updates release tasks and docs in preparation for
v1.1.0
release.Changes
Remove asdf-specific.tool-versions
EWallet.ReleaseTasks
into multiple modules separated by the main taskbin/ewallet config --migrate
supportmix omg.config
that has feature-parity withbin/wallet config
v1.1.0
upgrade docsImplementation Details
Turns out
v1.0.0
->v1.1.0
is quite a smooth ride since breaking changes were already crammed withinv1.0.0
.The biggest change is the distillery release which renders mix commands unavailable on production builds, while itself is quite cumbersome to use in development environment.
This PR mainly adds documentations regarding upgrades, as well as attempting towards feature-parity (but not yet) between
mix omg.*
commands for dev environment andbin/ewallet
for prod environment.Usage
See upgrade instructions under Upgrade heading on the main README.md.
Commands:
mix omg.config
or
mix omg.config -h
bin/ewallet config
or
bin/ewallet config -h
mix omg.config key value
bin/ewallet config key value
mix omg.config --migrate
bin/ewallet config --migrate
Impact
Nothing specific for this PR, but the command
bin/ewallet config --migrate
must be run during the upgrade fromv1.0.0
tov1.1.0
.