Skip to content

Commit 282c40b

Browse files
Jeny SadadiaJenySadadia
Jeny Sadadia
authored andcommitted
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 <[email protected]>
1 parent ca179fe commit 282c40b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

restart_services.sh

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

0 commit comments

Comments
 (0)