Updated Makefile to run in the app container

This commit is contained in:
Chris Kankiewicz
2021-04-22 22:38:04 -07:00
parent 2fab8a1b02
commit 0fce758fbc
2 changed files with 15 additions and 14 deletions

View File

@@ -15,7 +15,7 @@ ENV XDG_CONFIG_HOME="/tmp/.config"
RUN a2enmod rewrite
RUN apt-get update && apt-get install --assume-yes libmemcached-dev libzip-dev \
RUN apt-get update && apt-get install --assume-yes libmemcached-dev libzip-dev tar zip \
&& rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install opcache zip \

View File

@@ -1,42 +1,43 @@
ARTIFACT_FILES=$$(paste --delimiters ' ' --serial artifacts.include)
ARTIFACT_NAME="DirectoryLister-$$(git describe --tags --exact-match HEAD 2> /dev/null || git rev-parse --short HEAD)"
RUN := docker-compose run --rm app
dev development: # Build application for development
@composer install --no-interaction
@npm install && npm run dev
@$(RUN) composer install --no-interaction
@$(RUN) npm install && npm run dev
prod production: # Build application for production
@composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader
@npm install --no-save && npm run production && npm prune --production
@$(RUN) composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader
@$(RUN) npm install --no-save && npm run production && npm prune --production
update upgrade: # Update application dependencies
@composer update && npm update && npm install && npm audit fix
@$(RUN) composer update && npm update && npm install && npm audit fix
analyze: # Run coding standards and static analysis checks
@app/vendor/bin/php-cs-fixer fix --diff --dry-run && app/vendor/bin/psalm
@npx eslint app/resources/js/**/*.{js,vue}
@$(RUN) app/vendor/bin/php-cs-fixer fix --diff --dry-run && app/vendor/bin/psalm
@$(RUN) npx eslint app/resources/js/**/*.{js,vue}
test: analyze # Run coding standards/static analysis checks and tests
@app/vendor/bin/phpunit --coverage-text
@$(RUN) app/vendor/bin/phpunit --coverage-text
coverage: # Generate an HTML coverage report
@app/vendor/bin/phpunit --coverage-html .coverage
@docker-compose run --rm -e XDEBUG_MODE=coverage app app/vendor/bin/phpunit --coverage-html .coverage
tunnel: # Expose the application via secure tunnel
@ngrok http -host-header=rewrite http://directory-lister.local:80
clear-assets: # Clear the compiled assets
@rm app/assets/* -rfv
@$(RUN) rm app/assets/* -rfv
clear-cache: # Clear the application cache
@rm app/cache/* -rfv
@$(RUN) rm app/cache/* -rfv
tar: # Generate tarball
@tar --exclude-vcs --exclude=app/cache/* --exclude=app/resources \
@$(RUN) tar --exclude-vcs --exclude=app/cache/* --exclude=app/resources \
--create --gzip --file artifacts/$(ARTIFACT_NAME).tar.gz $(ARTIFACT_FILES)
zip: # Generate zip file
@zip --quiet --exclude "*.git*" "app/cache/**" "app/resources/*" \
@$(RUN) zip --quiet --exclude "*.git*" "app/cache/**" "app/resources/*" \
--recurse-paths artifacts/$(ARTIFACT_NAME).zip $(ARTIFACT_FILES)
artifacts: clear-assets production tar zip # Generate release artifacts