Skip to content
This repository was archived by the owner on Aug 16, 2025. It is now read-only.

Commit 8c97b4c

Browse files
committed
Merge branch 'develop'
2 parents dc8cdbb + 60c9bb8 commit 8c97b4c

35 files changed

Lines changed: 261 additions & 138 deletions

File tree

doc/dev/globals.adoc

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,18 @@ contains your application
9191

9292
|===
9393

94-
== Language or technology
94+
== Project
9595

9696
|===
97-
|variable |type |origin |description
97+
|variable |type |description
9898

9999
|`projectinit_language`
100100
|enum (`php`, `node`)
101-
|`ask_language`
102101
|Language or technology enum.
102+
103+
|`projectinit_project_type`
104+
|enum (`composer`, `symfony`, `nestjs`)
105+
|Project type.
103106
|===
104107

105108
=== PHP
@@ -111,10 +114,6 @@ contains your application
111114
|0/1 flag
112115
|Flag for using global or local Composer.
113116

114-
|`projectinit_php_project_type`
115-
|enum (`composer`, `symfony`)
116-
|Project type.
117-
118117
|`projectinit_is_composer_initialized`
119118
|0/1 flag
120119
|Flag to determine whether `comoser.json` is present.
@@ -168,10 +167,6 @@ contains your application
168167
|===
169168
|variable |type |description
170169

171-
|`projectinit_node_project_type`
172-
|enum(`nestjs`)
173-
|Project type.
174-
175170
|`projectinit_node_package_manager`
176171
|enum(`npm`, `yarn`, `pnpm`)
177172
|Package manager. Applied if the project type supports it.

src/container/docker/dev.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ build_dev() {
44
echo ""
55
echo "Building Dev container..."
66
cd "${project_root_dir}" || exit 1
7-
docker compose -f compose_dev.yaml build
7+
docker compose -f compose_dev.yaml --env-file .env.docker build
88
echo " Dev container built..."
99
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
add_user_and_group_ids() {
4+
if [ ! -f "${project_root_dir}/.env.docker" ]; then
5+
touch "${project_root_dir}/.env.docker"
6+
fi
7+
local user_id
8+
local group_id
9+
user_id=$(id -u)
10+
group_id=$(id -g)
11+
echo "PROJECTINIT_UID=${user_id}" >> "${project_root_dir}/.env.docker"
12+
echo "PROJECTINIT_GID=${group_id}" >> "${project_root_dir}/.env.docker"
13+
}

src/container/docker/installer.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ build_installer() {
44
echo ""
55
echo "Building Installer container..."
66
cd "${project_root_dir}" || exit 1;
7-
docker compose up --build
7+
docker compose --env-file "${project_root_dir}/.env.docker" build --no-cache
8+
docker compose --env-file "${project_root_dir}/.env.docker" up
89
echo " Installer container built..."
910
}
1011

src/git/generic_gitignore/generic.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ compose_secrets/
6262
## Symfony
6363
.env.local.php
6464
.env.*.local
65+
## Docker
66+
.env.docker
6567

6668
# Temporary files and runtime
6769
## Symfony

src/info_print.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ print_git_block() {
2626
echo "| User name: ${projectinit_git_user_name}"
2727
echo "| User email: ${projectinit_git_user_email}"
2828
if [ "${projectinit_use_projectinit_gitignore}" -eq 1 ]; then
29-
echo "| ProjectInit's .gitignore will be used."
29+
echo "| ProjectInit's .gitignore is used."
3030
else
31-
echo "| Your project's default .gitignore will be used."
31+
echo "| Your project's default .gitignore is used."
3232
fi
3333
echo "|---------------------------------------------------------------------"
3434
}
@@ -75,8 +75,8 @@ print_php_tech_stack() {
7575
echo "| Composer: globally installed composer"
7676
fi
7777
fi
78-
echo "| Project type: ${projectinit_php_project_type}"
79-
case $projectinit_php_project_type in
78+
echo "| Project type: ${projectinit_project_type}"
79+
case $projectinit_project_type in
8080
"composer" )
8181
echo "| Composer library name: ${projectinit_composer_library_name}"
8282
;;
@@ -94,25 +94,25 @@ print_php_tech_stack() {
9494
echo "| PHPUnit version: ${projectinit_phpunit_version}"
9595
if [ ! "$projectinit_phpunit_version" = "symfony/test-pack" ]; then
9696
if [ "$projectinit_use_projectinit_phpunit_dist" -eq 0 ]; then
97-
echo "| Default phpunit.dist.xml will be used"
97+
echo "| Default phpunit.dist.xml is used"
9898
else
99-
echo "| ProjectInit's phpunit.dist.xml will be used"
99+
echo "| ProjectInit's phpunit.dist.xml is used"
100100
fi
101101
else
102102
echo "| Symfony Test Pack was used. Configure phpunit.dist.xml manually"
103103
fi
104104
echo "| CS Fixer: PHP CS Fixer"
105105
if [ "$projectinit_use_projectinit_phpcsfixer_dist" -eq 0 ]; then
106-
echo "| Default .php-cs-fixer.dist.php will be used"
106+
echo "| Default .php-cs-fixer.dist.php is used"
107107
else
108-
echo "| ProjectInit's .php-cs-fixer.dist.php will be used"
108+
echo "| ProjectInit's .php-cs-fixer.dist.php is used"
109109
fi
110110
}
111111

112112
print_node_tech_stack() {
113-
echo "| Project type: ${projectinit_node_project_type}"
113+
echo "| Project type: ${projectinit_project_type}"
114114
echo "| Package manager: ${projectinit_node_package_manager}"
115-
case $projectinit_node_project_type in
115+
case $projectinit_project_type in
116116
"nestjs" )
117117
echo "| NestJS version: ${projectinit_nestjs_version}"
118118
;;

src/language/node/flow.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ run_node_flow() {
1111
}
1212

1313
run_node_docker_flow() {
14-
case $projectinit_node_project_type in
14+
case $projectinit_project_type in
1515
"nestjs" )
1616
# shellcheck source=./nestjs/flow.sh
1717
source "${tool_dir}/src/language/node/nestjs/flow.sh"

src/language/node/nestjs/container/docker/compose/v1/template/dev

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ services:
22
~~~service name~~~:
33
container_name: ~~~container name~~~
44
build:
5+
args:
6+
PROJECTINIT_UID: ${PROJECTINIT_UID}
7+
PROJECTINIT_GID: ${PROJECTINIT_GID}
58
context: ./
69
dockerfile: Dockerfile_dev
710
image: ~~~image name~~~

src/language/node/nestjs/container/docker/compose/v1/template/installer

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ services:
22
~~~service name~~~:
33
container_name: ~~~container name~~~
44
build:
5+
args:
6+
PROJECTINIT_UID: ${PROJECTINIT_UID}
7+
PROJECTINIT_GID: ${PROJECTINIT_GID}
58
context: ./
69
dockerfile: Dockerfile
710
image: ~~~image name~~~

src/language/node/nestjs/container/docker/compose/v1/template/prod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,4 @@ services:
1010
- "~~~host port~~~:3000"
1111
environment:
1212
- APP_ENV=prod
13-
- NODE_ENV=production
14-
volumes:
15-
- ./:/usr/src/app
13+
- NODE_ENV=production

0 commit comments

Comments
 (0)