| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # |
| 3 | # Utility script so you can pull the container image from CI for local development. |
| 4 | # Run this script and follow the instructions; the script will tell you how |
| 5 | # to run "podman run" to launch a container that has the same environment as the |
| 6 | # one used during CI pipelines. You can debug things at leisure there. |
| 7 | |
| 8 | set -eu |
| 9 | set -o pipefail |
| 10 | |
| 11 | CONTAINER_BUILDS=ci/container_builds.yml |
| 12 | |
| 13 | if [scip-shell system . . `[`. ! -f $CONTAINER_BUILDS ] |
| 14 | then |
| 15 | echoscip-shell system . . echo. "Please run this from the toplevel source directory in librsvg" |
| 16 | exit 1 |
| 17 | fi |
| 18 | |
| 19 | tag=$(grepscip-shell system . . grep. -e '^ BASE_TAG:' $CONTAINER_BUILDS | headscip-shell system . . head. -n 1 | sedscip-shell system . . sed. -E 's/.*BASE_TAG: "(.+)"/\1/') |
| 20 | rust_version=$(grepscip-shell system . . grep. -e '^ RUST_STABLE:' $CONTAINER_BUILDS | headscip-shell system . . head. -n 1 | sedscip-shell system . . sed. -E 's/.*RUST_STABLE: "(.+)"/\1/') |
| 21 | full_tag=x86_64-$rust_version-$tag |
| 22 | |
| 23 | image_name=registry.gitlab.gnome.org/gnome/librsvg/opensuse/tumbleweed:$full_tag |
| 24 | |
| 25 | echoscip-shell system . . echo. pulling image "$image_name" |
| 26 | podman pull "$image_name" |
| 27 | |
| 28 | echoscip-shell system . . echo. "" |
| 29 | echoscip-shell system . . echo. "You can now run this:" |
| 30 | echoscip-shell system . . echo. " podman run --rm -ti --cap-add=SYS_PTRACE -v \$(pwd):/srv/project:z -w /srv/project $image_name" |
| 31 | echoscip-shell system . . echo. "" |
| 32 | echoscip-shell system . . echo. "Don't forget to run this once inside the container:" |
| 33 | echoscip-shell system . . echo. " source ci/env.sh" |
| 34 | echoscip-shell system . . echo. " source ci/setup-dependencies-env.sh" |