Skip to content

Commit

Permalink
chore: padrões
Browse files Browse the repository at this point in the history
Tanto para tarefas de makefile como para informaçẽos de labels.

================> EXTRAS <================
> Branch name:	main
  • Loading branch information
devdrops committed Nov 12, 2023
1 parent 45adf05 commit 7cf2155
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 72 deletions.
4 changes: 3 additions & 1 deletion 7.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ FROM php:7.4-alpine
ARG VCS_REF
ARG BUILD_DATE
ARG BUILD_VERSION
ARG VERSION
ARG INSTALL_XDEBUG=false

LABEL maintainer="Davi Marcondes Moreira <[email protected]>" \
Expand All @@ -12,7 +13,8 @@ LABEL maintainer="Davi Marcondes Moreira <[email protected]>" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-url="https://github.com/devdrops/php-toolbox" \
org.label-schema.schema-version="1.0" \
org.label-schema.version=$BUILD_VERSION
org.label-schema.build-version=$BUILD_VERSION \
org.label-schema.project-version=$VERSION

# Port usage for built-in server
EXPOSE 8000/tcp
Expand Down
43 changes: 26 additions & 17 deletions 7.4/Makefile
Original file line number Diff line number Diff line change
@@ -1,48 +1,57 @@
# ------------------------------------------------------------------------------------------------------
# Variables and arguments required
SHELL := '/bin/bash'

.DEFAULT_GOAL := help
GIT_LAST_COMMIT_HASH := $(shell git rev-parse --short HEAD)
CURRENT_DATE_GMT := $(shell date +"%Y-%m-%dT%H:%M:%S_GMT%Z")
VERSION := $(shell git describe --tags --always)
# ------------------------------------------------------------------------------------------------------


develop:
# ------------------------------------------------------------------------------------------------------
develop: ## Build '*-dev' tag, including Xdebug.
@echo "Building tag '7.4-dev'"
docker build \
--build-arg BUILD_VERSION=7.4-dev \
--build-arg INSTALL_XDEBUG=true \
--no-cache \
-t devdrops/php-toolbox:7.4-dev .

latest:
# ------------------------------------------------------------------------------------------------------
build: ## Build the official tag.
@echo "Building tag '7.4'"
docker build \
--build-arg VCS_REF=$(GIT_LAST_COMMIT_HASH) \
--build-arg BUILD_DATE=$(CURRENT_DATE_GMT) \
--build-arg BUILD_VERSION=$(GIT_LAST_COMMIT_HASH) \
--build-arg VERSION="$(VERSION)" \
--build-arg INSTALL_XDEBUG=false \
--no-cache \
-t devdrops/php-toolbox:7.4 .
# ------------------------------------------------------------------------------------------------------
debug: ## Build only the image with Xdebug.
@echo "Build tag '7.4-xdebug'"
docker build \
--build-arg VCS_REF=$(GIT_LAST_COMMIT_HASH) \
--build-arg BUILD_DATE=$(CURRENT_DATE_GMT) \
--build-arg BUILD_VERSION=$(GIT_LAST_COMMIT_HASH) \
--build-arg VERSION="$(VERSION)" \
--build-arg INSTALL_XDEBUG=true \
--no-cache \
-t devdrops/php-toolbox:7.4-xdebug .

debug:
@echo "Build tag '7.4-xdebug'"
docker build \
--build-arg VCS_REF=$(GIT_LAST_COMMIT_HASH) \
--build-arg BUILD_DATE=$(CURRENT_DATE_GMT) \
--build-arg BUILD_VERSION=$(GIT_LAST_COMMIT_HASH) \
--build-arg INSTALL_XDEBUG=true \
--no-cache \
-t devdrops/php-toolbox:7.4-xdebug .

push:
# ------------------------------------------------------------------------------------------------------
latest: build debug ## Build two images: 1. official tag, 2. official tag + Xdebug.
# ------------------------------------------------------------------------------------------------------
push: ## Pushes to Docker Hub two images: 1. official tag, 2. official tag + Xdebug.
@echo "Pushing tags '7.4' and '7.4-xdebug'"
docker push devdrops/php-toolbox:7.4
docker push devdrops/php-toolbox:7.4-xdebug
# ------------------------------------------------------------------------------------------------------
release: latest push ## Build and deploy official tags.
# ------------------------------------------------------------------------------------------------------
help: ## Print information of each Make task.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
# ------------------------------------------------------------------------------------------------------


