forked from binkley/modern-java-practices
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-as-ci-does.sh
executable file
·59 lines (50 loc) · 1.5 KB
/
build-as-ci-does.sh
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
#/usr/bin/env bash
if ! command -v earthly >/dev/null; then
echo "$0: No Earthly found in PATH"
exit 2
fi
set -e
# Provide nicer console output via formatting and color
# See https://github.com/binkley/shell/blob/master/color/color.sh
printf -v preset "\e[0m"
printf -v pbold "\e[1m"
echo "${preset}"
echo "${pbold}BUILD WITH GRADLE UNDER BATECT${preset}"
./batect -o quiet build-with-gradle
echo "${pbold}RUN WITH GRADLE UNDER BATECT${preset}"
./batect -o quiet run-with-gradle
echo
echo "${pbold}BUILD WITH MAVEN UNDER BATECT${preset}"
./batect -o quiet build-with-maven
echo "${pbold}RUN WITH MAVEN UNDER BATECT${preset}"
./batect -o quiet run-with-maven
echo
echo "${pbold}BUILD WITH GRADLE UNDER EARTHLY${preset}"
earthly \
--secret BUILDLESS_APIKEY \
--remote-cache=ghcr.io/sgammon/modern-java-practices/builder/gradle:latest \
--push \
--ci \
+build-with-gradle
echo "${pbold}RUN WITH GRADLE UNDER EARTHLY${preset}"
earthly \
--secret BUILDLESS_APIKEY \
--remote-cache=ghcr.io/sgammon/modern-java-practices/builder/gradle:latest \
--push \
--ci \
+run-with-gradle
echo
echo "${pbold}BUILD WITH MAVEN UNDER EARTHLY${preset}"
earthly \
--secret BUILDLESS_APIKEY \
--remote-cache=ghcr.io/sgammon/modern-java-practices/builder/maven:latest \
--push \
--ci \
+build-with-maven
echo "${pbold}RUN WITH MAVEN UNDER EARTHLY${preset}"
earthly \
--secret BUILDLESS_APIKEY \
--remote-cache=ghcr.io/sgammon/modern-java-practices/builder/maven:latest \
--push \
--ci \
+run-with-maven