-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.zsh
executable file
·70 lines (60 loc) · 4.14 KB
/
build.zsh
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
#!/usr/bin/env zsh
# This is a backup solution for people that don't know how to use Gradle.
# This script should be used only in last resort or for testing purposes
# because it does exactly the same job as `gradle docker` command, just worse...
# please install SDKMAN, Java, and Gradle
# your life will be easier
# thank you
#docker login
cd $GITHUB/base/images/debian/11-bullseye/mandrel/22-2/java/17/mandrel-22-2-gradle-7-5-java-17 || exit
DOCKER_HUB_HOST=ochmanskide
GROUP_ID=$(gradle rootProjectGroupRaw -q)
ARTIFACT_ID=$(gradle rootProjectNameRaw -q)
IMAGE_TAG=$(gradle rootProjectVersionRaw -q)
#GROUP_ID='base.images.debian.11-bullseye.mandrel.22-2.java.17'
#ARTIFACT_ID='mandrel-22-2-gradle-7-5-java-17'
#IMAGE_TAG=$(gradle printVersion -q)
docker build -t "$DOCKER_HUB_HOST"/"$GROUP_ID"/"$ARTIFACT_ID":$IMAGE_TAG .
docker run --rm -ti --privileged --entrypoint /bin/bash "$DOCKER_HUB_HOST"/"$GROUP_ID"/"$ARTIFACT_ID":$IMAGE_TAG
docker image rm "$DOCKER_HUB_HOST"/"$GROUP_ID"/"$ARTIFACT_ID":$IMAGE_TAG
echo
if [[ "$IMAGE_TAG" == *-SNAPSHOT ]]
then
export DOCKER_REPOSITORY='snapshots/'
else
export DOCKER_REPOSITORY=''
fi
echo "docker build -t $DOCKER_HUB_HOST/$DOCKER_REPOSITORY$GROUP_ID/$ARTIFACT_ID:$IMAGE_TAG ."
echo "docker push $DOCKER_HUB_HOST/$DOCKER_REPOSITORY$GROUP_ID/$ARTIFACT_ID:$IMAGE_TAG"
docker tag $DOCKER_HUB_HOST/$DOCKER_REPOSITORY$GROUP_ID/$ARTIFACT_ID:$IMAGE_TAG $DOCKER_HUB_HOST/$DOCKER_REPOSITORY$GROUP_ID/$ARTIFACT_ID:latest
docker tag $DOCKER_HUB_HOST/$DOCKER_REPOSITORY$GROUP_ID/$ARTIFACT_ID:$IMAGE_TAG $DOCKER_HUB_HOST/graalvm-gradle:mandrel-22-2-gradle-7-5-java-17
docker tag $DOCKER_HUB_HOST/$DOCKER_REPOSITORY$GROUP_ID/$ARTIFACT_ID:$IMAGE_TAG $DOCKER_HUB_HOST/graalvm-gradle:22-2-gradle-7-5-java-17
docker tag $DOCKER_HUB_HOST/$DOCKER_REPOSITORY$GROUP_ID/$ARTIFACT_ID:$IMAGE_TAG $DOCKER_HUB_HOST/graalvm-gradle:java-17
docker tag $DOCKER_HUB_HOST/$DOCKER_REPOSITORY$GROUP_ID/$ARTIFACT_ID:$IMAGE_TAG $DOCKER_HUB_HOST/graalvm-gradle:java17
docker tag $DOCKER_HUB_HOST/$DOCKER_REPOSITORY$GROUP_ID/$ARTIFACT_ID:$IMAGE_TAG $DOCKER_HUB_HOST/graalvm-gradle:jdk-17
docker tag $DOCKER_HUB_HOST/$DOCKER_REPOSITORY$GROUP_ID/$ARTIFACT_ID:$IMAGE_TAG $DOCKER_HUB_HOST/graalvm-gradle:jdk17
docker tag $DOCKER_HUB_HOST/$DOCKER_REPOSITORY$GROUP_ID/$ARTIFACT_ID:$IMAGE_TAG $DOCKER_HUB_HOST/mandrel-gradle:mandrel-22-2-gradle-7-5-java-17
docker tag $DOCKER_HUB_HOST/$DOCKER_REPOSITORY$GROUP_ID/$ARTIFACT_ID:$IMAGE_TAG $DOCKER_HUB_HOST/mandrel-gradle:22-2-gradle-7-5-java-17
docker tag $DOCKER_HUB_HOST/$DOCKER_REPOSITORY$GROUP_ID/$ARTIFACT_ID:$IMAGE_TAG $DOCKER_HUB_HOST/mandrel-gradle:java-17
docker tag $DOCKER_HUB_HOST/$DOCKER_REPOSITORY$GROUP_ID/$ARTIFACT_ID:$IMAGE_TAG $DOCKER_HUB_HOST/mandrel-gradle:java17
docker tag $DOCKER_HUB_HOST/$DOCKER_REPOSITORY$GROUP_ID/$ARTIFACT_ID:$IMAGE_TAG $DOCKER_HUB_HOST/mandrel-gradle:jdk-17
docker tag $DOCKER_HUB_HOST/$DOCKER_REPOSITORY$GROUP_ID/$ARTIFACT_ID:$IMAGE_TAG $DOCKER_HUB_HOST/mandrel-gradle:jdk17
docker push $DOCKER_HUB_HOST/$DOCKER_REPOSITORY$GROUP_ID/$ARTIFACT_ID:$IMAGE_TAG
docker push $DOCKER_HUB_HOST/$DOCKER_REPOSITORY$GROUP_ID/$ARTIFACT_ID:latest
docker push $DOCKER_HUB_HOST/graalvm-gradle:mandrel-22-2-gradle-7-5-java-17
docker push $DOCKER_HUB_HOST/graalvm-gradle:22-2-gradle-7-5-java-17
docker push $DOCKER_HUB_HOST/graalvm-gradle:java-17
docker push $DOCKER_HUB_HOST/graalvm-gradle:java17
docker push $DOCKER_HUB_HOST/graalvm-gradle:jdk-17
docker push $DOCKER_HUB_HOST/graalvm-gradle:jdk17
docker push $DOCKER_HUB_HOST/mandrel-gradle:mandrel-22-2-gradle-7-5-java-17
docker push $DOCKER_HUB_HOST/mandrel-gradle:22-2-gradle-7-5-java-17
docker push $DOCKER_HUB_HOST/mandrel-gradle:java-17
docker push $DOCKER_HUB_HOST/mandrel-gradle:java17
docker push $DOCKER_HUB_HOST/mandrel-gradle:jdk-17
docker push $DOCKER_HUB_HOST/mandrel-gradle:jdk17
# in case this is the latest Java Candidate (current == 17)
docker tag $DOCKER_HUB_HOST/$DOCKER_REPOSITORY$GROUP_ID/$ARTIFACT_ID:$IMAGE_TAG $DOCKER_HUB_HOST/graalvm-gradle:latest
docker tag $DOCKER_HUB_HOST/$DOCKER_REPOSITORY$GROUP_ID/$ARTIFACT_ID:$IMAGE_TAG $DOCKER_HUB_HOST/mandrel-gradle:latest
docker push $DOCKER_HUB_HOST/graalvm-gradle:latest
docker push $DOCKER_HUB_HOST/mandrel-gradle:latest