-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.sh
More file actions
executable file
·29 lines (25 loc) · 916 Bytes
/
compose.sh
File metadata and controls
executable file
·29 lines (25 loc) · 916 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
#
# scripts/compose.sh - compose docker test & development environment
#
# 1. delete all docker containers
# 2. create docker containers, with optional script argument build, they are build with no cache
# 3. set DEEPL_API_KEY as taken from script running environment
# 4. doing Rails system test hack
#
# MIT License, Copyright (c) 2007 - 2024 Heiko Lübbe
# Ruby on Rail web application https://www.zitat-service.de, see https://github.com/muhme/quote
SCRIPTS_DIR=$(dirname $0)
"${SCRIPTS_DIR}/clean.sh"
if [ $# -eq 1 ] && [ "$1" = "build" ] ; then
echo ''
echo '*** Docker compose build --no-cache'
docker compose build --no-cache
fi
echo ''
echo '*** Docker compose up'
docker compose up -d
echo ''
echo "*** Setting DEEPL_API_KEY=\"${DEEPL_API_KEY}\""
docker exec -it quote_rails sh -c "echo export DEEPL_API_KEY=${DEEPL_API_KEY} >> ~/.bashrc"
echo "DEEPL_API_KEY=${DEEPL_API_KEY}" > .env