From 3f7018444e05f73bd63679647d38cf74cf89a6d2 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Wed, 24 Mar 2021 10:38:26 -0400 Subject: [PATCH 1/8] Fix date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5b1870..ae545d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # nystudio107/craft Change Log -## 2.4.28 - 2021.03.22 +## 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) From b0697b1cc398fb6bd467123b223f6b5240999d7d Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Wed, 24 Mar 2021 15:17:54 -0400 Subject: [PATCH 2/8] Added `make clean` to the Makefile --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c628f44..3625c75 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,12 @@ CONTAINER?=$(shell basename $(CURDIR))_php_1 -.PHONY: build dev pulldb restoredb up +.PHONY: build clean dev pulldb restoredb up build: up cd scripts/ && ./docker_prod_build.sh +clean: + docker-compose down -v + docker-compose up --build dev: up pulldb: up cd scripts/ && ./docker_pull_db.sh From bc28e9923e00a1f694efc7ba82d4a876bd6fa058 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Wed, 24 Mar 2021 15:18:40 -0400 Subject: [PATCH 3/8] Version 2.4.29 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae545d5..5d5f7ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # nystudio107/craft Change Log +## 2.4.29 - UNRELEASED +### Added +* Added `make clean` to the Makefile + ## 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) From 0b6ccd7c51a8a4ff13940682672cc2cbc573089c Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Wed, 24 Mar 2021 23:17:43 -0400 Subject: [PATCH 4/8] Add Makefile Project Commands to README.md Signed-off-by: Andrew Welch --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 6ee5595..12b5413 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,20 @@ 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, to the `cms/web/dist/` directory; the `scripts/.env.sh` must be set up first +- `make clean` - shuts down the Docker containers, removes any mounted volumes (including the database), and then rebuilds the containers from scratch +- `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 xxxx` - 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 From c86cad8ad340264fb63f3aa01378b9186f650f08 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Wed, 24 Mar 2021 23:18:27 -0400 Subject: [PATCH 5/8] Version 2.4.29 Signed-off-by: Andrew Welch --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d5f7ea..4e74567 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 2.4.29 - UNRELEASED ### Added * Added `make clean` to the Makefile +* Added **Makefile Project Commands** to `README.md` ## 2.4.28 - 2021.03.24 ### Fixed From 35cb16eb3c8d659698b1b1ed6bbd11b418989a87 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Thu, 25 Mar 2021 20:56:40 -0400 Subject: [PATCH 6/8] Deprecated, use Makefile command instead Signed-off-by: Andrew Welch --- scripts/docker_prod_build.sh | 39 ------------------------------------ 1 file changed, 39 deletions(-) delete mode 100755 scripts/docker_prod_build.sh diff --git a/scripts/docker_prod_build.sh b/scripts/docker_prod_build.sh deleted file mode 100755 index a4d3dad..0000000 --- a/scripts/docker_prod_build.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -# Build production assets -# -# Build the production assets inside of the buildchain Docker container -# -# @author nystudio107 -# @copyright Copyright (c) 2020 nystudio107 -# @link https://nystudio107.com/ -# @package craft-scripts -# @since 1.2.2 -# @license MIT - -# Get the directory of the currently executing script -DIR="$(dirname "${BASH_SOURCE[0]}")" - -# Include files -INCLUDE_FILES=( - "common/defaults.sh" - ".env.sh" - ) -for INCLUDE_FILE in "${INCLUDE_FILES[@]}" -do - if [[ ! -f "${DIR}/${INCLUDE_FILE}" ]] ; then - echo "File ${DIR}/${INCLUDE_FILE} is missing, aborting." - exit 1 - fi - source "${DIR}/${INCLUDE_FILE}" -done - -# Temporary db dump path (remote & local) -if [[ -z "${LOCAL_BUILDCHAIN_CONTAINER}" ]]; then - echo "Variable LOCAL_BUILDCHAIN_CONTAINER is missing from .env.sh, aborting." -else - docker exec -it ${LOCAL_BUILDCHAIN_CONTAINER} npm run build -fi - -# Normal exit -exit 0 From 6d71d47441d32b39d0b6656a07efa52512b2da33 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Thu, 25 Mar 2021 20:56:54 -0400 Subject: [PATCH 7/8] Add make npm xxx & make composer xxx commands Signed-off-by: Andrew Welch --- Makefile | 11 +++++++++-- README.md | 6 ++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3625c75..b516e0c 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,20 @@ CONTAINER?=$(shell basename $(CURDIR))_php_1 +BUILDCHAIN?=$(shell basename $(CURDIR))_webpack_1 -.PHONY: build clean 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 diff --git a/README.md b/README.md index 12b5413..77c1fdf 100644 --- a/README.md +++ b/README.md @@ -77,10 +77,12 @@ This project uses Docker to shrink-wrap the devops it needs to run around the pr 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, to the `cms/web/dist/` directory; the `scripts/.env.sh` must be set up first +- `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 xxxx` - 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 +- `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 From 34e80162aaf9c5d029e9a22388776c00eb153af1 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Thu, 25 Mar 2021 21:05:18 -0400 Subject: [PATCH 8/8] Version 2.4.29 Signed-off-by: Andrew Welch --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e74567..c9530b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,13 @@ # nystudio107/craft Change Log -## 2.4.29 - UNRELEASED +## 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