-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from pimjansen/feature/ci
- Loading branch information
Showing
9 changed files
with
163 additions
and
10 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[global] | ||
; pid = /var/run/php-fpm.pid | ||
error_log = /proc/self/fd/2 | ||
log_level = notice | ||
daemonize = no | ||
; https://github.com/docker-library/php/pull/725#issuecomment-443540114 | ||
log_limit = 8192 | ||
|
||
[www] | ||
user = azure-oss | ||
group = azure-oss | ||
|
||
listen = 127.0.0.1:9000 | ||
catch_workers_output = yes | ||
decorate_workers_output = no | ||
|
||
; Allow access to the environment variables that were passed on to Docker | ||
clear_env = no | ||
|
||
; Process manager | ||
pm = ondemand | ||
pm.max_children = 5 | ||
pm.process_idle_timeout = 10s | ||
pm.max_requests = 500 | ||
pm.status_path = /status |
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,4 +1,4 @@ | ||
/vendor/ | ||
composer.lock | ||
.idea | ||
.phpunit.cache | ||
/composer.lock | ||
/.idea | ||
/.build |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
FROM php:8.1-fpm-buster | ||
|
||
# Install Composer | ||
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer | ||
|
||
# Install PHP package installer | ||
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ | ||
|
||
# Install packages | ||
RUN apt update && apt install -y zip curl fcgiwrap && \ | ||
chmod uga+x /usr/local/bin/install-php-extensions && \ | ||
install-php-extensions curl && \ | ||
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" | ||
|
||
ENV USER=azure-oss | ||
ENV UID=10000 | ||
ENV GID=10001 | ||
|
||
RUN addgroup \ | ||
--gid $GID \ | ||
--system $USER \ | ||
&& adduser \ | ||
--uid $UID \ | ||
--disabled-password \ | ||
--gecos "" \ | ||
--ingroup $USER \ | ||
$USER \ | ||
&& mkdir -p /app \ | ||
&& chown -R $UID:$GID /app | ||
|
||
# Add configuration files for PHP and PHPFPM | ||
COPY ./.docker/www.conf /usr/local/etc/php-fpm.d/ | ||
|
||
ARG UID=${UID:-10000} | ||
ARG GID=${GID:-10001} | ||
ARG USER=${USER:-azure-oss} | ||
RUN usermod -u $UID $USER && groupmod -g $GID $USER | ||
|
||
WORKDIR /app |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.PHONY: build | ||
build: cs static test install ## Runs cs, static, and test targets | ||
|
||
# https://www.gnu.org/software/make/manual/html_node/Force-Targets.html | ||
always: | ||
|
||
.PHONY: help | ||
help: | ||
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
.PHONY: install | ||
install: ## Install depedencies | ||
docker compose run phpfpm rm -rf composer.lock | ||
docker compose run phpfpm composer install | ||
|
||
.PHONY: cs | ||
cs: ## Fixes coding standard issues with laravel/pint | ||
docker compose run phpfpm vendor/bin/pint --repair | ||
|
||
.PHONY: coverage | ||
coverage: ## Collects coverage with phpunit | ||
docker compose run phpfpm vendor/bin/phpunit --coverage-text --coverage-clover=.build/logs/clover.xml | ||
|
||
.PHONY: test | ||
test: ## Runs tests with phpunit | ||
docker compose run -e AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;QueueEndpoint=http://azurite:10001/devstoreaccount1;TableEndpoint=http://azurite:10002/devstoreaccount1;" phpfpm vendor/bin/phpunit | ||
|
||
.PHONY: static | ||
static: ## Runs static analyzers | ||
docker compose run phpfpm vendor/bin/phpstan --memory-limit=2G | ||
|
||
.PHONY: baseline | ||
baseline: ## Generate baseline files | ||
docker compose run phpfpm vendor/bin/phpstan --memory-limit=2G --generate-baseline | ||
|
||
.PHONY: clean | ||
clean: ## Cleans up build and vendor files | ||
rm -rf vendor composer.lock .build | ||
|
||
.PHONY: bc | ||
bc: ## Check for breaking changes since last release | ||
docker run --env GITHUB_REPOSITORY="Azure-OSS/azure-storage-php-adapter-laravel" -u $(shell id -u) -v $(shell pwd):/app nyholm/roave-bc-check-ga |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
services: | ||
phpfpm: | ||
build: | ||
context: . | ||
args: | ||
UID: ${USER_ID:-1000} | ||
GID: ${GROUP_ID:-1000} | ||
user: "${UID:-1000}:${GID:-1000}" | ||
links: | ||
- "azurite" | ||
volumes: | ||
- .:/app | ||
|
||
azurite: | ||
image: mcr.microsoft.com/azure-storage/azurite | ||
ports: | ||
- 10000:10000 | ||
- 10001:10001 | ||
- 10002:10002 | ||
volumes: | ||
- azurite:/data | ||
|
||
volumes: | ||
azurite: | ||
driver: local |
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
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
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
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