From c2beccdafb2f98b76594f5680d4e9dab70ad3d77 Mon Sep 17 00:00:00 2001
From: Patrick Spek
Date: Tue, 28 Jan 2020 14:57:01 +0100
Subject: Update submodules
---
bin/mkdocker.sh | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
create mode 100755 bin/mkdocker.sh
(limited to 'bin/mkdocker.sh')
diff --git a/bin/mkdocker.sh b/bin/mkdocker.sh
new file mode 100755
index 0000000..8c6e1b8
--- /dev/null
+++ b/bin/mkdocker.sh
@@ -0,0 +1,52 @@
+#! /usr/bin/env sh
+
+readonly BASEDIR=$(CDPATH="" cd -- "$(dirname -- "$0")/.." && pwd -P)
+
+main()
+{
+ # Handle opts
+ opts "$@"
+ shift "$OPTS"
+ unset OPTS
+
+ # Show help
+ [ "$OPT_HELP_ONLY" ] && usage && exit 0
+ [ -z "$1" ] && usage && exit 1
+
+ # Make the Docker image
+ cd -- "$BASEDIR"
+ docker build --build-arg "VERSION=$1" -t "rakudo-star:$1" .
+ docker tag "rakudo-star:$1" rakudo-star:latest
+}
+
+opts()
+{
+ OPTS=0
+
+ while getopts ":h" opt
+ do
+ case "$opt" in
+ h) OPT_HELP_ONLY=1 ;;
+ *)
+ printf "Invalid option passed: %s\n" "$OPTARG" >&2
+ ;;
+ esac
+ done
+}
+
+usage()
+{
+ cat <
+
+Make a Docker image for Rakudo Star. This requires a release tarball to exist.
+You must specify the same version argument as you supplied to mkrelease.sh.
+
+Options:
+ -h Show this help text and exit.
+EOF
+}
+
+main "$@"
--
cgit v1.1