-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add make targets that use Docker to install PHP and Node dependencies. Use make targets in ansible build task to make deploy and local dev more consistent.
- Loading branch information
Showing
2 changed files
with
40 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
current_user = $(shell id -u) | ||
current_group = $(shell id -g) | ||
current_user := $(shell id -u) | ||
current_group := $(shell id -g) | ||
BUILD_DIR := $(PWD) | ||
TMPDIR := $(BUILD_DIR)/tmp | ||
COMPOSER_FLAGS := | ||
NPM_FLAGS := --prefer-offline | ||
DOCKER_FLAGS := --interactive --tty | ||
|
||
js-install: | ||
-mkdir -p tmp/home | ||
-echo "node:x:$(current_user):$(current_group)::/var/nodehome:/bin/bash" > tmp/passwd | ||
docker run --rm -it --user $(current_user):$(current_group) -v $(PWD):/data:delegated -w /data -v $(PWD)/tmp/home:/var/nodehome:delegated -v $(PWD)/tmp/passwd:/etc/passwd node:8 npm install --prefer-offline | ||
install-js: | ||
-mkdir -p $(TMPDIR)/home | ||
-echo "node:x:$(current_user):$(current_group)::/var/nodehome:/bin/bash" > $(TMPDIR)/passwd | ||
docker run --rm $(DOCKER_FLAGS) --user $(current_user):$(current_group) -v $(BUILD_DIR):/data:delegated -w /data -v $(TMPDIR)/home:/var/nodehome:delegated -v $(TMPDIR)/passwd:/etc/passwd node:8 npm install $(NPM_FLAGS) | ||
|
||
install-php: | ||
docker run --rm $(DOCKER_FLAGS) --volume $(BUILD_DIR):/app -w /app --volume ~/.composer:/composer --user $(current_user):$(current_group) composer install --ignore-platform-reqs $(COMPOSER_FLAGS) | ||
|
||
js: | ||
docker run --rm -it --user $(current_user):$(current_group) -v $(PWD):/data:delegated -w /data -e NO_UPDATE_NOTIFIER=1 node:8 npm run build-assets | ||
docker run --rm -it --user $(current_user):$(current_group) -v $(PWD):/data:delegated -w /data -e NO_UPDATE_NOTIFIER=1 node:8 npm run copy-assets | ||
docker run --rm $(DOCKER_FLAGS) --user $(current_user):$(current_group) -v $(BUILD_DIR):/data:delegated -w /data -e NO_UPDATE_NOTIFIER=1 node:8 npm run build-assets | ||
docker run --rm $(DOCKER_FLAGS) --user $(current_user):$(current_group) -v $(BUILD_DIR):/data:delegated -w /data -e NO_UPDATE_NOTIFIER=1 node:8 npm run copy-assets | ||
|
||
clear: | ||
rm -rf var/cache/ | ||
|
||
ui: clear js | ||
|
||
.PHONY: js js-install clear ui | ||
.PHONY: js clear ui install-php install-js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters