Skip to content

Commit 62aceb0

Browse files
committed
add build local and run flag
1 parent 465b32a commit 62aceb0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

deployment/build_and_push.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
DEV=0
44
PUSH=1
5+
RUNCONTAINER=0
56
# make dockerignore from .gitignore
67
cp .gitignore .dockerignore
78
for option in "$@"; do
@@ -12,6 +13,10 @@ for option in "$@"; do
1213
-n|--no-push)
1314
PUSH=0
1415
;;
16+
-r|--run)
17+
echo "Run the container after building it."
18+
RUNCONTAINER=1
19+
;;
1520
--help|--info|--h)
1621
echo "Build and push the current repository state into containers and publish them to"
1722
echo "gcr.io/diamond-privreg/daq-config-server/<container-name> ready for deployment."
@@ -21,6 +26,7 @@ for option in "$@"; do
2126
echo " "
2227
exit 0
2328
;;
29+
2430
-*|--*)
2531
echo "Unknown option ${option}. Use --help for info on option usage."
2632
exit 1
@@ -61,3 +67,8 @@ if [ $PUSH -gt 0 ]; then
6167
podman tag $MAIN_CONTAINER_NAME $MAIN_CONTAINER_TAG
6268
podman push $MAIN_CONTAINER_NAME $MAIN_CONTAINER_TAG
6369
fi
70+
71+
if [ $RUNCONTAINER -gt 0 ]; then
72+
echo "Running container ${MAIN_CONTAINER_NAME}..."
73+
podman run -d --name $MAIN_CONTAINER_NAME -p 8555:8555 $MAIN_CONTAINER_NAME
74+
fi

0 commit comments

Comments
 (0)