Skip to content
This repository was archived by the owner on Jun 5, 2023. It is now read-only.

Commit 9415386

Browse files
Added dev container scripts
1 parent b3ae640 commit 9415386

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

create_dev_container.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
TEMP_FOLDER=/tmp/outliers_dev
3+
TARGET_HOST=""
4+
SLAVE_HOSTNAME=""
5+
6+
function display_usage() {
7+
echo "Usage: ./create_dev_container.sh --host <hostname>"
8+
echo -e "\t<hostname>\tThe SSH host to deploy the dev container on"
9+
echo -e "\t<slavename>\tThe slave hostname to set in the container, this matches the hostname configured in the master"
10+
echo ""
11+
exit
12+
}
13+
14+
POSITIONAL=()
15+
while [[ $# -gt 0 ]]
16+
do
17+
key="$1"
18+
19+
case $key in
20+
-h|--host)
21+
TARGET_HOST="$2"
22+
shift # past argument
23+
shift # past value
24+
;;
25+
--help)
26+
display_usage
27+
shift # past argument
28+
shift # past value
29+
;;
30+
*) # unknown option
31+
POSITIONAL+=("$1") # save it in an array for later
32+
shift # past argument
33+
;;
34+
esac
35+
done
36+
37+
if [ "$TARGET_HOST" == "" ] ; then
38+
display_usage
39+
fi
40+
41+
rsync -rav $(pwd) --exclude virtualenv --exclude .git --exclude venv $TARGET_HOST:$TEMP_FOLDER --delete
42+
ssh $TARGET_HOST "cd $TEMP_FOLDER/ee-outliers;docker-compose build;docker stop outliers;docker-compose up -d --force-recreate;docker logs outliers_dev --follow"

docker-compose.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: '3'
2+
services:
3+
outliers:
4+
build: .
5+
container_name: outliers_dev
6+
command: "python3 outliers.py daemon --config /mappedvolumes/config/outliers.conf"
7+
volumes:
8+
- ./defaults/outliers.conf:/mappedvolumes/config/outliers.conf
9+
networks:
10+
- sensor_network
11+
restart: always
12+
13+
networks:
14+
sensor_network:
15+
external:
16+
name: sensor_network

0 commit comments

Comments
 (0)