Skip to content

Commit

Permalink
[minor] Add "accept license?" prompt to mas install cmd (#196)
Browse files Browse the repository at this point in the history
Co-authored-by: Matheus Cardoso de Medeiros <[email protected]>
  • Loading branch information
RexMCM and Matheus Cardoso de Medeiros authored Mar 1, 2023
1 parent 95ea027 commit ea6539f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
19 changes: 19 additions & 0 deletions image/cli/mascli/functions/pipeline_config
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ function pipeline_config() {
case $MAS_CHANNEL_SELECTION in
1|8.9|8.9.x)
MAS_CHANNEL=8.9.x
MAS_LICENSE_LINK=$( build_license_link_by_mas_version "89" )
;;

2|8.8|8.8.x)
MAS_CHANNEL=8.8.x
MAS_LICENSE_LINK=$( build_license_link_by_mas_version "88" )
;;

*)
Expand Down Expand Up @@ -102,40 +104,48 @@ function pipeline_config() {
# -----------------------------------------------------------------------
1)
MAS_CHANNEL=8.9.x
MAS_LICENSE_LINK=$( build_license_link_by_mas_version "89" )
MAS_CATALOG_VERSION=v8-230217-amd64
;;
2)
MAS_CHANNEL=8.8.x
MAS_LICENSE_LINK=$( build_license_link_by_mas_version "88" )
MAS_CATALOG_VERSION=v8-230217-amd64
;;
# Jan 2023 Catalog
# -----------------------------------------------------------------------
3)
MAS_CHANNEL=8.9.x
MAS_LICENSE_LINK=$( build_license_link_by_mas_version "89" )
MAS_CATALOG_VERSION=v8-230111-amd64
;;
4)
MAS_CHANNEL=8.8.x
MAS_LICENSE_LINK=$( build_license_link_by_mas_version "88" )
MAS_CATALOG_VERSION=v8-230111-amd64
;;
# Dec 2022 Catalog
# -----------------------------------------------------------------------
5)
MAS_CHANNEL=8.9.x
MAS_LICENSE_LINK=$( build_license_link_by_mas_version "89" )
MAS_CATALOG_VERSION=v8-221228-amd64
;;
6)
MAS_CHANNEL=8.8.x
MAS_LICENSE_LINK=$( build_license_link_by_mas_version "88" )
MAS_CATALOG_VERSION=v8-221228-amd64
;;
# Nov 2022 Catalog
# -----------------------------------------------------------------------
7)
MAS_CHANNEL=8.9.x
MAS_LICENSE_LINK=$( build_license_link_by_mas_version "89" )
MAS_CATALOG_VERSION=v8-221129-amd64
;;
8)
MAS_CHANNEL=8.8.x
MAS_LICENSE_LINK=$( build_license_link_by_mas_version "88" )
MAS_CATALOG_VERSION=v8-221129-amd64
;;
*)
Expand All @@ -145,6 +155,15 @@ function pipeline_config() {
esac
fi
true

echo
echo_h2 "3.1. License Terms"
echo -e "${COLOR_YELLOW} For information about your license, see "$MAS_LICENSE_LINK " To continue with the installation, you must accept the license terms."
prompt_for_confirm "Do you accept the license terms?" LICENSE_RESPONSE

if [[ "$LICENSE_RESPONSE" == "false" ]]; then
exit 1
fi

echo
echo_h2 "4. Configure Operation Mode"
Expand Down
6 changes: 6 additions & 0 deletions image/cli/mascli/functions/utils
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ function echo_hr2() {
echo "-------------------------------------------------------------------------------"
}

function build_license_link_by_mas_version() {
version=$1
link="https://ibm.biz/MAS"$version"-License"
echo $link
}

# Prompt for confirmation to continue
# -----------------------------------------------------------------------------
confirm() {
Expand Down

0 comments on commit ea6539f

Please sign in to comment.