Skip to content

Commit

Permalink
Any makefile target that uses ${TEST_IMAGE_TAG} should source .env in…
Browse files Browse the repository at this point in the history
… case the `build-image` target is invoked prior, e.g. "make build-image push-image"
  • Loading branch information
emetsger committed Apr 26, 2021
1 parent d0425e5 commit 9509fdd
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,33 +40,33 @@ push-image: .make/push-image
pull-image: .make/pull-image

.make/pull-image:
docker pull ${DOCKER_REGISTRY}/${IMAGE_NAME}:${TEST_IMAGE_TAG}
source .env && docker pull ${DOCKER_REGISTRY}/${IMAGE_NAME}:$${TEST_IMAGE_TAG}
@touch .make/pull-image

.PHONY: composer-update
composer-update: .make/pull-image .make/composer-update

.make/composer-update:
docker run --rm -v $$PWD:/app ${DOCKER_REGISTRY}/${IMAGE_NAME}:${TEST_IMAGE_TAG} update
source .env && docker run --rm -v $$PWD:/app ${DOCKER_REGISTRY}/${IMAGE_NAME}:$${TEST_IMAGE_TAG} update
@touch .make/composer-update

.PHONY: composer-install
composer-install: .make/pull-image .make/composer-install

.make/composer-install:
docker run --rm -v $$PWD:/app ${DOCKER_REGISTRY}/${IMAGE_NAME}:${TEST_IMAGE_TAG} install
source .env && docker run --rm -v $$PWD:/app ${DOCKER_REGISTRY}/${IMAGE_NAME}:$${TEST_IMAGE_TAG} install
@touch .make/composer-install

.PHONY: check-platform-reqs
check-platform-reqs: .make/pull-image .make/composer-update .make/check-platform-reqs

.make/check-platform-reqs:
docker run --rm -v $$PWD:/app ${DOCKER_REGISTRY}/${IMAGE_NAME}:${TEST_IMAGE_TAG} check-platform-reqs
source .env && docker run --rm -v $$PWD:/app ${DOCKER_REGISTRY}/${IMAGE_NAME}:$${TEST_IMAGE_TAG} check-platform-reqs
@touch .make/check-platform-reqs

.PHONY: test
test: .make/pull-image .make/composer-install .make/check-platform-reqs
docker run --rm -v $$PWD:/app ${DOCKER_REGISTRY}/${IMAGE_NAME}:${TEST_IMAGE_TAG} vendor/bin/phpunit tests
source .env && docker run --rm -v $$PWD:/app ${DOCKER_REGISTRY}/${IMAGE_NAME}:$${TEST_IMAGE_TAG} vendor/bin/phpunit tests

.PHONY: clean
clean:
Expand All @@ -85,8 +85,8 @@ echo-git-tag:

.PHONY: echo-image-tag
echo-image-tag:
@echo ${TEST_IMAGE_TAG}
@source .env && echo $${TEST_IMAGE_TAG}

.PHONY: update-lock-hash
update-lock-hash:
-@docker run --rm -v $$PWD:/app ${DOCKER_REGISTRY}/${IMAGE_NAME}:${TEST_IMAGE_TAG} update --lock
-source .env && @docker run --rm -v $$PWD:/app ${DOCKER_REGISTRY}/${IMAGE_NAME}:$${TEST_IMAGE_TAG} update --lock

0 comments on commit 9509fdd

Please sign in to comment.