forked from streamthoughts/jikkou
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (57 loc) · 2.34 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
61
62
63
64
65
66
67
68
69
70
71
72
#
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) The original authors
#
# Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
#
# Makefile used to build docker images for kafka-specs
VERSION := $(shell mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout)
GIT_COMMIT := $(shell git rev-parse --short HEAD)
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
DATE := $(shell date --rfc-3339=seconds)
REPOSITORY = streamthoughts
IMAGE = jikkou
DOCKER_PATH = ./docker
.SILENT:
all: build-dist build-image clean-build
clean-containers:
echo "Cleaning containers \n========================================== ";
clean-images:
echo "Cleaning images \n========================================== ";
for image in `docker images -qf "label=org.opencontainers.image.title=jikkou"`; do \
echo "Removing image $${image} \n==========================================\n " ; \
docker rmi -f $${image} || exit 1 ; \
done
print-info:
echo "\n==========================================\n";
echo "VERSION="$(VERSION);
echo "GIT_COMMIT="$(GIT_COMMIT);
echo "GIT_BRANCH="$(GIT_BRANCH);
echo "DATE="$(DATE);
echo "\n==========================================\n";
clean-build:
echo "Cleaning build directory \n========================================== ";
rm -rf ./docker-build;
build-dist: print-info
./mvnw clean -ntp -B --file ./pom.xml package -Pnative
build-image:
cp ./jikkou-cli/target/jikkou-cli-${VERSION}-runner ./docker/jikkou-cli-${VERSION}-runner
docker build \
--compress \
--build-arg VERSION="${VERSION}" \
--build-arg COMMIT="${GIT_COMMIT}" \
--build-arg BRANCH="${GIT_BRANCH}" \
--build-arg CREATED="${DATE}" \
--rm \
-f ./docker/Dockerfile.ubuntu \
-t ${REPOSITORY}/${IMAGE}:${VERSION} ${DOCKER_PATH} || exit 1 ;
docker tag ${REPOSITORY}/${IMAGE}:${VERSION} ${REPOSITORY}/${IMAGE}:dev || exit 1 ;
docker tag ${REPOSITORY}/${IMAGE}:${VERSION} ${REPOSITORY}/${IMAGE}:${GIT_BRANCH} || exit 1 ;
docker-tag-latest:
docker tag ${REPOSITORY}/${IMAGE}:${VERSION} ${REPOSITORY}/${IMAGE}:latest || exit 1 ;
changelog:
./mvnw jreleaser:changelog -Prelease --file pom.xml
install:
./mvnw clean package -Pnative,deb -DskipTests
sudo dpkg -i ./dist/jikkou-${VERSION}-linux-x86_64.deb
clean: clean-containers clean-images clean-build