chore(bash): move all scripts into src/bash

That way, they are more official than hidden scripts dumped in the
project root.

[skip ci]
This commit is contained in:
Sebastian Thiel
2015-05-10 18:09:00 +02:00
parent be117767a1
commit ad6dd7758e
5 changed files with 1 additions and 1 deletions

6
src/bash/docker-build-cli.bash Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
# For execution on docker build image only !
# make cargo-cli ARGS="build --release"
# DEBUG: only try to build a small CLI for now
make discovery1-cli-cargo ARGS="build --release"
find gen -executable -type f -path "*/release/*" -not \( -name "*.*" -or -name "*script*" \) | xargs -J % cp -v % /build-result

9
src/bash/linux-deploy.bash Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
echo "NOTE: I assume you have called the respective make cargo-cli ARGS=build beforehand"
version=${1:?First argument must be the version CLI we deploy, like v0.1.0}
rtype=${2:?Second argument is either 'release' or 'debug'}
tar_basename=google-apis-rs_cli-${version}_linux-x86-64_${rtype}
tar_file=${tar_basename}.tar.gz
tar -czf $tar_file --transform "s%^.*/%%" -T <(find gen -executable -type f -path "*/${rtype}/*" -not \( -name "*.*" -or -name "*script*" -or -regex ".*-[a-f0-9]{16}" \)) || exit $?
echo Wrote $tar_file

View File

@@ -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, e.g. 0.2.0 (no leading v)}
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}

13
src/bash/osx-deploy.bash Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
echo "NOTE: I assume you have called the respective make cargo-cli ARGS=build beforehand"
version=${1:?First argument must be the version CLI we deploy, like v0.1.0}
rtype=${2:?Second argument is either 'release' or 'debug'}
tar_basename=google-apis-rs_cli-${version}_osx-10.10_${rtype}
tar_file=${tar_basename}.tar.gz
dest_dir=build/$tar_basename
mkdir -p $dest_dir || exit $?
find -E gen -perm +0111 -type f -path "*/${rtype}/*" -not \( -name "*.*" -or -name "*script*" -or -regex ".*-[a-f0-9]{16}" \) | xargs -J % cp -v % $dest_dir || exit $?
(cd $dest_dir && tar -czvf ${tar_file} "*") || exit $?
rm -Rfv $dest_dir || exit $?
echo Wrote build/$tar_file