Improve Makefile

This commit is contained in:
2020-06-02 15:20:11 +02:00
parent 2ee8b80596
commit 9c10a88a36

View File

@@ -13,22 +13,32 @@ help: ## This help.
.DEFAULT_GOAL := help .DEFAULT_GOAL := help
bd: build-docker
build-docker: ## Build the docker image of application build-docker: ## Build the docker image of application
docker build -t dc-project -f docker/app/Dockerfile . docker build -t dc-project -f docker/app/Dockerfile .
pd: publish-docker
publish-docker: build-docker ## Publish docker image of application to Github publish-docker: build-docker ## Publish docker image of application to Github
git diff --quiet --exit-code || (echo "The git is DIRTY !!! You cannot publish this crap!" && exit 1) git diff --quiet --exit-code || (echo "The git is DIRTY !!! You cannot publish this crap!" && exit 1)
cat ./GH_TOKEN.txt | docker login docker.pkg.github.com -u ${GITHUB_USERNAME} --password-stdin cat ./GH_TOKEN.txt | docker login docker.pkg.github.com -u ${GITHUB_USERNAME} --password-stdin
docker tag dc-project docker.pkg.github.com/flecomte/dc-project/dc-project:${VERSION} docker tag dc-project docker.pkg.github.com/flecomte/dc-project/dc-project:${VERSION}
docker push docker.pkg.github.com/flecomte/dc-project/dc-project:${VERSION} docker push docker.pkg.github.com/flecomte/dc-project/dc-project:${VERSION}
rd: run-docker
run-docker: ## Build and Run all docker services run-docker: ## Build and Run all docker services
docker-compose up -d --build docker-compose up -d --build
pm: publish-maven
publish-maven: ## Publish JAR file to Github publish-maven: ## Publish JAR file to Github
git diff --quiet --exit-code || (echo "The git is DIRTY !!! You cannot publish this crap!" && exit 1) @git diff --quiet --exit-code || (echo "The git is DIRTY !!! You cannot publish this crap!" && exit 1)
gradlew publish gradlew publish
f: fixtures
fixtures: ## Import fixtures fixtures: ## Import fixtures
bash src/main/resources/sql/fixtures/fixtures.sh bash src/main/resources/sql/fixtures/fixtures.sh