diff --git a/.github/workflows/run-test.yaml b/.github/workflows/run-test.yaml index 73bfcd55..099501ea 100644 --- a/.github/workflows/run-test.yaml +++ b/.github/workflows/run-test.yaml @@ -13,14 +13,6 @@ jobs: run_unittest: runs-on: ubuntu-20.04 steps: - - name: Maximize build space - run: | - sudo rm -rf /usr/local/lib/android # will release about 10 GB if you don't need Android - sudo rm -rf /usr/share/dotnet # will release about 20GB if you don't need .NET - sudo rm -rf /opt/ghc - echo "Available storage:" - df -h - - uses: actions/checkout@v4 - name: Install vcs @@ -29,9 +21,9 @@ jobs: - name: Prepare thirdparty repos run: ./setup-dependency.sh - - name: Build images + - name: Pull images and build workspace shell: bash - run: ./build-docker.sh -p -i -w + run: ./manage-docker-image.sh -a pull -i "ros2 localization" -o cmucal -t ros2-dev-latest - name: Run unittest shell: bash diff --git a/manage-docker-image.sh b/manage-docker-image.sh new file mode 100755 index 00000000..24cbab2f --- /dev/null +++ b/manage-docker-image.sh @@ -0,0 +1,246 @@ +#!/bin/bash + +# Copyright (c) 2022 Carnegie Mellon University, IBM Corporation, and others +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + + +function join_by { + local d=${1-} f=${2-} + if shift 2; then + printf %s "$f" "${@/#/$d}" + fi +} + +function red { + echo -en "\033[31m" ## red + echo $1 + echo -en "\033[0m" ## reset color +} +function blue { + echo -en "\033[36m" ## blue + echo $1 + echo -en "\033[0m" ## reset color +} +function help { + echo "Usage: $0