This repository has been archived by the owner on Jun 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare commands and docs for v1.1.0 release (#733)
* Add upgrade instructions * Add license headers * Split release tasks into separate modules * Add config migration * Use the release command instead of mix in upgrade docs * Add --settings to release task's seed * Refactor release tasks to use unified puts functions * Start required applications that are missing from the release tasks * Add `ewallet config --migrate` command * Fix missing originator for config migration * Add support for -y, --yes, --assume_yes to config release task * Fix release tasks failing silently when an unknown argument is given * Refactor IO puts functions into EWallet.CLI * Mirror `bin/ewallet config` into `mix omg.config` * DEBUG=1 to show :debug log and above * Fix `mix config --migrate` stopped at seeding and not respecting --yes * Show mix task docs instead of invalid arguments message * Add -- shift to initdb and seed * Update mix omg.config docs * Minor upgrade notes improvements * Ain't no push without mix formatting * Nope nope can't go without credo too * Add missing mix task shortdoc * Add a glossary for eWallet Suite and eWallet Server * Update EWallet.CLI.confirm?/1 to use Helper.to_boolean/1 to parse the answer. * Refactor set/migration conditions in config.sh * Decouple ReleaseTasks.ConfigMigration from ReleaseTasks.Seed * Shellcheck * Remove seed from config.sh as it's already done as part of the release task * Add message during seed-migration dead air * Fix CLI.confirm?/1 not respecting the default value * Fix shell script styling * Remove default fallback for confirmed?/2, risky assumption * Add some typespecs * Add a bit of notice to v1.1.0 upgrade to perform the main upgrade instructions first
- Loading branch information
Showing
24 changed files
with
727 additions
and
302 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
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
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
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
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,20 @@ | ||
# Copyright 2018 OmiseGO Pte Ltd | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
defmodule EWallet.ReleaseTasks.CLIUser do | ||
@moduledoc """ | ||
Module representing the user invoking the command line interface as originator. | ||
""" | ||
defstruct uuid: "33333333-3333-3333-3333-333333333333" | ||
end |
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,76 @@ | ||
# Copyright 2018 OmiseGO Pte Ltd | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
defmodule EWallet.ReleaseTasks.Config do | ||
@moduledoc """ | ||
A release task that manages application configurations. | ||
""" | ||
use EWallet.ReleaseTasks | ||
alias ActivityLogger.System | ||
alias EWallet.CLI | ||
alias EWalletConfig.Config | ||
|
||
@start_apps [:crypto, :ssl, :postgrex, :ecto, :cloak, :ewallet] | ||
@apps [:activity_logger, :ewallet_config] | ||
|
||
def run do | ||
case :init.get_plain_arguments() do | ||
[key, value] -> | ||
config_base64(key, value) | ||
|
||
_ -> | ||
give_up() | ||
end | ||
end | ||
|
||
def run(key, value), do: config_base64(key, value) | ||
|
||
defp config_base64(k, v) when is_list(k) do | ||
case Base.decode64(to_string(k)) do | ||
{:ok, key} -> | ||
config_base64(key, v) | ||
|
||
_ -> | ||
give_up() | ||
end | ||
end | ||
|
||
defp config_base64(k, v) when is_list(v) do | ||
case Base.decode64(to_string(v)) do | ||
{:ok, value} -> | ||
config_base64(k, value) | ||
|
||
_ -> | ||
give_up() | ||
end | ||
end | ||
|
||
defp config_base64(key, value) do | ||
Enum.each(@start_apps, &Application.ensure_all_started/1) | ||
Enum.each(@apps, &ensure_app_started/1) | ||
|
||
case Config.update(%{key => value, originator: %System{}}) do | ||
{:ok, [{key, {:ok, _}}]} -> | ||
CLI.success("Successfully updated \"#{key}\" to \"#{value}\"") | ||
:init.stop() | ||
|
||
{:ok, [{key, {:error, :setting_not_found}}]} -> | ||
CLI.error("Error: \"#{key}\" is not a valid settings") | ||
:init.stop(1) | ||
|
||
_ -> | ||
give_up() | ||
end | ||
end | ||
end |
Oops, something went wrong.