Skip to content

Commit c686d0a

Browse files
committed
add sed export to deploy.sh
1 parent 37fd20e commit c686d0a

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

MtdrSpring/backend/build.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ if [ -z "$DOCKER_REGISTRY" ]; then
1313
echo "Error: DOCKER_REGISTRY env variable needs to be set!"
1414
exit 1
1515
fi
16-
17-
1816
export IMAGE=${DOCKER_REGISTRY}/${IMAGE_NAME}:${IMAGE_VERSION}
1917

2018
mvn clean package spring-boot:repackage

MtdrSpring/backend/deploy.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ if [ -z "$OCI_REGION" ]; then
1616
echo "Error: OCI_REGION env variable needs to be set!"
1717
exit 1
1818
fi
19+
20+
if [ -z "$UI_USERNAME" ]; then
21+
echo "UI_USERNAME not set. Will get it with state_get"
22+
export UI_USERNAME=$(state_get UI_USERNAME)
23+
fi
24+
25+
if [ -z "$UI_USERNAME" ]; then
26+
echo "Error: UI_USERNAME env variable needs to be set!"
27+
exit 1
28+
fi
29+
1930
echo "Creating springboot deplyoment and service"
2031
export CURRENTTIME=$( date '+%F_%H:%M:%S' )
2132
echo CURRENTTIME is $CURRENTTIME ...this will be appended to generated deployment yaml
@@ -29,7 +40,8 @@ sed -e "s|%TODO_PDB_NAME%|${TODO_PDB_NAME}|g" todolistapp-springboot-${CURRENTTI
2940
mv -- /tmp/todolistapp-springboot-$CURRENTTIME.yaml todolistapp-springboot-$CURRENTTIME.yaml
3041
sed -e "s|%OCI_REGION%|${OCI_REGION}|g" todolistapp-springboot-${CURRENTTIME}.yaml > /tmp/todolistapp-springboot-$CURRENTTIME.yaml
3142
mv -- /tmp/todolistapp-springboot-$CURRENTTIME.yaml todolistapp-springboot-$CURRENTTIME.yaml
32-
43+
sed -e "s|%UI_USERNAME%|${UI_USERNAME}|g" todolistapp-springboot-${CURRENTTIME}.yaml > /tmp/todolistapp-springboot-$CURRENTTIME.yaml
44+
mv -- /tmp/todolistapp-springboot-$CURRENTTIME.yaml todolistapp-springboot-$CURRENTTIME.yaml
3345
if [ -z "$1" ]; then
3446
kubectl apply -f $SCRIPT_DIR/todolistapp-springboot-$CURRENTTIME.yaml -n mtdrworkshop
3547
else

0 commit comments

Comments
 (0)