forked from michaelmccaskill/plugin-site-api
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
44 lines (32 loc) · 1.02 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
# Basic Makefile just to make creating containers a bit easier outside of
# Jenkins itself (see also: Jenkinsfile)
IMAGE_NAME=jenkinsciinfra/plugin-site-api
ARTIFACT=plugin-site-api-1.0-SNAPSHOT.war
DATA_FILE=plugins.json.gzip
### Phony targets
#################
all: check container
container: plugindata target/$(ARTIFACT)
docker build -t $(IMAGE_NAME) deploy
plugindata: target/$(DATA_FILE)
cp target/$(DATA_FILE) .
check: pom.xml
@echo ">>> Make sure you run \`make run\` in another terminal first!"
DATA_FILE_URL=http://127.0.0.1:8080/$(DATA_FILE) mvn -B clean verify
run: plugindata
docker-compose up
clean:
docker-compose down || true
mvn -B clean
rm -f $(DATA_FILE)
rm -rf target
docker rmi $$(docker images -q -f "reference=$(IMAGE_NAME)") || true
#################
### Generate files
###################
target/plugins.json.gzip: pom.xml
mvn -PgeneratePluginData
target/$(ARTIFACT): plugindata check
mvn -B -Dmaven.test.skip=true package
###################
.PHONY: all container plugindata check clean run