Skip to content

Commit

Permalink
Script init improvements
Browse files Browse the repository at this point in the history
Now relies on AZ CLI 2.47+ to avoid regression introduced in 2.46
  • Loading branch information
1iveowl committed Apr 9, 2023
1 parent 4b476da commit e9263e7
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/Saas.Admin/deployment/start.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# work-around for issue w/ az cli bicep v. 2.46: https://github.com/Azure/azure-cli/issues/25710
az config set bicep.use_binary_from_path=false
# az config set bicep.use_binary_from_path=false

# if not running in a container
if ! [ -f /.dockerenv ]; then
Expand Down
2 changes: 1 addition & 1 deletion src/Saas.Application/deployment/start.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# work-around for issue w/ az cli bicep v. 2.46: https://github.com/Azure/azure-cli/issues/25710
az config set bicep.use_binary_from_path=false
# az config set bicep.use_binary_from_path=false

# if not running in a container
if ! [ -f /.dockerenv ]; then
Expand Down
30 changes: 22 additions & 8 deletions src/Saas.Identity/Saas.IdentityProvider/deployment/script/init.sh
Expand Up @@ -28,35 +28,49 @@ function check-prerequisites() {

echo "Supported operating system: ${what_os}" |
log-output \
--level success
--level success \
--header "Checking OS"

if [[ "${GIT_ORG_PROJECT_NAME}" == "Azure/azure-saas" ]]; then
echo "To run this script you need to fork it to your own repository first." |
log-output \
--level error \
--header "Critical error" ||
exit 1
else
echo "Forked repository true: ${GIT_ORG_PROJECT_NAME}" |
log-output \
--level success \
--header "Checking Repo forked"
fi

# check if bash version is supported
is-valid-bash "5.0.0" |
log-output \
--level info \
--level success \
--header "Checking bash version" ||
echo "The version of bash is not supported." |
echo "The version of bash is not supported. Try updating the latest version." |
log-output \
--level error \
--header "Critical error" ||
exit 1

# check if az cli version is supported
is-valid-az-cli "2.42.0" |
is-valid-az-cli "2.46.0" |
log-output \
--level info \
--level success \
--header "Checking az cli version" ||
echo "The version of az cli is not supported." |
echo "The version of az cli is not supported. Try updating to the latest version." |
log-output \
--level error \
--header "Critical error" ||
exit 1

is-valid-jq "1.5" |
log-output \
--level info \
--level success \
--header "Checking jq version" ||
echo "The version of jq is not supported." |
echo "The version of jq is not supported. Try updating to the latest version." |
log-output \
--level error \
--header "Critical error" ||
Expand Down
Expand Up @@ -3,7 +3,7 @@
export ASDK_CACHE_AZ_CLI_SESSIONS=true

# work-around for issue w/ az cli bicep v. 2.46: https://github.com/Azure/azure-cli/issues/25710
az config set bicep.use_binary_from_path=false
# az config set bicep.use_binary_from_path=false

# if not running in a container
if ! [ -f /.dockerenv ]; then
Expand Down
4 changes: 1 addition & 3 deletions src/Saas.Identity/Saas.IdentityProvider/readme.md
Expand Up @@ -43,14 +43,12 @@ No matter the operating system you're using, you will need these tools to be ins
- [**Docker Desktop**](https://docs.docker.com/get-docker/).
- If you have Docker already, make sure to get the latest updates before you begin. If you have Docker installed but haven't used it for a while. Reinstalling will often solve potential issues.
- Tip: On Windows 10/11, if you experience the error: *"The command 'docker' could not be found in this WSL 2 distro. We recommend to activate the WSL integration in Docker Desktop settings."*, then try to restart Docker Desktop or if that doesn't help, try and reinstall it.
- [Azure Command Line Interface (**az cli**)](https://learn.microsoft.com/en-us/cli/azure/what-is-azure-cli) from the terminal: [How to install the Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli).
- [Azure Command Line Interface (**az cli**)](https://learn.microsoft.com/en-us/cli/azure/what-is-azure-cli) for the terminal: [How to install the Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli).
- Tip: Must be installed from inside WSL on Windows 10/11).

- [GitHub’s official command line tool (**gh**)](https://cli.github.com/). For more on installation see [here](https://github.com/cli/cli#installation).
- Tip: Must be installed from inside WSL on Windows 10/11).



### Begin

To begin, please open your GNU Linux terminal to the directory where you've [cloned](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) the [forked](https://docs.github.com/en/get-started/quickstart/fork-a-repo) version of ASDK. Should be something like:
Expand Down
2 changes: 1 addition & 1 deletion src/Saas.Identity/Saas.Permissions/deployment/start.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# work-around for issue w/ az cli bicep v. 2.46: https://github.com/Azure/azure-cli/issues/25710
az config set bicep.use_binary_from_path=false
# az config set bicep.use_binary_from_path=false

# if not running in a container
if ! [ -f /.dockerenv ]; then
Expand Down
2 changes: 1 addition & 1 deletion src/Saas.SignupAdministration/deployment/start.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# work-around for issue w/ az cli bicep v. 2.46: https://github.com/Azure/azure-cli/issues/25710
az config set bicep.use_binary_from_path=false
# az config set bicep.use_binary_from_path=false

# if not running in a container
if ! [ -f /.dockerenv ]; then
Expand Down

0 comments on commit e9263e7

Please sign in to comment.