Skip to content

Instantly share code, notes, and snippets.

@highercomve
Last active May 31, 2019 22:21
Show Gist options
  • Select an option

  • Save highercomve/c3c0198461cf9060597b5b93db80656d to your computer and use it in GitHub Desktop.

Select an option

Save highercomve/c3c0198461cf9060597b5b93db80656d to your computer and use it in GitHub Desktop.

PVR install from docker images

Script to install pantahub pvr from source using docker tag (default: latest), the script build the CLI from the source for the current platform and install it on ~/bin/pvr.

How to use it

curl -o- -L https://git.io/fjEI1 | bash
#!/bin/bash
set -e
if [ -z "$1" ]; then
TAG=latest
else
TAG=$1
fi
case $(uname -m | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/') in
*64)
ARCH=amd64
;;
*386*)
ARCH=386
;;
arm*)
ARCH=armv6
;;
*)
echo "Architecture not supported. only supported amd64, 386 and arm"
exit 0
;;
esac
case $(uname | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/') in
linux*)
OS=linux
;;
darwin*)
OS=darwin
;;
msys*)
OS=windows
;;
*)
echo "OS not supported"
exit 0
;;
esac
PLATFORM=($OS"_"$ARCH)
mkdir /tmp/pvr
cd /tmp/pvr
echo "Building PVR for $PLATFORM using docker pvr image (tag: $TAG) ..."
docker pull registry.gitlab.com/pantacor/pvr:$TAG
docker run --rm registry.gitlab.com/pantacor/pvr:$TAG | tar x
echo "Copying to ~/bin/pvr"
cp ./bin/$PLATFORM/pvr ~/bin/pvr
echo "Removing temporals"
cd /tmp
rm -rf pvr
echo "Ready."
echo "now you can go an run pvr"
echo "pvr help"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment