dodane build i deploy skripte

This commit is contained in:
2024-03-23 01:42:59 +01:00
parent beb3424b16
commit 2bd1402ed0
3 changed files with 21 additions and 4 deletions

View File

@@ -25,16 +25,14 @@ The deployment is done via Docker:
## Building Docker image
Run the following command:
```bash
docker build . -t utility-bills-tracker:1.0.0
build.sh
```
The image will be stored in the local Docker instance.
## Deploying Docker service
Run the following command:
```bash
docker stack deploy \
-c docker-compose-deploy.yml \
utility-bills-tracker
deploy.sh
```
# Implementation details

15
build.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
if [ "$1" == "" ] ; then
printf "\nNisi zadao verziju Docker image-a koji treba buildati"
printf "\n\nSintaksa:\n\n build-prod-img.sh 1.0.0\n\n"
exit 1
fi
printf "\nBUILD START ...\n\n"
IMAGE_VERSION=$1
docker build . -t utility-bills-tracker:$IMAGE_VERSION
printf "\nBUILD DONE!\n\n"

4
deploy.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
docker stack deploy \
-c docker-compose-deploy.yml \
utility-bills-tracker