Skip to content

Commit d6b5fc3

Browse files
committed
feat: Project
- Added .env.dist file; - Added .gitkeep file; - Added init target to project.mk;
1 parent 0a62500 commit d6b5fc3

File tree

6 files changed

+31
-6
lines changed

6 files changed

+31
-6
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
/.idea
22
/src/.env*
3+
!/src/.env.dist
34
/src/.dc-running
45
/src/composer.json
56
/src/composer.lock
67
/src/src/
7-
/src/vendor/
8+
/src/vendor/
9+
/tests/install/*
10+
!/tests/install/.gitkeep

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
- _onlinesetup_ file that can be used to install project via a network, this file accepts three useful arguments: repository from which to install dockerizer (helps to debug or install own modification), branch (again, helps to debug or install own modification) and install directory in case your project uses same name as default install folder.
1717
- _Makefile_ file that includes other mk helper files from _.make_ directory.
1818
- _.make/tools.mk_ files for bash constants, _.make/tools/colors.mk_ file for bash colors
19-
- _.make/project.mk_ with targets for project managing: help, start, stop, restart etc.
19+
- _.make/project.mk_ with targets for project managing:
20+
- **help** prints list of all available commands;
21+
- **run**, **stop**, **restart** - containers management;
22+
- **init** copies .env.dist file;
23+
- **ps** shows running containers;
24+
- **logs** shows container logs;
25+
- **bash** enters to php container with bash;
26+
- _.env.dist_ file as an example for _.env_ file

src/.env.dist

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ENV=dev
2+
3+
# MySQL database
4+
MYSQL_HOST=localhost
5+
MYSQL_USER=db_user
6+
MYSQL_PASSWORD=db_password
7+
MYSQL_ROOT_PASSWORD=root # Change it on production!
8+
MYSQL_DATABASE=project
9+
10+
# Nginx
11+
NGINX_HOST=website.local

src/.make/project.mk

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,19 @@ help::
1414
@printf "$(GREEN) bash $(NC) Show containers logs\n\n\n"
1515
@printf "$(GREEN) NGINX_SERVER_CONFIG_FILE: $(NGINX_SERVER_CONFIG_FILE)\n"
1616

17+
.env.local .env.${ENV} .env.${ENV}.local:
18+
cp .env.dist $@
19+
20+
.PHONY: init
21+
init: .env .env.local .env.${ENV} .env.${ENV}.local
22+
1723
.PHONY: run
18-
run: .env .env.local src composer.json composer.lock vendor .docker docker-compose.base.yaml docker-compose.${ENV}.yaml
24+
run: init src composer.json composer.lock vendor .docker docker-compose.base.yaml docker-compose.${ENV}.yaml
1925
$(DOCKER_COMPOSE) up -d
2026
@touch .dc-running
2127

2228
.PHONY: ps
23-
ps:
29+
ps: init
2430
$(DOCKER_COMPOSE) ps -a
2531

2632
.PHONY: stop

tests/install/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/install/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)