]> git.proxmox.com Git - libgit2.git/blob - script/cibuild.sh
Merge pull request #2625 from libgit2/cmn/ssl-tls
[libgit2.git] / script / cibuild.sh
1 #!/bin/sh
2
3 if [ -n "$COVERITY" ];
4 then
5 ./script/coverity.sh;
6 exit $?;
7 fi
8
9 # Create a test repo which we can use for the online::push tests
10 mkdir $HOME/_temp
11 git init --bare $HOME/_temp/test.git
12 git daemon --listen=localhost --export-all --enable=receive-pack --base-path=$HOME/_temp $HOME/_temp 2>/dev/null &
13 export GITTEST_REMOTE_URL="git://localhost/test.git"
14
15 mkdir _build
16 cd _build
17 cmake .. -DCMAKE_INSTALL_PREFIX=../_install $OPTIONS || exit $?
18 make -j2 install || exit $?
19 ctest -V . || exit $?
20
21 # Now that we've tested the raw git protocol, let's set up ssh to we
22 # can do the push tests over it
23
24 killall git-daemon
25
26 if [ "$TRAVIS_OS_NAME" = "osx" ]; then
27 echo 'PasswordAuthentication yes' | sudo tee -a /etc/sshd_config
28 else
29 sudo start ssh
30 fi
31
32 ssh-keygen -t rsa -f ~/.ssh/id_rsa -N "" -q
33 cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys
34 ssh-keyscan -t rsa localhost >>~/.ssh/known_hosts
35
36 # Get the fingerprint for localhost and remove the colons so we can parse it as a hex number
37 export GITTEST_REMOTE_SSH_FINGERPRINT=$(ssh-keygen -F localhost -l | tail -n 1 | cut -d ' ' -f 2 | tr -d ':')
38
39 export GITTEST_REMOTE_URL="ssh://localhost/$HOME/_temp/test.git"
40 export GITTEST_REMOTE_USER=$USER
41 export GITTEST_REMOTE_SSH_KEY="$HOME/.ssh/id_rsa"
42 export GITTEST_REMOTE_SSH_PUBKEY="$HOME/.ssh/id_rsa.pub"
43 export GITTEST_REMOTE_SSH_PASSPHRASE=""
44
45 if [ -e ./libgit2_clar ]; then
46 ./libgit2_clar -sonline::push -sonline::clone::cred_callback -sonline::clone::ssh_cert &&
47 ./libgit2_clar -sonline::clone::ssh_with_paths
48 fi