Skip to content

Commit debfd0f

Browse files
authored
Merge pull request #5 from techbizz-nepal/release-next
Align with main branch
2 parents 9ee143a + 52995b4 commit debfd0f

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

docker-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ services:
4848
image: "${PROJECT_NAME}/mysql:1.0"
4949
build: ./mysql
5050
volumes:
51-
- ./data/mysql:/var/lib/mysql
51+
- ./mysql/data/project_db:/var/lib/mysql
5252
- ${MYSQL_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
5353
ports:
5454
- "3306:3306"
@@ -64,7 +64,7 @@ services:
6464
image: "${PROJECT_NAME}/test_db:1.0"
6565
build: ./mysql
6666
volumes:
67-
- ./data/test_db:/var/lib/mysql
67+
- ./mysql/data/test_db:/var/lib/mysql
6868
- ${MYSQL_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
6969
ports:
7070
- "3307:3306"

headers/app.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
init_app(){
22
install_packages
3-
3+
run_migrations
44
if ! env_file_exists >> /dev/null 2>&1; then
55
cp_env
66
generate_key
77
fi
88
}
99

10+
run_migrations(){
11+
docker-compose -f $DOCKER_COMPOSE_FILE_PATH exec app php artisan migrate
12+
}
13+
1014
install_packages(){
1115
docker-compose -f $DOCKER_COMPOSE_FILE_PATH exec app composer install
1216
}

prepare_context.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,19 @@ if ! [ -f "$NGINX_REAL_SITE_PATH" ]; then
3030
fi
3131
printf "nginx site file looks ok.\n\n"
3232

33-
34-
if [ "$FIRST_ARG" = "build" ]; then
33+
printf "Validating main db file...\n\n"
34+
if ! [ -f "$MAIN_DB_FILE_PATH" ]; then
3535
create_sql_file_if_not_exist "$MYSQL_ENTRY_POINT_CREATE_MAIN_DB_CONTENT" "$MAIN_DB_FILE_PATH"
36+
printf "main db file validated.\n\n"
37+
fi
38+
printf "Validating test db file...\n\n"
39+
if ! [ -f "$TEST_DB_FILE_PATH" ]; then
3640
create_sql_file_if_not_exist "$MYSQL_ENTRY_POINT_CREATE_TEST_DB_CONTENT" "$TEST_DB_FILE_PATH"
41+
printf "test db file validated.\n\n"
42+
fi
43+
printf "db files looks ok.\n\n"
44+
45+
if [ "$FIRST_ARG" = "build" ]; then
3746
docker_down
3847
docker_build
3948
docker_up

0 commit comments

Comments
 (0)