Skip to content

Commit 3fce818

Browse files
committed
updated dev
1 parent 4356068 commit 3fce818

File tree

1 file changed

+51
-14
lines changed

1 file changed

+51
-14
lines changed

dev

Lines changed: 51 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,67 @@ fi
1212
if [ $# -gt 0 ];then
1313
if [ "$1" == "up" ]; then
1414
shift 1
15-
cat file_id.diz
1615
$COMPOSE up
1716
fi
17+
if [ "$1" == "build" ]; then
18+
shift 1
19+
$COMPOSE build --parallel && $COMPOSE up
20+
fi
21+
if [ "$1" == "test" ]; then
22+
shift 1
23+
docker exec -ti noc /var/www/html/vendor/bin/phpunit /var/www/noc/sbin/tests
24+
fi
1825
if [ "$1" == "ssh" ]; then
19-
container=$(docker ps -q --filter="NAME=$2")
20-
docker exec -ti $container bash
26+
shift 1
27+
container=$(docker ps -q --filter="NAME=$1")
28+
docker exec -ti ${container} bash
29+
fi
30+
if [ "$1" == "mysqlshell" ]; then
31+
shift 1
32+
docker exec -it mysql-docker mysql -u root -h localhost -pmyrootpassword
33+
docker exec -it mysql-docker /bin/bash
34+
fi
35+
if [ "$1" == "purge" ]; then
36+
shift 1
37+
docker stop $(docker ps -a -q)
38+
docker rm $(docker ps -a -q)
39+
docker system prune -a -f
2140
fi
2241
if [ "$1" == "destroy" ]; then
2342
shift 1
24-
# Stop all containers
2543
docker stop $(docker ps -a -q)
26-
# Delete all containers
2744
docker rm $(docker ps -a -q)
28-
# Delete all images
29-
# docker rmi $(docker images -q)
3045
docker system prune -a -f
31-
docker volume prune -f
46+
docker system prune -a -f --volumes
3247
fi
3348
else
49+
clear
50+
cat <<'EOF'
51+
____ ____ ___ __ __ _ __ _ __ __ _ ___
52+
( _ \( __)/ __)( )( ( \( ( \( )( ( \ / __)
53+
) _ ( ) _)( (_ \ )( / // / )( / /( (_ \
54+
(____/(____)\___/(__)\_)__)\_)__)(__)\_)__) \___/
55+
____ _ _ ____ ____
56+
( _ \/ )( \( _ \/ _ \
57+
) __/) __ ( ) __/) _ (
58+
(__) \_)(_/(__) \____/
59+
____ ____ _ _
60+
( \( __)/ )( \
61+
) D ( ) _) \ \/ /
62+
(____/(____) \__/
63+
3464
35-
printf "░▒▓█ Usage \n"
36-
printf "./dev {option} \n\n"
37-
echo "up -- Brings up the dev environment"
38-
echo "down -- Brings down the dev environment"
39-
echo "destroy -- Destorys all docker containers and images"
40-
printf "\n"
65+
EOF
66+
docker ps
67+
printf "\n\n"
68+
printf "usage:\n"
69+
printf "./dev {option} \n\n"
70+
printf "up -- Brings up the dev environment\n"
71+
printf "build -- Builds and Brings up the dev environment\n"
72+
printf "mysqlshell -- Connects to mysql container and mysql\n"
73+
printf "ssh {name} -- Connects to specified container by name\n"
74+
printf "test -- Run PHPUnit tests\n"
75+
printf "purge -- Purges all docker containers and images. (Keeps database volumes)\n"
76+
printf "destroy -- Destorys all docker containers and images\n"
77+
printf "\n"
4178
fi

0 commit comments

Comments
 (0)