forked from pflooky/data-caterer
-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-action.sh
28 lines (23 loc) · 892 Bytes
/
docker-action.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
#!/usr/bin/env bash
version=$(grep version gradle.properties | cut -d= -f2)
sparkVersion=$(grep sparkVersion gradle.properties | cut -d= -f2)
platforms="linux/amd64,linux/arm64"
echo "Creating API jars and publishing, version=$version"
./gradlew clean :api:javadocJar :api:sourcesJar :api:shadowJar publishToSonatype closeAndReleaseSonatypeStagingRepository
publish_res=$?
if [[ "$publish_res" -ne 0 ]] ; then
echo "Publish API jar failed, exiting"
# exit 1
fi
echo "Creating data caterer fat jars, version=$version"
./gradlew clean :app:shadowJar
build_app=$?
if [[ "$build_app" -ne 0 ]] ; then
echo "Failed to build app, exiting"
exit 1
fi
docker run --privileged --rm tonistiigi/binfmt --install all
docker buildx create --use --name builder
docker buildx inspect --bootstrap builder
docker buildx build --platform $platforms \
-t datacatering/data-caterer:$version --push .