Skip to content

Commit 8e5f2b0

Browse files
added Dockerfile, improved UX
1 parent dde9c1d commit 8e5f2b0

File tree

6 files changed

+56
-17
lines changed

6 files changed

+56
-17
lines changed

01-deploy-prerequisities.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,5 @@ echo " ----------------------------------------------"
7070
echo ""
7171
echo ""
7272
echo ""
73-
echosuccess "[COMPLETED] The deployment of prerequisities has been completed. Now you can proceed to deployment of CBS with **02-deploy-cbs.sh** script file."
73+
echosuccess "[STEP COMPLETED] The deployment of prerequisities has been completed. Now you can proceed to deployment of CBS with **02-deploy-cbs.sh** script file."
7474
echo ""

02-deploy-cbs.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#!/bin/bash
22
set -e
3-
SHOW_DEBUG_OUTPUT=false
43

54
source $(dirname $0)/script-modules/common.sh
65

7-
86
# Read the bicep parameters
97
parametersfilename='./02-cbs.bicepparam'
108

@@ -60,15 +58,15 @@ enablementOutput=$(az vm image terms accept \
6058
accepted=`echo $enablementOutput | jq -r '.properties.outputs.accepted.value'`
6159
if [ $accepted ]
6260
then
63-
echosuccess "[COMPLETED] Plan '$AZURE_MARKETPLACE_PLAN_NAME' enabled."
61+
echosuccess "[STEP COMPLETED] Plan '$AZURE_MARKETPLACE_PLAN_NAME' enabled."
6462
else
6563
echoerr "[Step #1][FAILURE] Enablement failed - offer: $AZURE_MARKETPLACE_PLAN_OFFER, plan: $AZURE_MARKETPLACE_PLAN_NAME, publisher: $AZURE_MARKETPLACE_PUBLISHER"
6664
echo $enablementOutput
6765
exit 1;
6866
fi
6967

7068
echo -e "${C_BLUE3}${C_GREY85}
71-
[Step #2] Deploying CBS managed app:${NO_FORMAT}
69+
[Step #2] Deploying CBS managed app (~20mins):${NO_FORMAT}
7270
"
7371
echo "
7472
Subscription Id: $subscriptionId
@@ -99,7 +97,7 @@ cbsiSCSIEndpointCT1=`echo $output | jq -r '.properties.outputs.cbsiSCSIEndpointC
9997
echo ""
10098
echo ""
10199
echo ""
102-
echosuccess "[COMPLETED] The deployment of CBS managed application has been completed."
100+
echosuccess "[STEP COMPLETED] The deployment of CBS managed application has been completed."
103101
echo ""
104102

105103
echo " ******** Array parameters ********"

03-deploy-test-vm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ resourceGroupName=`echo $paramsJson | jq -r ".parameters.resourceGroupName.value
4545

4646

4747
echo -e "${C_BLUE3}${C_GREY85}
48-
[Step #2] Deploying VM into subscription $subscriptionId into RG ${resourceGroupName}:${NO_FORMAT}
48+
[Step #2] Deploying VM into subscription $subscriptionId into RG ${resourceGroupName} (~20mins):${NO_FORMAT}
4949
5050
"
5151

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM ubuntu:22.10
2+
3+
RUN apt-get update && apt-get install -y \
4+
jq \
5+
curl \
6+
libicu-dev
7+
8+
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
9+
10+
RUN az bicep install
11+
12+
# install bicep
13+
RUN curl -sLo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64 \
14+
&& chmod +x ./bicep \
15+
&& mv ./bicep /usr/local/bin/bicep \
16+
&& bicep --version
17+
18+
VOLUME [ "/data" ]
19+
WORKDIR /data
20+
21+
CMD ["/bin/bash", "-c", "az login && bash"]

README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,33 @@
22

33
## Prerequisites
44
- bash
5-
- Windows (**WSL recommended**) / Linux<sup>[1]</sup> / MacOS<sup>[2]</sup>
6-
- `az-cli`, `bicep-cli`, `jq` (all should get installed with setup-machine script)
5+
- Docker or Windows (**WSL recommended**) / Linux<sup>[1]</sup> / MacOS<sup>[2]</sup>
6+
- `az-cli`, `bicep-cli`, `jq` (all should get installed with setup-machine script or included in the Dockerfile)
77

8-
<small><sup>[1],[2]</sup> not fully tested, please report any issue you find</small>
8+
<small><sup>[1],[2]</sup> these OS are not fully tested, please report any issue you find</small>
99

1010
## Installation
1111

12+
You can also run all commands in this repo on your computer or in container using the prepared Dockerfile in the repo.
13+
14+
15+
### In Docker container
16+
17+
1. Build the container image with command:
18+
```bash
19+
$ docker build . -t cbs-bicep
20+
```
21+
1. Run the container:
22+
```bash
23+
$ docker run -v .:/data -it cbs-bicep
24+
```
25+
1. Follow instructions on screen to authenticate into Azure CLI via device code login method.
26+
27+
<br>
28+
<i>or:</i>
29+
<br>
30+
31+
### On local computer
1232

1333
1. Add permissions to execute scripts:
1434
```bash

deploy-e2e-demo.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ echo " ----------------------------------------------"
6666
echo ""
6767
echo ""
6868
echo ""
69-
echosuccess "[COMPLETED] The deployment of prerequisities has been completed."
69+
echosuccess "[STEP COMPLETED] The deployment of prerequisities has been completed."
7070
echo ""
7171

7272
# Read the bicep parameters for CBS
7373
mainfilename='./templates/cbs-managed-app.bicep'
74-
tmpfilename='./templates/02-cbs.bicepparam'
75-
bicep_raw=`bicep generate-params $mainfilename --output-format bicepparam --outfile $tmpfilename`
74+
tmpfilename='./templates/tmp-e2e-02.bicepparam'
75+
bicep_gen_raw=`bicep generate-params $mainfilename --output-format bicepparam --outfile $tmpfilename`
7676
bicep_raw=`bicep build-params $tmpfilename --stdout`
7777
paramsJson=`echo $bicep_raw | jq -r ".parametersJson"`
7878

@@ -96,15 +96,15 @@ enablementOutput=$(az vm image terms accept \
9696
accepted=`echo $enablementOutput | jq -r '.properties.outputs.accepted.value'`
9797
if [ $accepted ]
9898
then
99-
echosuccess "[COMPLETED] Plan '$AZURE_MARKETPLACE_PLAN_NAME' enabled."
99+
echosuccess "[STEP COMPLETED] Plan '$AZURE_MARKETPLACE_PLAN_NAME' enabled."
100100
else
101101
echoerr "[Step #2][FAILURE] Enablement failed - offer: $AZURE_MARKETPLACE_PLAN_OFFER, plan: $AZURE_MARKETPLACE_PLAN_NAME, publisher: $AZURE_MARKETPLACE_PUBLISHER"
102102
echo $enablementOutput
103103
exit 1;
104104
fi
105105

106106
echo -e "${C_BLUE3}${C_GREY85}
107-
[Step #3] Deploying CBS managed app:${NO_FORMAT}
107+
[Step #3] Deploying CBS managed app (~20mins):${NO_FORMAT}
108108
"
109109

110110
# Deploy our infrastructure
@@ -141,7 +141,7 @@ cbsiSCSIEndpointCT1=`echo $output | jq -r '.properties.outputs.cbsiSCSIEndpointC
141141
echo ""
142142
echo ""
143143
echo ""
144-
echosuccess "[COMPLETED] The deployment of CBS managed application has been completed."
144+
echosuccess "[STEP COMPLETED] The deployment of CBS managed application has been completed."
145145
echo ""
146146

147147
echo " ******** Array parameters ********"
@@ -188,7 +188,7 @@ fi
188188

189189

190190
echo -e "${C_BLUE3}${C_GREY85}
191-
[Step #5] Deploying VM into subscription $subscriptionId into RG ${resourceGroupName}:${NO_FORMAT}
191+
[Step #5] Deploying VM into subscription $subscriptionId into RG ${resourceGroupName} (~20mins):${NO_FORMAT}
192192
193193
"
194194

0 commit comments

Comments
 (0)