-
Notifications
You must be signed in to change notification settings - Fork 3
/
syncbuildabear.sh
36 lines (29 loc) · 1.29 KB
/
syncbuildabear.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash -e
########################
# iRODS Build-a-Bear v4
# (modified from original form for demo purposes and some added convenience)
# Save as ~/bin/syncbuildabear
# run as "R_USER=remoteLoginName syncbuildabear" if remoteLoginName NE `id -un`
########################
RELPATH_TO_REPOS=./github #__ directory / path undef $HOME containing your repo's
BUILDHOST=build-ub12.irods.renci.org
SOURCEPATH=/home/${USERNAME:=`id -un`}/${RELPATH_TO_REPOS}/irods
TARGETPATH=/projects/irods/personal-testing-repos/${R_USER:=$USERNAME}/irods
echo "Syncing irods to ${BUILDHOST}..."
rsync -rlt --delete ${SOURCEPATH}/.git/ ${R_USER}@${BUILDHOST}:${TARGETPATH}/.git/
echo "------ Build-a-Bear Parameters ------"
echo ${TARGETPATH}
cd ${SOURCEPATH}
git rev-parse HEAD
#== replicate the above code for other repository/-ies as necessary:
BUILDHOST=build-ub12.irods.renci.org
SOURCEPATH=/home/${USERNAME:=`id -un`}/${RELPATH_TO_REPOS}/irods_client_icommands
TARGETPATH=/projects/irods/personal-testing-repos/${R_USER:=$USERNAME}/irods_client_icommands
if [ -d "${SOURCEPATH}" ]; then
echo "Syncing irods to ${BUILDHOST}..."
rsync -rlt --delete ${SOURCEPATH}/.git/ ${R_USER}@${BUILDHOST}:${TARGETPATH}/.git/
echo "------ Build-a-Bear Parameters ------"
echo ${TARGETPATH}
cd ${SOURCEPATH}
git rev-parse HEAD
fi