Several improvement and fixes: image_tag check for linux- prefix, login procedure for custom registry, --docker-username normalization and --dns aks option documented at usage()
This commit is contained in:
parent
7684278f8b
commit
00bf2470ce
@ -14,8 +14,9 @@ Parameters:
|
|||||||
The resource group for the AKS cluster. Required when the registry (using the -r parameter) is set to "aks".
|
The resource group for the AKS cluster. Required when the registry (using the -r parameter) is set to "aks".
|
||||||
-b | --build-solution
|
-b | --build-solution
|
||||||
Force a solution build before deployment (default: false).
|
Force a solution build before deployment (default: false).
|
||||||
-d | --dns <dns or ip address>
|
-d | --dns <dns or ip address> | --dns aks
|
||||||
Specifies the external DNS/ IP address of the Kubernetes cluster.
|
Specifies the external DNS/ IP address of the Kubernetes cluster.
|
||||||
|
If 'aks' is set as value, the DNS value is retrieved from the AKS. --aks-name and --aks-rg are needed.
|
||||||
When --use-local-k8s is specified the external DNS is automatically set to localhost.
|
When --use-local-k8s is specified the external DNS is automatically set to localhost.
|
||||||
-h | --help
|
-h | --help
|
||||||
Displays this help text and exits the script.
|
Displays this help text and exits the script.
|
||||||
@ -37,7 +38,7 @@ Parameters:
|
|||||||
This is useful for production environments where infrastructure is hosted outside the Kubernetes cluster.
|
This is useful for production environments where infrastructure is hosted outside the Kubernetes cluster.
|
||||||
-t | --tag <docker image tag>
|
-t | --tag <docker image tag>
|
||||||
The tag used for the newly created docker images. Default: newly created, date-based timestamp, with 1-minute resolution.
|
The tag used for the newly created docker images. Default: newly created, date-based timestamp, with 1-minute resolution.
|
||||||
-u | --docker-username <docker username>
|
-u | --docker-user <docker username>
|
||||||
The Docker username used to logon to the custom registry, supplied using the -r parameter.
|
The Docker username used to logon to the custom registry, supplied using the -r parameter.
|
||||||
--use-local-k8s
|
--use-local-k8s
|
||||||
Deploy to a locally installed Kubernetes (default: false).
|
Deploy to a locally installed Kubernetes (default: false).
|
||||||
@ -124,6 +125,19 @@ if [[ $build_images ]]; then
|
|||||||
docker rmi $(docker images -qf "dangling=true")
|
docker rmi $(docker images -qf "dangling=true")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
use_custom_registry=''
|
||||||
|
|
||||||
|
if [[ -n $container_registry ]]; then
|
||||||
|
echo "################ Log into custom registry $container_registry ##################"
|
||||||
|
use_custom_registry='yes'
|
||||||
|
if [[ -z $docker_username ]] || [[ -z $docker_password ]]; then
|
||||||
|
echo "Error: Must use -u (--docker-username) AND -p (--docker-password) if specifying custom registry"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
docker login -u $docker_username -p $docker_password $container_registry
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [[ $push_images ]]; then
|
if [[ $push_images ]]; then
|
||||||
echo "#################### Pushing images to the container registry ####################"
|
echo "#################### Pushing images to the container registry ####################"
|
||||||
services=(basket.api catalog.api identity.api ordering.api marketing.api payment.api locations.api webmvc webspa webstatus)
|
services=(basket.api catalog.api identity.api ordering.api marketing.api payment.api locations.api webmvc webspa webstatus)
|
||||||
@ -131,6 +145,9 @@ if [[ $push_images ]]; then
|
|||||||
for service in "${services[@]}"
|
for service in "${services[@]}"
|
||||||
do
|
do
|
||||||
echo "Pushing image for service $service..."
|
echo "Pushing image for service $service..."
|
||||||
|
if [[ -z "$(docker image ls -q --filter=reference=eshop/$service:$image_tag)" ]]; then
|
||||||
|
image_tag=linux-$image_tag
|
||||||
|
fi
|
||||||
docker tag "eshop/$service:$image_tag" "$container_registry/$service:$image_tag"
|
docker tag "eshop/$service:$image_tag" "$container_registry/$service:$image_tag"
|
||||||
docker push "$container_registry/$service:$image_tag"
|
docker push "$container_registry/$service:$image_tag"
|
||||||
done
|
done
|
||||||
@ -173,16 +190,6 @@ if [[ $clean ]]; then
|
|||||||
echo "Previous releases deleted"
|
echo "Previous releases deleted"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
use_custom_registry=''
|
|
||||||
|
|
||||||
if [[ -n $container_registry ]]; then
|
|
||||||
use_custom_registry='yes'
|
|
||||||
if [[ -z $docker_user ]] || [[ -z $docker_password ]]; then
|
|
||||||
echo "Error: Must use -u (--docker-username) AND -p (--docker-password) if specifying custom registry"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "#################### Begin $app_name installation using Helm ####################"
|
echo "#################### Begin $app_name installation using Helm ####################"
|
||||||
infras=(sql-data nosql-data rabbitmq keystore-data basket-data)
|
infras=(sql-data nosql-data rabbitmq keystore-data basket-data)
|
||||||
charts=(eshop-common apigwmm apigwms apigwwm apigwws basket-api catalog-api identity-api locations-api marketing-api mobileshoppingagg ordering-api ordering-backgroundtasks ordering-signalrhub payment-api webmvc webshoppingagg webspa webstatus webhooks-api webhooks-web)
|
charts=(eshop-common apigwmm apigwms apigwwm apigwws basket-api catalog-api identity-api locations-api marketing-api mobileshoppingagg ordering-api ordering-backgroundtasks ordering-signalrhub payment-api webmvc webshoppingagg webspa webstatus webhooks-api webhooks-web)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user