Skip to content

Commit

Permalink
Remove in progress images
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Brodsky committed May 5, 2021
1 parent 5def29d commit ded17fa
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Expand Up @@ -39,7 +39,7 @@ jobs:
${{ runner.os }}-maven-
- name: Tests
run: mvn clean test -B -V
run: mvn clean test -B -V -Dh3.remove.images=true

tests-no-docker:
name: Java (no Docker) ${{ matrix.java-version }} ${{ matrix.os }}
Expand Down
2 changes: 2 additions & 0 deletions pom.xml
Expand Up @@ -70,6 +70,7 @@

<h3.git.remote>https://github.com/uber/h3.git</h3.git.remote>
<h3.use.docker>true</h3.use.docker>
<h3.remove.images>false</h3.remove.images>
<!-- Used for passing additional arguments to surefire when using JaCoCo -->
<h3.additional.argLine />

Expand Down Expand Up @@ -242,6 +243,7 @@
<argument>${h3.git.remote}</argument>
<argument>${h3.git.reference}</argument>
<argument>${h3.use.docker}</argument>
<argument>${h3.remove.images}</argument>
</arguments>
</configuration>
</execution>
Expand Down
26 changes: 16 additions & 10 deletions src/main/c/h3-java/build-h3.sh
Expand Up @@ -15,12 +15,14 @@
# limitations under the License.
#

# Arguments: [git-remote] [git-ref] [use-docker]
# git-remote - The git remote to pull from. An existing cloned repository
# will not be deleted if a new remote is specified.
# git-ref - Specific git ref of H3 to build.
# use-docker - "true" to perform cross compilation via Docker, "false" to
# skip that step.
# Arguments: [git-remote] [git-ref] [use-docker] [remove-images]
# git-remote - The git remote to pull from. An existing cloned repository
# will not be deleted if a new remote is specified.
# git-ref - Specific git ref of H3 to build.
# use-docker - "true" to perform cross compilation via Docker, "false" to
# skip that step.
# remove-images - If use-docker is true and this argument is true, Docker
# cross compilation images will be removed after each step
#
# This script downloads H3, builds H3 and the H3-Java native library, and
# cross compiles via Docker.
Expand All @@ -33,6 +35,7 @@ set -ex
GIT_REMOTE=$1
GIT_REVISION=$2
USE_DOCKER=$3
REMOVE_IMAGES=$4

echo Downloading H3 from "$GIT_REMOTE"

Expand Down Expand Up @@ -122,12 +125,8 @@ for image in android-arm android-arm64 linux-arm64 linux-armv5 linux-armv7 linux
# Setup for using dockcross
BUILD_ROOT=target/h3-java-build-$image
mkdir -p $BUILD_ROOT
echo BEFORE PULL USAGE:
df -h
docker pull dockcross/$image
docker run --rm dockcross/$image > $BUILD_ROOT/dockcross
echo AFTER RUN USAGE:
df -h
chmod +x $BUILD_ROOT/dockcross

# Perform the actual build inside Docker
Expand All @@ -140,4 +139,11 @@ for image in android-arm android-arm64 linux-arm64 linux-armv5 linux-armv7 linux
if [ -e $BUILD_ROOT/lib/libh3-java.so ]; then cp $BUILD_ROOT/lib/libh3-java.so $OUTPUT_ROOT ; fi
if [ -e $BUILD_ROOT/lib/libh3-java.dylib ]; then cp $BUILD_ROOT/lib/libh3-java.dylib $OUTPUT_ROOT ; fi
if [ -e $BUILD_ROOT/lib/libh3-java.dll ]; then cp $BUILD_ROOT/lib/libh3-java.dll $OUTPUT_ROOT ; fi

if $REMOVE_IMAGES; then
docker rmi dockcross/$image
rm $BUILD_ROOT/dockcross
fi
echo Current disk usage:
df -h
done

0 comments on commit ded17fa

Please sign in to comment.