-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
49 lines (42 loc) · 1.11 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
MKDIR_P = mkdir -p
NAME = tableau-sdk-wrapper
VERSION = 1.2.1
BUILD_DIR = ${NAME}-${VERSION}
ARTIFACT = tableau-${VERSION}.jar
ARCHIVE = ${NAME}-${VERSION}.zip
TARGET = target
SAMPLES = samples
BIN_DIR = bin
DOCKER_DIR = docker
DOCKER_REPOSITORY = jlmorton
all: compile mkdir copy_files archive docker
compile:
mvn install
mkdir:
${MKDIR_P} ${BUILD_DIR}/bin
${MKDIR_P} ${BUILD_DIR}/lib
${MKDIR_P} ${BUILD_DIR}/samples
${MKDIR_P} ${BUILD_DIR}/tmp
${MKDIR_P} ${BUILD_DIR}/logs
copy_files:
mkdir -p lib
cp ${TARGET}/${ARTIFACT} lib/
cp ${TARGET}/${ARTIFACT} ${BUILD_DIR}/lib/
cp -a ${SAMPLES}/* ${BUILD_DIR}/samples/
cp -a ${BIN_DIR}/* ${BUILD_DIR}/bin/
archive:
zip -r ${ARCHIVE} ${BUILD_DIR}
clean:
mvn clean
rm -rf ${BUILD_DIR}
rm -rf ${DOCKER_DIR}/${BUILD_DIR}
rm -f ${ARCHIVE}
rm -f ${DOCKER_DIR}/Dockerfile
rm -f ${DOCKER_DIR}/*.jar
rm -f ${DOCKER_DIR}/*.zip
rm -rf tmp
rm -rf lib
generate_docker: all
cp -a ${BUILD_DIR} ${DOCKER_DIR}/
sed -e s/%ARTIFACT_DIR%/${BUILD_DIR}/ ${DOCKER_DIR}/Dockerfile.txt > ${DOCKER_DIR}/Dockerfile
docker build -t ${DOCKER_REPOSITORY}/${NAME}:${VERSION} ${DOCKER_DIR}