Skip to content

Commit

Permalink
Updated scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
gardusig committed Sep 18, 2024
1 parent 9cd6c1f commit 5c742cf
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 41 deletions.
Binary file removed design.png
Binary file not shown.
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
db:
image: postgres:16-alpine
Expand Down
23 changes: 0 additions & 23 deletions script/cleanup.sh

This file was deleted.

10 changes: 5 additions & 5 deletions script/lint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cleanup_containers() {
echo "start cleaning up containers..."
stop_containers() {
echo "starting to stop containers..."
docker-compose down
echo "done cleaning up containers"
echo "done stopping containers..."
}

build_images() {
Expand All @@ -18,10 +18,10 @@ run_lint() {

main() {
set -e
cleanup_containers
stop_containers
build_images
run_lint
cleanup_containers
stop_containers
}

main
14 changes: 7 additions & 7 deletions script/start.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
SERVER_LIST="server_0 server_1 server_2"

cleanup_containers() {
echo "start cleaning up containers..."
stop_containers() {
echo "starting to stop containers..."
docker-compose down
echo "done cleaning up containers"
echo "done stopping containers..."
}

build_images() {
echo "start building images..."
echo "starting to build images..."
docker-compose build -q
echo "done building images"
}

start_database() {
echo "start setting up database container..."
echo "starting to set up database container..."
docker-compose up -d --force-recreate db
sleep 5
if ! docker-compose ps | grep -q "db"; then
Expand All @@ -25,7 +25,7 @@ start_database() {
}

start_servers() {
echo "start setting up server container(s)..."
echo "starting to set up server container(s)..."
for server in $SERVER_LIST; do
echo "start setting up container: ${server}..."
docker-compose up -d --force-recreate $server
Expand Down Expand Up @@ -56,7 +56,7 @@ start_nginx() {

main() {
set -e
cleanup_containers
stop_containers
build_images
start_database
start_servers
Expand Down
8 changes: 4 additions & 4 deletions script/test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cleanup_containers() {
echo "start cleaning up containers..."
stop_containers() {
echo "starting to stop containers..."
docker-compose down
echo "done cleaning up containers"
echo "done stopping containers..."
}

run_e2e_tests() {
Expand All @@ -18,7 +18,7 @@ run_e2e_tests() {
main() {
set -e
run_e2e_tests
cleanup_containers
stop_containers
}

main

0 comments on commit 5c742cf

Please sign in to comment.