Skip to content

Commit

Permalink
Update tripviewer helm chart (Azure-Samples#212)
Browse files Browse the repository at this point in the history
* fix spacing

* Add in bingAPIkey to helm

* make BING_API_KEY optional
  • Loading branch information
dtzar authored and dcaro committed Sep 17, 2018
1 parent c724e2a commit b28a5dc
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
21 changes: 15 additions & 6 deletions provision-team/build_deploy_tripviewer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,24 @@ IFS=$'\n\t'
# -o: prevents errors in a pipeline from being masked
# IFS new value is less likely to cause confusing bugs when looping arrays or arguments (e.g. $@)

usage() { echo "Usage: build_deploy_tripviewer.sh -m <teamName> -d <dnsURL>" 1>&2; exit 1; }
usage() { echo "Usage: build_deploy_tripviewer.sh -m <teamName> -d <dnsURL> -j <bingAPIkey>" 1>&2; exit 1; }

declare teamName=""
declare dnsURL=""
declare bingAPIkey=""

# Initialize parameters specified from command line
while getopts ":m:d:" arg; do
while getopts ":d:j:m:" arg; do
case "${arg}" in
m)
teamName=${OPTARG}
;;
d)
dnsURL=${OPTARG}
;;
j)
bingAPIkey=${OPTARG}
;;
m)
teamName=${OPTARG}
;;
esac
done
shift $((OPTIND-1))
Expand Down Expand Up @@ -47,6 +51,7 @@ declare registryName="${teamName}acr"
#DEBUG
echo $resourceGroupName
echo $dnsURL
echo $bingAPIkey
echo $teamName
echo -e '\n'

Expand Down Expand Up @@ -79,4 +84,8 @@ echo -e "\nhelm install ... from: " $installPath

BASE_URI='http://'$dnsURL
echo "Base URI: $BASE_URI"
helm install $installPath --name web --set repository.image=$TAG,ingress.rules.endpoint.host=$dnsURL
if [[ "${bingAPIkey}" == "" ]]; then
helm install $installPath --name web --set repository.image=$TAG,ingress.rules.endpoint.host=$dnsURL
else
helm install $installPath --name web --set repository.image=$TAG,ingress.rules.endpoint.host=$dnsURL,viewer.mapkey=$bingAPIkey
fi
13 changes: 9 additions & 4 deletions provision-team/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# set -euo pipefail
IFS=$'\n\t'

usage() { echo "Usage: setup.sh -i <subscriptionId> -l <resourceGroupLocation> -n <teamName> -e <teamNumber> -r <recipientEmail> -c <chatConnectionString> -q <chatMessageQueue> -u <azureUserName> -p <azurePassword>" 1>&2; exit 1; }
usage() { echo "Usage: setup.sh -i <subscriptionId> -l <resourceGroupLocation> -n <teamName> -e <teamNumber> -r <recipientEmail> -c <chatConnectionString> -q <chatMessageQueue> -u <azureUserName> -p <azurePassword> -j <bingAPIkey>" 1>&2; exit 1; }
echo "$@"

declare subscriptionId=""
Expand All @@ -17,9 +17,10 @@ declare recipientEmail=""
declare chatConnectionString=""
declare chatMessageQueue=""
declare provisioningVMIpaddress=""
declare bingAPIkey=""

# Initialize parameters specified from command line
while getopts ":c:i:l:n:e:q:r:u:p:" arg; do
while getopts ":c:i:l:n:e:q:r:u:p:j:" arg; do
case "${arg}" in
c)
chatConnectionString=${OPTARG}
Expand Down Expand Up @@ -48,6 +49,9 @@ while getopts ":c:i:l:n:e:q:r:u:p:" arg; do
p)
azurePassword=${OPTARG}
;;
j)
bingAPIkey=${OPTARG}
;;
esac
done
shift $((OPTIND-1))
Expand Down Expand Up @@ -166,6 +170,7 @@ echo "recipientEmail = "${recipientEmail}
echo "chatConnectionString = "${chatConnectionString}
echo "chatMessageQueue = "${chatMessageQueue}
echo "zipPassword" = "${zipPassword}"
echo "bingAPIkey" = "${bingAPIkey}"
echo "=========================================="

#login to azure using your credentials
Expand Down Expand Up @@ -268,8 +273,8 @@ bash ./build_deploy_trip.sh -s ./test_fetch_build -b Release -r $resourceGroupTe
echo "12-Build and deploy User-Profile API to AKS (# bash ./build_deploy_user-profile.sh -s ./test_fetch_build -b Release -r $resourceGroupTeam -t 'api-userprofile' -d $dnsURL -n ${teamName}${teamNumber} -g $registryName)"
bash ./build_deploy_user-java.sh -s ./test_fetch_build -b Release -r $resourceGroupTeam -t 'api-user-java' -d $dnsURL -n ${teamName}${teamNumber} -g $registryName

echo "13-Build and deploy Tripviewer website to AKS (# bash ./build_deploy_tripviewer.sh -m ${teamName}${teamNumber} -d $dnsURL)"
bash ./build_deploy_tripviewer.sh -m ${teamName}${teamNumber} -d $dnsURL
echo "13-Build and deploy Tripviewer website to AKS (# bash ./build_deploy_tripviewer.sh -m ${teamName}${teamNumber} -d $dnsURL -j $bingAPIkey)"
bash ./build_deploy_tripviewer.sh -m ${teamName}${teamNumber} -d $dnsURL -j $bingAPIkey

echo "14-Build and deploy the simulator (# bash Usage: build_deploy_simulator.sh -n ${teamName}${teamNumber} -q 18000 -d $dnsURL -t <image tag optional>)"
bash ./build_deploy_simulator.sh -n ${teamName}${teamNumber} -q '18000' -d $dnsURL
Expand Down
2 changes: 1 addition & 1 deletion tripviewer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ COPY . .
RUN dotnet publish "web/TripViewer.csproj" -c Release -o /publish

FROM microsoft/dotnet:2.1-aspnetcore-runtime
ENV TEAM_API_ENDPOINT="http://akstraefikopenhackvld9.westus.cloudapp.azure.com"
ENV TEAM_API_ENDPOINT="http://akstraefikchangeme.westus.cloudapp.azure.com",BING_MAPS_KEY="changeme"
WORKDIR /app
COPY --from=build /publish .
ENTRYPOINT ["dotnet", "TripViewer.dll"]
5 changes: 3 additions & 2 deletions tripviewer/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ spec:
env:
- name: TEAM_API_ENDPOINT
value: "http://{{ .Values.ingress.rules.endpoint.host }}"
- name: BING_MAPS_KEY
value: "{{ .Values.viewer.mapkey}}"
- name: BING_MAPS_KEY
value: "{{ .Values.viewer.mapkey}}"

0 comments on commit b28a5dc

Please sign in to comment.