-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (46 loc) · 1.98 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# This Makefile helps con managing environments and deployment of this library
# #
# Author: Manuel Bernal Llinares <[email protected]> #
# #
# Environment
docker_compose_development_file = docker-compose-development.yml
tag_version = $(shell cat VERSION)
# Targets
all: deploy
release: deploy set_next_development_version
@echo "<===|DEVOPS|===> [RELEASE] Release cycle run"
@git add pom.xml
@git commit -am "Next project development version prepared"
@git push
sync_project_version:
@echo "<===|DEVOPS|===> [SYNC] Synchronizing project version to version '${tag_version}'"
@mvn versions:set -DnewVersion=${tag_version} -DgenerateBackupPoms=false
set_next_development_version:
@echo "<===|DEVOPS|===> [SYNC] Setting the new development version, current ${tag_version}"
@mvn versions:set -DnewVersion=$(shell ./increment_version.sh -p ${tag_version})-SNAPSHOT
deploy: clean
@echo "<===|DEVOPS|===> [DEPLOY] Deploying library to Maven Respository"
@mvn clean deploy -DskipTests
development_env_up: tmp
@echo "<===|DEVOPS|===> [ENVIRONMENT] Bringing development environment UP"
@docker-compose -f $(docker_compose_development_file) up -d
@# TODO Clean this way of referencing the target name in future iterations
development_env_down:
@echo "<===|DEVOPS|===> [ENVIRONMENT] Bringing development environment DOWN"
@docker-compose -f $(docker_compose_development_file) down
@# TODO Clean this way of referencing the target name in future iterations
development_run_tests: development_env_up
@echo "<===|DEVOPS|===> [TESTS] Running Unit Tests"
@mvn clean test
clean:
@echo "<===|DEVOPS|===> [CLEAN] Cleaning the space"
@mvn clean > /dev/null
@mvn versions:commit
# Folders
tmp:
@echo "<===|DEVOPS|===> [FOLDER] Creating temporary folders"
@mkdir -p tmp/fakesmtp
clean_tmp:
@echo "<===|DEVOPS|===> [HOUSEKEEPING] Cleaning temporary folders"
@rm -rf tmp
.PHONY: all clean clean_tmp deploy release sync_project_version set_next_development_version development_run_tests