Skip to content

Commit dff373d

Browse files
author
Jeny Sadadia
committed
restart_services.sh: restart pipeline service when .env file changes
Environment variable `KCI_API_TOKEN` is required to run pipeline services. The variable is defined in `.env` file. Add a script to monitor `.env` file. If the file changes are detected, that is if the token is modified, restart all the services. Signed-off-by: Jeny Sadadia <jeny.sadadia@collabora.com>
1 parent a6dc5a3 commit dff373d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

restart_services.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
FILE=".env"
4+
inotifywait -m -e close_write $FILE |
5+
while read EVENT;
6+
do
7+
echo $EVENT
8+
echo ".env file changes detected. Restarting pipeline services..."
9+
docker-compose down
10+
docker-compose up --build --no-cache
11+
done

0 commit comments

Comments
 (0)