Skip to content

Commit

Permalink
Merge branch 'release/2.4.29' into craft-webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Mar 26, 2021
2 parents 80e597b + 34e8016 commit dc777b8
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 42 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# nystudio107/craft Change Log

## 2.4.28 - 2021.03.22
## 2.4.29 - 2021.03.25
### Added
* Added `make clean` to the Makefile
* Added **Makefile Project Commands** to `README.md`
* Added `make composer xxx` & `make npm xxx` commands

### Changed
* Remove deprecated `scripts/docker_prod_build.sh` in favor of `make build`

## 2.4.28 - 2021.03.24
### Fixed
* Fixed an issue with the `webpack-dev-server` version `^4.0.0-beta.1` by moving the `overlay` config setting to `client` (https://github.com/nystudio107/craft/issues/54)

Expand Down
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
CONTAINER?=$(shell basename $(CURDIR))_php_1
BUILDCHAIN?=$(shell basename $(CURDIR))_webpack_1

.PHONY: build dev pulldb restoredb up
.PHONY: build clean composer dev npm pulldb restoredb up

build: up
cd scripts/ && ./docker_prod_build.sh
docker exec -it ${BUILDCHAIN} npm run build
clean:
docker-compose down -v
docker-compose up --build
composer: up
docker exec -it ${CONTAINER} composer \
$(filter-out $@,$(MAKECMDGOALS))
dev: up
npm: up
docker exec -it ${BUILDCHAIN} npm \
$(filter-out $@,$(MAKECMDGOALS))
pulldb: up
cd scripts/ && ./docker_pull_db.sh
restoredb: up
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,22 @@ Build the production assets by typing `make build` to build the critical CSS, fo

**N.B.:** Without authorization & credentials (which are private), the `make pulldb` will not work (it just runs `scripts/docker_pull_db.sh`). It's provided here for instructional purposes.

## Makefile Project Commands

This project uses Docker to shrink-wrap the devops it needs to run around the project.

To make using it easier, we're using a Makefile and the built-in `make` utility to create local aliases. You can run the following from terminal in the project directory:

- `make dev` - starts up the local dev server listening on `http://localhost:8000/`
- `make build` - builds the static assets via the webpack 5 buildchain
- `make clean` - shuts down the Docker containers, removes any mounted volumes (including the database), and then rebuilds the containers from scratch
- `make composer xxx` - runs the `composer` command passed in, e.g. `make composer install`
- `make npm xxx` - runs the `npm` command passed in, e.g. `make npm install`
- `make pulldb` - runs the `scripts/docker_pull_db.sh` script to pull a remote database into the database container; the `scripts/.env.sh` must be set up first
- `make restoredb xxx` - runs the `scripts/docker_restore_db.sh` script to restore a local database dump into the database container; the `scripts/.env.sh` must be set up first

### Other notes

To update to the latest Composer packages (as constrained by the `cms/composer.json` semvers), do:
```
rm cms/composer.lock
Expand Down
39 changes: 0 additions & 39 deletions scripts/docker_prod_build.sh

This file was deleted.

0 comments on commit dc777b8

Please sign in to comment.