-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy path.travis.yml
34 lines (30 loc) · 1.33 KB
/
.travis.yml
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
sudo: required
language: java
services:
- docker
# Need to set perms on bind mount folder:
# https://github.com/moby/moby/issues/2259#issuecomment-26564115
before_install:
- docker build . -t pastdev/jsch-nio-sshd
- mkdir -p /tmp/test/temp
- "chown -R $(id -u):$(id -g) /tmp/test"
- CONTAINER=$(docker run -d -e "SSH_USER_UID=$(id -u)" -e "SSH_USER_GID=$(id -g)" -p 2222:22 -v /tmp/test:/home/test pastdev/jsch-nio-sshd)
- |
RUNNING=0
for i in {1..5}; do
if (docker exec $CONTAINER ps -o cmd -p 1 --no-header | grep sshd); then
RUNNING=1
break
fi
sleep 1
done
if [ $RUNNING -eq 0 ]; then exit 1; fi
- "echo \"[localhost]:2222 $(docker exec $CONTAINER cat /etc/ssh/ssh_host_rsa_key.pub)\" > ~/.ssh/known_hosts"
- docker exec $CONTAINER cat /home/test/.ssh/id_rsa > ~/.ssh/id_rsa
- docker exec $CONTAINER cat /home/test/.ssh/id_rsa.pub > ~/.ssh/id_rsa.pub
- find ~/.ssh -type f -exec chmod 600 {} +
- find ~/.ssh -type d -exec chmod 700 {} +
# For some reason i still cant get ssh to work...
#- ssh -o "[email protected],[email protected],ssh-rsa" -o "IdentityFile=~/.ssh/id_rsa" -o "UserKnownHostsFile=~/.ssh/known_hosts" -vvv -p 2222 test@localhost echo hello
#- cp src/test/resources/.travis.configuration.properties src/test/resources/configuration.properties
script: mvn verify -B