-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
44 lines (33 loc) · 1000 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Makefile for building and running upmind-sdk-php
# Variables
IMAGE_NAME = upmind-sdk-php
CONTAINER_NAME = upmind-sdk-php
MOUNT_DIR = /upmind-sdk-php
.PHONY: all build run stop shell clean
# Default target
setup: build run
# Build the Docker image
build:
docker build -t $(IMAGE_NAME) .
# Run the Docker container in the background
run:
docker run -d --name $(CONTAINER_NAME) -v $(PWD):$(MOUNT_DIR) $(IMAGE_NAME)
# Stop the Docker container
stop:
docker stop $(CONTAINER_NAME)
# Get a shell into the running Docker container
shell:
docker exec -it $(CONTAINER_NAME) /bin/bash
# Run phpstan
static-analysis:
docker exec -it $(CONTAINER_NAME) ./vendor/bin/phpstan analyse --memory-limit=1G
# Run php-cs-fixer
coding-standards:
docker exec -it $(CONTAINER_NAME) php ./vendor/bin/php-cs-fixer fix --config=./.php-cs-fixer.dist.php
# Run phpunit
test:
docker exec -it $(CONTAINER_NAME) ./vendor/bin/phpunit
# Clean target
clean:
docker rm -f $(CONTAINER_NAME)
docker rmi $(IMAGE_NAME)