Sha256: 483859d089f7bf00ab2cb794dc13ead2ef9d481effcb6ee4ee631b7ff79c9736
Contents?: true
Size: 1.66 KB
Versions: 3
Compression:
Stored size: 1.66 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/_jason" 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)" local bash_runner if [[ "${FLAGS_debug:-}" = 0 ]]; then set -x bash_runner="bash $tmp_remote --debug" else bash_runner="bash $tmp_remote" fi scp -q $shome/libexec/remote-helper $hst_gateway:$tmp_remote ssh -t $hst_gateway $bash_runner "$USER" "$git_url" "$git_spec" "$@" if [[ "${FLAGS_debug:-}" = 1 ]]; then ssh $hst_gateway rm -f $tmp_remote fi } require sub "$BASH_SOURCE" "$@"
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
alpha_omega-1.5.15 | libexec/aoh-proxy |
alpha_omega-1.5.14 | libexec/aoh-proxy |
alpha_omega-1.5.12 | libexec/aoh-proxy |