aboutsummaryrefslogtreecommitdiff
path: root/t/install
blob: 24b920019bfb4e2eb82ddd77ebdedc06a2af83a7 (plain)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash

# note: all the /tmp and /tmp/glrb stuff is for testing with a non-default
# REPO_BASE.  I don't use it a lot so expect some glitches.  Just ignore it if
# you're trying to understand this code...

# ----

die() { echo "$@"; exit 1; }

cd ${0%/*}

git rev-parse --show-toplevel || die should run t/install from a clone of gitolite
export TESTDIR=$PWD

cd $HOME
# prepare and save local ssh
mkdir -p .ssh; chmod go-w .ssh

echo -n generating keys...
for i in tester u1 u2 u3 u4 u5 u6
do
    ssh-keygen -q -N "" -f .ssh/$i
done
echo done

sed -e "s/gitolite-test/$USER/" < $TESTDIR/keys/config > .ssh/config
chmod go-w .ssh/config

tar cf .ssh.save .ssh

# blank out the client side
rm -rf gitolite-admin .ssh
tar xf .ssh.save

# blank out the server side
rm -rf .gitolite .gitolite.rc repositories /tmp/glrb bin share

# set up our identity (impacts some tests; don't change this!)
git config --global user.name "gitolite tester"
git config --global user.email "tester@example.com"

# install it
cd gitolite
cp contrib/VREF/* src
git describe --tags --long HEAD > conf/VERSION
    # in case it is dirty
src/gl-system-install
cd $HOME
gl-setup -q .ssh/tester.pub

# add 6 keys
rm -rf ~/gitolite-admin
git clone gitolite:gitolite-admin
cd gitolite-admin
cp ~/.ssh/u*.pub keydir
git add keydir; git commit -m 'added 6 keys'
git push

# make the rollback.tar files on both sides
cd $HOME
tar cf client-rollback.tar gitolite-admin
mkdir -p repositories /tmp/glrb
tar cf server-rollback.tar .ssh .gitolite .gitolite.rc repositories bin share
tar -C /tmp -cf $HOME/server-rollback2.tar glrb