-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
139 lines (104 loc) · 4.43 KB
/
Copy pathMakefile
File metadata and controls
139 lines (104 loc) · 4.43 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
.PHONY=help,patch,release,tag,commit,push,git,rollback,checkout,setup
GIT_USER?="Continuous Integration"
GIT_EMAIL?="ci@getelements.dev"
help:
@echo "Manages Semantic Versioning for Elements using Maven and Git."
@echo "patch - Increments the revision (least significant) number (Snapshot Builds Only)"
@echo "release - Drops -SNAPSHOT from the current revision number (Snapshot Builds Only)"
@echo "commit - Commits all changes, including submodules with a message indicating release."
@echo "git - Configures git with email and name. Run this before all other git commands."
@echo "setup - Performs all pre-build setup and checks for all necessary build commands."
@echo "push - Pushes all changes, including submodules to the remotes."
@echo "tag - Tags the current Maven version in git."
@echo "checkout - Checks out the specified tag/revision/branch for the project as well as submodules."
clean:
mvn --no-transfer-progress -B -q clean
install_no_tests:
mvn -Darchetype.test.skip=true -DskipTests -Dmaven.javadoc.skip=true -Dskip.web-ui-build=true --no-transfer-progress -q install
build:
mvn --no-transfer-progress -B -q install
build_github:
mvn --no-transfer-progress -B -q -Pgithub-publish install
build_central:
mvn --no-transfer-progress -B -q -Pcentral-publish,github-publish install
deploy:
mvn --no-transfer-progress -B -q -Pcentral-publish deploy
deploy_github:
mvn --no-transfer-progress -B -q -Pgithub-publish deploy
deploy_central:
mvn --no-transfer-progress -B -q -Pcentral-publish,github-publish deploy
docker:
make -C docker-config internal
docker_hub:
make -C docker-config hub
# patch/release compute the next version the normal Maven way (letting versions:set's own
# nextSnapshot/removeSnapshot semver logic decide it), then discard the literal per-module rewrite
# that versions:set always produces and re-apply just the computed value to the single <revision>
# property via versions:set-property -- versions:set does not honor a property-based version even
# with -DprocessAllModules=true, it always writes a literal version into every module.
patch:
@NEXT=$$(mvn -q versions:set -DnextSnapshot=true > /dev/null && mvn -q help:evaluate -Dexpression=project.version -DforceStdout) && \
find . -path "*/target" -prune -o -name "pom.xml" -exec git checkout {} \; && \
mvn versions:set-property -Dproperty=revision -DnewVersion=$$NEXT
release:
@NEXT=$$(mvn -q versions:set -DremoveSnapshot=true > /dev/null && mvn -q help:evaluate -Dexpression=project.version -DforceStdout) && \
find . -path "*/target" -prune -o -name "pom.xml" -exec git checkout {} \; && \
mvn versions:set-property -Dproperty=revision -DnewVersion=$$NEXT
version:
ifndef VERSION
$(error VERSION is not set)
endif
mvn versions:set-property -Dproperty=revision -DnewVersion=$(VERSION)
tag: MAVEN_VERSION=$(shell mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
tag:
@echo "Tagging Release"
git tag $(MAVEN_VERSION)
git:
git config --global user.name $(GIT_USER)
git config --global user.email $(GIT_EMAIL)
git remote add github git@github.com:NamazuStudios/elements.git
setup: git
export DOCKER_HOST=tcp://docker:2375
export DOCKER_BUILDKIT=1
export DOCKER_CLI_EXPERIMENTAL=enabled
ng
mvn -version
docker buildx create --use
echo $(DOCKER_HUB_ACCESS_TOKEN) | docker login --username $(DOCKER_HUB_USER) --password-stdin
setup_release: setup
- mkdir "$(HOME)/.m2"
cp -f settings.xml "$(HOME)/.m2"
@echo "GPG Private Key Is"
@echo $$GPG_PRIVATE_KEY | base64 -d | head -n 1
@echo "redacted"
@echo $$GPG_PRIVATE_KEY | base64 -d | tail -n 1
@echo $$GPG_PRIVATE_KEY | base64 -d | gpg --batch --import
commit: MAVEN_VERSION=$(shell mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
commit:
ifndef COMMIT_MSG
$(error COMMIT_MSG is not set)
endif
git commit -a -m "\"$(COMMIT_MSG) $(MAVEN_VERSION)\""
push:
git push
push_tags:
git push --tags
publish_github: CURRENT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
publish_github:
git push github $(CURRENT_BRANCH)
publish_github_tags:
git push github --tags
detach:
git checkout --detach
checkout:
ifndef BRANCH
$(error BRANCH is not set)
endif
git checkout $(BRANCH)
javadoc: JAVADOC_VERSION?=$(shell mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
javadoc:
mvn -Pcentral-publish javadoc:aggregate
find target
aws --delete s3 sync target/reports/apidocs s3://$(JAVADOC_S3_BUCKET)/$(JAVADOC_VERSION)
rollback:
- find . -name "pom.xml" -exec git checkout {} \;