Sha256: 9ff83d1135754543b16700f3b4351bc986470337a504dfb9ceb7c37c53c6b7ee
Contents?: true
Size: 1.49 KB
Versions: 36
Compression:
Stored size: 1.49 KB
Contents
#!/bin/bash #/ NAME #/ proxy -- proxies deploy using a gateway host #/ #/ SYNOPSIS #/ #/ proxy gateway version deploy_command args #/ proxy git_url git_spec gateway version deploy_command args #/ # figure out the project root under which bin, lib live shome="$(cd -P -- "$(dirname -- "$BASH_SOURCE")/.." && pwd -P)" # load a jason bourne library source "$shome/libexec/_treadstone" get_started function git_branch_head { local ver_repo="$1"; shift local git_branch="" local git_head="$ver_repo" if [[ "$ver_repo" = "HEAD" ]]; then git_branch="$(git symbolic-ref HEAD 2>&- | sed 's#^refs/heads/##' || true)" git_head="$(git rev-parse HEAD)" if [[ -z $git_head ]]; then echo "ERROR: could not find the SHA for HEAD" 1>&2 return 1 fi fi echo "$git_branch:$git_head" } # entry point function main { local hst_gateway="$1"; shift local ver_repo="$1"; shift cd $_AO_HOME local git_url="$(ryaml $_AO_HOME/config/deploy.yml repository)" local git_spec="$(git_branch_head "$ver_repo")" local pth_rvmrun="${_AO_RUBY_LOADER:-}" : ${pth_rvmrun:=$(ryaml $_AO_HOME/config/deploy.yml ruby_loader)} local nm_ruby="$(ryaml $_AO_HOME/config/deploy.yml app_ruby)" local tmp_remote="$(ssh $hst_gateway mktemp -t XXXXXXXXX)" scp -q $shome/sbin/remote-helper $hst_gateway:$tmp_remote ssh -t $hst_gateway "$pth_rvmrun" "$nm_ruby" bash "$tmp_remote" "$USER" "$git_url" "$git_spec" "$@" ssh $hst_gateway rm -f $tmp_remote } require sub "$BASH_SOURCE" "$@"
Version data entries
36 entries across 36 versions & 1 rubygems