sapling/eden/mononoke/hgcli/mononoke_ssh.sh
Lukasz Piatkowski 542d1f93d3 Manual synchronization of fbcode/eden and facebookexperimental/eden
Summary:
This commit manually synchronizes the internal move of
fbcode/scm/mononoke under fbcode/eden/mononoke which couldn't be
performed by ShipIt automatically.

Reviewed By: StanislavGlebik

Differential Revision: D19722832

fbshipit-source-id: 52fbc8bc42a8940b39872dfb8b00ce9c0f6b0800
2020-02-11 11:42:43 +01:00

75 lines
2.5 KiB
Bash
Executable File

#!/bin/bash
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
# This is a script that should be used instead of default ui.ssh when performing
# pull/push/clone on Mononoke deployed in tupperware.
#
# This script will select a host using `srselect mononoke` and `tw ssh` to
# connect to it
set -e
usage() {
echo ' _ '
echo ' | | '
echo ' ____ ___ ____ ___ ____ ___ | | _ _____ '
echo '| \ / _ \| _ \ / _ \| _ \ / _ \| |_/ ) ___ |'
echo '| | | | |_| | | | | |_| | | | | |_| | _ (| ____|'
echo '|_|_|_|\___/|_| |_|\___/|_| |_|\___/|_| \_)_____)'
echo ' _ '
echo ' | | '
echo ' ___ ___| |__ '
echo ' /___)/___) _ \ '
echo '|___ |___ | | | | '
echo '(___/(___/|_| |_| '
echo ''
echo ' /\_/'\\
echo ' ____/ o o '\\
echo ' /~____ =ø= /'
echo '(______)__m_m)'
echo ''
echo ' ____ ____ ____ ____ ____ '
echo ' ||c |||l |||o |||n |||e ||'
echo ' ||__|||__|||__|||__|||__||'
echo ' |/__\|/__\|/__\|/__\|/__\|'
echo 'For cloning from mononoke tupperware deployment use:'
echo 'hg clone '\\
echo ' --config ui.ssh="~/fbcode/eden/mononoke/hgcli/mononoke_ssh.sh" '\\
echo ' --config ui.remotecmd="/packages/mononoke.hgcli/hgcli" '\\
echo ' "ssh://mononoke//home/mononoke/<REPONAME>"'
echo ''
echo ' ____ ____ ____ ____ _________ ____ ____ ____ ____ '
echo ' ||p |||u |||l |||l ||| |||p |||u |||s |||h ||'
echo ' ||__|||__|||__|||__|||_______|||__|||__|||__|||__||'
echo ' |/__\|/__\|/__\|/__\|/_______\|/__\|/__\|/__\|/__\|'
echo 'For pull/push it is recommended to add following lines to .hg/hgrc'
echo 'or use the same command args as for hg clone:'
echo ''
echo 'echo "'
echo '[paths]'
echo 'default = ssh://mononoke//home/mononoke/mononoke-config'
echo ''
echo '[ui]'
echo 'ssh = ~/fbcode/eden/mononoke/hgcli/mononoke_ssh.sh'
echo 'remotecmd = /packages/mononoke.hgcli/hgcli'
echo '" >> <REPOPATH>/.hg/hgrc'
}
main() {
if [ "$1" != "mononoke" ] || [[ "$2" != */home/mononoke/* ]]; then
usage >&2
exit 1
fi
shift
local twhost
twhost=$(srselect mononoke --svc-select-count 1 | cut -d' ' -f3)
tw ssh "$twhost" -- "$@"
}
main "$@"