Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-08-11 03:37:44 +0400
committerCarlos Martín Nieto <cmn@dwim.me>2013-08-14 12:49:10 +0400
commit5be622fb563c89341a7dd5da4e65e2c225cb2c08 (patch)
treeda2ffe696873010b093c643e8f914ebd6d6c62fa /script
parent2af9bcb2dbb47adafa7eecbf41ff113da7fa9d1b (diff)
Test SSH in travis
Set up the ssh credentials so we are able to talk to localhost and issue git commands. Move to use a script, as the command list is getting somewhat long. While here, delay installing valgrind until we need it, as it and its dependencies are by far the largest downloads and this allows us to start compiling (and failing) faster and we only incur this cost when the test suite runs successfully.
Diffstat (limited to 'script')
-rwxr-xr-xscript/cibuild.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/script/cibuild.sh b/script/cibuild.sh
new file mode 100755
index 000000000..722b3349d
--- /dev/null
+++ b/script/cibuild.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# Create a test repo which we can use for the online::push tests
+mkdir $HOME/_temp
+git init --bare $HOME/_temp/test.git
+git daemon --listen=localhost --export-all --enable=receive-pack --base-path=$HOME/_temp $HOME/_temp 2>/dev/null &
+export GITTEST_REMOTE_URL="git://localhost/test.git"
+
+mkdir _build
+cd _build
+cmake .. -DCMAKE_INSTALL_PREFIX=../_install $OPTIONS
+cmake --build . --target install
+ctest -V .
+
+# Now that we've tested the raw git protocol, let's set up ssh to we
+# can do the push tests over it
+
+killall git-daemon
+sudo start ssh
+ssh-keygen -t rsa -f ~/.ssh/id_rsa -N "" -q
+cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys
+ssh-keyscan -t rsa localhost >>~/.ssh/known_hosts
+
+export GITTEST_REMOTE_URL="ssh://localhost/$HOME/_temp/test.git"
+export GITTEST_REMOTE_USER=$USER
+export GITTEST_REMOTE_SSH_KEY="$HOME/.ssh/id_rsa"
+export GITTEST_REMOTE_SSH_PUBKEY="$HOME/.ssh/id_rsa.pub"
+export GITTEST_REMOTE_SSH_PASSPHRASE=""
+
+if [ -e ./libgit2_clar ]; then
+ ./libgit2_clar -sonline::push
+fi