Created
April 10, 2023 11:32
-
-
Save Aviksaikat/1273d8d885a74ddfcecb7794d1901469 to your computer and use it in GitHub Desktop.
Run vampi, capital, crapi in 1 single command using docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function usage() { | |
echo "Usage: $0 [-vampi|-capital|-crapi|-kill]" | |
exit 1 | |
} | |
function capital() { | |
cd capital/ | |
git pull | |
docker build . -t capital | |
docker run -d -p 8000:8000 -e DATABASE_URL=postgresql://postgres:[email protected]:5432/rwdb --rm --name backend-capital capital | |
} | |
function vampi() { | |
docker pull erev0s/vampi | |
docker run -d -p 5000:5000 erev0s/vampi:latest | |
} | |
function crapi() { | |
cd crAPI/deploy/docker/ | |
git pull | |
docker-compose pull | |
docker-compose -f docker-compose.yml --compatibility up -d | |
} | |
function kill_all_containers() { | |
echo "Killed" | |
docker rm -f $(docker ps -aq) | |
} | |
if [[ $# -eq 0 ]]; then | |
usage | |
fi | |
while [[ $# -gt 0 ]] | |
do | |
key="$1" | |
case $key in | |
-vampi) | |
vampi | |
shift | |
;; | |
-capital) | |
capital | |
shift | |
;; | |
-crapi) | |
crapi | |
shift | |
;; | |
-kill) | |
kill_all_containers | |
shift | |
;; | |
*) | |
echo "Invalid option: $1" | |
usage | |
exit 1 | |
;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment