-
Notifications
You must be signed in to change notification settings - Fork 27
/
Makefile
44 lines (33 loc) · 1.07 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
IMAGENAME=jenkinsciinfra/ircbot
TAG=$(shell date '+%Y%m%d_%H%M%S')
# Build Info
VERSION_FILE_DIR=src/main/resources
VERSION_FILE=${VERSION_FILE_DIR}/versionInfo.properties
VERSION_BUILD_NUMBER=$(BUILD_NUMBER)
VERSION_BUILD_DATE=$(shell date '+%Y%m%d_%H%M%S')
VERSION_BUILD_ID=$(BUILD_ID)
VERSION_BUILD_URL=$(BUILD_URL)
VERSION_GIT_COMMIT=$(GIT_COMMIT)
target/ircbot-2.0-SNAPSHOT-bin.zip : ${VERSION_FILE}
mvn -ntp install
${VERSION_FILE} : ${VERSION_FILE_DIR}
echo buildNumber=${VERSION_BUILD_NUMBER} > ${VERSION_FILE}
echo buildDate=${VERSION_BUILD_DATE} >> ${VERSION_FILE}
echo buildID=${VERSION_BUILD_ID} >> ${VERSION_FILE}
echo buildURL=${VERSION_BUILD_URL} >> ${VERSION_FILE}
echo gitCommit=${VERSION_GIT_COMMIT} >> ${VERSION_FILE}
${VERSION_FILE_DIR} :
mkdir ${VERSION_FILE_DIR}
bot: target/ircbot-2.0-SNAPSHOT-bin.zip
image : clean bot
docker build -t ${IMAGENAME} .
run :
docker run -P --rm -i -t ${IMAGENAME}
tag :
docker tag ${IMAGENAME} ${IMAGENAME}:${TAG}
clean:
rm -rf target/*
rm -f ${VERSION_FILE}
push:
docker push ${IMAGENAME}
.PHONY: clean tag run image bot