From 1d44d794eba6d7c371c10205e6f1d8b416748035 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sun, 10 May 2015 17:22:40 +0200 Subject: [PATCH] chore(deployment): script to deploy for download A fully untested utility script allows to unpack a tar file previously created from `*-depoly.sh` scripts to a suitable location to be compatible with the downloads links we generate in the documentation index. Related to #107 [skip ci] --- .linux-deployment-to-downloads.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .linux-deployment-to-downloads.sh diff --git a/.linux-deployment-to-downloads.sh b/.linux-deployment-to-downloads.sh new file mode 100644 index 0000000000..67889e254d --- /dev/null +++ b/.linux-deployment-to-downloads.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# A specialized script which copies the contents of deployment tar files to a given location, suitable +# to be served as +tar_file=${1:?Must be .tar file produced by any of the *-deploy.sh scripts} +program_type=${2:?Is the type of the program contained in the tar file, e.g. cli} +version=${3:?The program version contained in the tar file} +os_name=${4:?The OS name on which the contents of the tar files was produced, e.g. osx, ubuntu} +base_dir=${5:?Is the root path of the download directory, e.g. /var/www/downloads} + + +dest_dir=${base_dir}/google.rs/${program_type}/${version}/${os_name} +mkdir -p ${dest_dir} || exit $? +cd ${dest_dir} && tar -xzvf ${tar_file} || exit $? + + +echo Extracted programs from $tar_file to ${dest_dir}