Skip to content

Commit 965e220

Browse files
authored
Add files via upload
1 parent eac3a6b commit 965e220

File tree

4 files changed

+30
-14
lines changed

4 files changed

+30
-14
lines changed

docker-compose-dev.yml

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ services:
7373

7474
redis:
7575
image: redis
76+
container_name: url-sandbox_redis
7677
command: redis-server --requirepass changeme_927dhgs810d712fxs1
7778
networks:
7879
- backend

docker-compose-test.yml

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ services:
6969

7070
redis:
7171
image: redis
72+
container_name: url-sandbox_redis
7273
command: redis-server --requirepass changeme_927dhgs810d712fxs1
7374
networks:
7475
- backend

run.sh

+25-11
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@ setup_requirements () {
1111
}
1212

1313
wait_on_web_interface () {
14-
echo ''
1514
until $(curl --silent --head --fail http://127.0.0.1:8000 --output /dev/null); do
16-
echo -ne "\n\n[\033[47m\033[0;31mInitializing project in progress..\033[0m]\n\n"
1715
sleep 5
1816
done
19-
echo ''
2017
xdg-open http://127.0.0.1:8000/url/
2118
}
2219

@@ -29,33 +26,50 @@ dev_project () {
2926
}
3027

3128
stop_containers () {
32-
sudo docker stop $(sudo docker ps -aq)
29+
docker-compose -f docker-compose-test.yml down -v 2>/dev/null
30+
docker-compose -f docker-compose-dev.yml down -v 2>/dev/null
31+
docker stop $(docker ps | grep url-sandbox_ | awk '{print $1}') 2>/dev/null
32+
docker kill $(docker ps | grep url-sandbox_ | awk '{print $1}') 2>/dev/null
3333
}
3434

3535
deploy_aws_project () {
3636
echo "Will be added later on"
3737
}
3838

3939
auto_configure_test () {
40+
stop_containers
41+
wait_on_web_interface &
4042
setup_requirements
4143
test_project
44+
stop_containers
45+
kill %% 2>/dev/null
4246
}
4347

4448
auto_configure () {
49+
stop_containers
50+
wait_on_web_interface &
4551
setup_requirements
4652
dev_project
53+
stop_containers
54+
kill %% 2>/dev/null
4755
}
4856

4957
if [[ "$1" == "auto_test" ]]; then
50-
stop_containers
51-
wait_on_web_interface &
5258
auto_configure_test
53-
stop_containers
5459
fi
5560

5661
if [[ "$1" == "auto_configure" ]]; then
57-
stop_containers
58-
wait_on_web_interface &
5962
auto_configure
60-
stop_containers
61-
fi
63+
fi
64+
65+
kill %% 2>/dev/null
66+
67+
while read -p "`echo -e '\nChoose an option:\n1) Setup requirements (docker, docker-compose)\n2) Test the project (All servers and Sniffer)\n8) Run auto configuration\n9) Run auto test\n>> '`"; do
68+
case $REPLY in
69+
"1") setup_requirements;;
70+
"2") test_project;;
71+
"8") auto_configure;;
72+
"9") auto_configure_test;;
73+
*) echo "Invalid option";;
74+
esac
75+
done

shared/settings.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
"backend_key": "w9AMMSqmKo4gFfE3s!Ghy4cRbE]xiynWKJhoUN(!1IfsOpJ0Z1KypX2uXhfH(lsQQqQ92pvDobxBC_oc^3M,0EzuO2wGk9fzhO0aWpkzSA7WXf2kDKafLpevawhfxJa09=#OJmlCNJE9Fa107A@g1s",
1616
"mongo_settings_host": "mongodb",
1717
"mongo_settings": "mongodb://changeme_9620eh26sfvka017fx:changeme_0cx821ncf7qg17ahx3@mongodb:27017/?authSource=admin",
18-
"redis_settings": "redis://:changeme_927dhgs810d712fxs1@redis:6379/0",
18+
"redis_settings": "redis://:changeme_927dhgs810d712fxs1@url-sandbox_redis:6379/0",
1919
"celery_settings": {
20-
"celery_broker_url": "redis://:changeme_927dhgs810d712fxs1@redis:6379/0",
21-
"celery_result_backend": "redis://:changeme_927dhgs810d712fxs1@redis:6379/0",
20+
"celery_broker_url": "redis://:changeme_927dhgs810d712fxs1@url-sandbox_redis:6379/0",
21+
"celery_result_backend": "redis://:changeme_927dhgs810d712fxs1@url-sandbox_redis:6379/0",
2222
"name": "tasks"
2323
},
2424
"url_timeout": 10,

0 commit comments

Comments
 (0)