.PHONY: develop latest push
# ------------------------------------------------------------------------------------------------------
.PHONY: develop build debug latest push release help
4 changes: 3 additions & 1 deletion 8.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ FROM php:8.0-alpine
ARG VCS_REF
ARG BUILD_DATE
ARG BUILD_VERSION
ARG VERSION
ARG INSTALL_XDEBUG=false

LABEL maintainer="Davi Marcondes Moreira <[email protected]>" \
Expand All @@ -12,7 +13,8 @@ LABEL maintainer="Davi Marcondes Moreira <[email protected]>" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-url="https://github.com/devdrops/php-toolbox" \
org.label-schema.schema-version="1.0" \
org.label-schema.version=$BUILD_VERSION
org.label-schema.build-version=$BUILD_VERSION \
org.label-schema.project-version=$VERSION

# Port usage for built-in server
EXPOSE 8000/tcp
Expand Down
43 changes: 26 additions & 17 deletions 8.0/Makefile
Original file line number Diff line number Diff line change
@@ -1,48 +1,57 @@
# ------------------------------------------------------------------------------------------------------
# Variables and arguments required
SHELL := '/bin/bash'

.DEFAULT_GOAL := help
GIT_LAST_COMMIT_HASH := $(shell git rev-parse --short HEAD)
CURRENT_DATE_GMT := $(shell date +"%Y-%m-%dT%H:%M:%S_GMT%Z")
VERSION := $(shell git describe --tags --always)
# ------------------------------------------------------------------------------------------------------


develop:
# ------------------------------------------------------------------------------------------------------
develop: ## Build '*-dev' tag, including Xdebug.
@echo "Building tag '8.0-dev'"
docker build \
--build-arg BUILD_VERSION=8.0-dev \
--build-arg INSTALL_XDEBUG=true \
--no-cache \
-t devdrops/php-toolbox:8.0-dev .

latest:
# ------------------------------------------------------------------------------------------------------
build: ## Build the official tag.
@echo "Building tag '8.0'"
docker build \
--build-arg VCS_REF=$(GIT_LAST_COMMIT_HASH) \
--build-arg BUILD_DATE=$(CURRENT_DATE_GMT) \
--build-arg BUILD_VERSION=$(GIT_LAST_COMMIT_HASH) \
--build-arg VERSION="$(VERSION)" \
--build-arg INSTALL_XDEBUG=false \
--no-cache \
-t devdrops/php-toolbox:8.0 .
# ------------------------------------------------------------------------------------------------------
debug: ## Build only the image with Xdebug.
@echo "Build tag '8.0-xdebug'"
docker build \
--build-arg VCS_REF=$(GIT_LAST_COMMIT_HASH) \
--build-arg BUILD_DATE=$(CURRENT_DATE_GMT) \
--build-arg BUILD_VERSION=$(GIT_LAST_COMMIT_HASH) \
--build-arg VERSION="$(VERSION)" \
--build-arg INSTALL_XDEBUG=true \
--no-cache \
-t devdrops/php-toolbox:8.0-xdebug .

debug:
@echo "Build tag '8.0-xdebug'"
docker build \
--build-arg VCS_REF=$(GIT_LAST_COMMIT_HASH) \
--build-arg BUILD_DATE=$(CURRENT_DATE_GMT) \
--build-arg BUILD_VERSION=$(GIT_LAST_COMMIT_HASH) \
--build-arg INSTALL_XDEBUG=true \
--no-cache \
-t devdrops/php-toolbox:8.0-xdebug .

push:
# ------------------------------------------------------------------------------------------------------
latest: build debug ## Build two images: 1. official tag, 2. official tag + Xdebug.
# ------------------------------------------------------------------------------------------------------
push: ## Pushes to Docker Hub two images: 1. official tag, 2. official tag + Xdebug.
@echo "Pushing tags '8.0' and '8.0-xdebug'"
docker push devdrops/php-toolbox:8.0
docker push devdrops/php-toolbox:8.0-xdebug
# ------------------------------------------------------------------------------------------------------
release: latest push ## Build and deploy official tags.
# ------------------------------------------------------------------------------------------------------
help: ## Print information of each Make task.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
# ------------------------------------------------------------------------------------------------------


