eclair-linaro: Jenkins agent image for ECLAIR analysis tool
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Change-Id: I1e45acd64a611ea0fcbae9d3c7d8cd1b5e3dc814
diff --git a/eclair-linaro/setup-sshd b/eclair-linaro/setup-sshd
new file mode 100755
index 0000000..1589b1f
--- /dev/null
+++ b/eclair-linaro/setup-sshd
@@ -0,0 +1,19 @@
+#!/bin/sh
+set -ex
+
+export HOME=/home/buildslave
+
+[ -z "${JENKINS_SLAVE_SSH_PUBKEY}" ] || {
+ mkdir ${HOME}/.ssh
+ echo "${JENKINS_SLAVE_SSH_PUBKEY}" > ${HOME}/.ssh/authorized_keys
+ chown -R buildslave:buildslave ${HOME}/.ssh
+ chmod 0700 -R ${HOME}/.ssh
+}
+
+ssh-keygen -A
+
+if [ "$1" = "interactive" ]; then
+ /usr/sbin/sshd
+else
+ /usr/sbin/sshd -D
+fi