File: docker.sh

package info (click to toggle)
scummvm 2.9.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 450,268 kB
  • sloc: cpp: 4,297,604; asm: 28,322; python: 12,901; sh: 11,219; java: 8,477; xml: 7,843; perl: 2,633; ansic: 2,465; yacc: 1,670; javascript: 1,020; makefile: 933; lex: 578; awk: 275; objc: 82; sed: 11; php: 1
file content (47 lines) | stat: -rwxr-xr-x 967 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
#
# This shell script is used to simplify building with the Docker images
# used by the buildbot.

DIR="$(cd "$(dirname "$0")/.." && pwd)"

_image=
_update=no

for ac_option in $@; do
	case "$ac_option" in
	--update)
		_update=yes
		;;
	--*)
		echo "Unknown argument '$ac_option'"
		exit 1
		;;
	*)
		if [ -n "$_image" ]; then
			echo "A toolchain image has already been specified"
			exit 1
		fi
		_image=$ac_option
		;;
	esac;
done;

if [ -z "$_image" ]; then
	echo "No toolchain image has been specified"
	exit 1
fi

if test "$_update" != yes ; then
	if ! docker image inspect $_image >/dev/null 2>&1 ; then
		echo "Image is not available"
		_update=yes
	fi
fi

if test "$_update" = yes ; then
	docker_url=`echo $_image | sed 's/\([^\/]*\)\/\([^\/]*\)/scummvm\/dockerized-\1:\2/'`
	(docker pull $docker_url && docker tag $docker_url $_image && docker rmi $docker_url) || exit 1
fi

docker run -v $DIR:/data/scummvm -w /data/scummvm -it $_image /bin/bash