.PHONY: develop latest debug push
# ------------------------------------------------------------------------------------------------------
.PHONY: develop build debug latest push release help
4 changes: 3 additions & 1 deletion 8.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ FROM php:8.1-alpine
ARG VCS_REF
ARG BUILD_DATE
ARG BUILD_VERSION
ARG VERSION
ARG INSTALL_XDEBUG=false

LABEL maintainer="Davi Marcondes Moreira <[email protected]>" \
Expand All @@ -12,7 +13,8 @@ LABEL maintainer="Davi Marcondes Moreira <[email protected]>" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-url="https://github.com/devdrops/php-toolbox" \
org.label-schema.schema-version="1.0" \
org.label-schema.version=$BUILD_VERSION
org.label-schema.build-version=$BUILD_VERSION \
org.label-schema.project-version=$VERSION

# Port usage for built-in server
EXPOSE 8000/tcp
Expand Down
43 changes: 26 additions & 17 deletions 8.1/Makefile
Original file line number Diff line number Diff line change
@@ -1,48 +1,57 @@
# ------------------------------------------------------------------------------------------------------
# Variables and arguments required
SHELL := '/bin/bash'

.DEFAULT_GOAL := help
GIT_LAST_COMMIT_HASH := $(shell git rev-parse --short HEAD)
CURRENT_DATE_GMT := $(shell date +"%Y-%m-%dT%H:%M:%S_GMT%Z")
VERSION := $(shell git describe --tags --always)
# ------------------------------------------------------------------------------------------------------


develop:
# ------------------------------------------------------------------------------------------------------
develop: ## Build '*-dev' tag, including Xdebug.
@echo "Building tag '8.1-dev'"
docker build \
--build-arg BUILD_VERSION=8.1-dev \
--build-arg INSTALL_XDEBUG=true \
--no-cache \
-t devdrops/php-toolbox:8.1-dev .

latest:
# ------------------------------------------------------------------------------------------------------
build: ## Build the official tag.
@echo "Building tag '8.1'"
docker build \
--build-arg VCS_REF=$(GIT_LAST_COMMIT_HASH) \
--build-arg BUILD_DATE=$(CURRENT_DATE_GMT) \
--build-arg BUILD_VERSION=$(GIT_LAST_COMMIT_HASH) \
--build-arg VERSION="$(VERSION)" \
--build-arg INSTALL_XDEBUG=false \
--no-cache \
-t devdrops/php-toolbox:8.1 .
# ------------------------------------------------------------------------------------------------------
debug: ## Build only the image with Xdebug.
@echo "Build tag '8.1-xdebug'"
docker build \
--build-arg VCS_REF=$(GIT_LAST_COMMIT_HASH) \
--build-arg BUILD_DATE=$(CURRENT_DATE_GMT) \
--build-arg BUILD_VERSION=$(GIT_LAST_COMMIT_HASH) \
--build-arg VERSION="$(VERSION)" \
--build-arg INSTALL_XDEBUG=true \
--no-cache \
-t devdrops/php-toolbox:8.1-xdebug .

debug:
@echo "Build tag '8.1-xdebug'"
docker build \
--build-arg VCS_REF=$(GIT_LAST_COMMIT_HASH) \
--build-arg BUILD_DATE=$(CURRENT_DATE_GMT) \
--build-arg BUILD_VERSION=$(GIT_LAST_COMMIT_HASH) \
--build-arg INSTALL_XDEBUG=true \
--no-cache \
-t devdrops/php-toolbox:8.1-xdebug .

push:
# ------------------------------------------------------------------------------------------------------
latest: build debug ## Build two images: 1. official tag, 2. official tag + Xdebug.
# ------------------------------------------------------------------------------------------------------
push: ## Pushes to Docker Hub two images: 1. official tag, 2. official tag + Xdebug.
@echo "Pushing tags '8.1' and '8.1-xdebug'"
docker push devdrops/php-toolbox:8.1
docker push devdrops/php-toolbox:8.1-xdebug
# ------------------------------------------------------------------------------------------------------
release: latest push ## Build and deploy official tags.
# ------------------------------------------------------------------------------------------------------
help: ## Print information of each Make task.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
# ------------------------------------------------------------------------------------------------------


.PHONY: develop latest debug push
# ------------------------------------------------------------------------------------------------------
.PHONY: develop build debug latest push release help
4 changes: 3 additions & 1 deletion 8.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ FROM php:8.2-alpine
ARG VCS_REF
ARG BUILD_DATE
ARG BUILD_VERSION
ARG VERSION
ARG INSTALL_XDEBUG=false

LABEL maintainer="Davi Marcondes Moreira <[email protected]>" \
Expand All @@ -12,7 +13,8 @@ LABEL maintainer="Davi Marcondes Moreira <[email protected]>" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-url="https://github.com/devdrops/php-toolbox" \
org.label-schema.schema-version="1.0" \
org.label-schema.version=$BUILD_VERSION
org.label-schema.build-version=$BUILD_VERSION \
org.label-schema.project-version=$VERSION

# Port usage for built-in server
EXPOSE 8000/tcp
Expand Down
43 changes: 26 additions & 17 deletions 8.2/Makefile
Original file line number Diff line number Diff line change
@@ -1,50 +1,59 @@
# ------------------------------------------------------------------------------------------------------
# Variables and arguments required
SHELL := '/bin/bash'

.DEFAULT_GOAL := help
GIT_LAST_COMMIT_HASH := $(shell git rev-parse --short HEAD)
CURRENT_DATE_GMT := $(shell date +"%Y-%m-%dT%H:%M:%S_GMT%Z")
VERSION := $(shell git describe --tags --always)
# ------------------------------------------------------------------------------------------------------


develop:
# ------------------------------------------------------------------------------------------------------
develop: ## Build '*-dev' tag, including Xdebug.
@echo "Building tag '8.2-dev'"
docker build \
--build-arg BUILD_VERSION=8.2-dev \
--build-arg INSTALL_XDEBUG=true \
--no-cache \
-t devdrops/php-toolbox:8.2-dev .

latest:
# ------------------------------------------------------------------------------------------------------
build: ## Build the official tag.
@echo "Building tags 'latest' and '8.2'"
docker build \
--build-arg VCS_REF=$(GIT_LAST_COMMIT_HASH) \
--build-arg BUILD_DATE=$(CURRENT_DATE_GMT) \
--build-arg BUILD_VERSION=$(GIT_LAST_COMMIT_HASH) \
--build-arg VERSION="$(VERSION)" \
--build-arg INSTALL_XDEBUG=false \
--no-cache \
-t devdrops/php-toolbox:latest \
-t devdrops/php-toolbox:8.2 .
# ------------------------------------------------------------------------------------------------------
debug: ## Build only the image with Xdebug.
@echo "Build tag '8.2-xdebug'"
docker build \
--build-arg VCS_REF=$(GIT_LAST_COMMIT_HASH) \
--build-arg BUILD_DATE=$(CURRENT_DATE_GMT) \
--build-arg BUILD_VERSION=$(GIT_LAST_COMMIT_HASH) \
--build-arg VERSION="$(VERSION)" \
--build-arg INSTALL_XDEBUG=true \
--no-cache \
-t devdrops/php-toolbox:8.2-xdebug .

debug:
@echo "Build tag '8.2-xdebug'"
docker build \
--build-arg VCS_REF=$(GIT_LAST_COMMIT_HASH) \
--build-arg BUILD_DATE=$(CURRENT_DATE_GMT) \
--build-arg BUILD_VERSION=$(GIT_LAST_COMMIT_HASH) \
--build-arg DEBUG=true \
--no-cache \
-t devdrops/php-toolbox:8.2-xdebug .

push:
# ------------------------------------------------------------------------------------------------------
latest: build debug ## Build two images: 1. official tag, 2. official tag + Xdebug.
# ------------------------------------------------------------------------------------------------------
push: ## Pushes to Docker Hub two images: 1. official tag, 2. official tag + Xdebug.
@echo "Pushing tags 'latest', '8.2' and '8.2-xdebug'"
docker push devdrops/php-toolbox:latest
docker push devdrops/php-toolbox:8.2
docker push devdrops/php-toolbox:8.2-xdebug
# ------------------------------------------------------------------------------------------------------
release: latest push ## Build and deploy official tags.
# ------------------------------------------------------------------------------------------------------
help: ## Print information of each Make task.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
# ------------------------------------------------------------------------------------------------------


.PHONY: develop latest debug push
# ------------------------------------------------------------------------------------------------------
.PHONY: develop build debug latest push release help

0 comments on commit 7cf2155

Please sign in to comment.