summaryrefslogtreecommitdiffstats
path: root/jenkins-scripts
diff options
context:
space:
mode:
Diffstat (limited to 'jenkins-scripts')
-rwxr-xr-xjenkins-scripts/create_jenkins_user.sh11
-rwxr-xr-xjenkins-scripts/system_type.sh3
2 files changed, 12 insertions, 2 deletions
diff --git a/jenkins-scripts/create_jenkins_user.sh b/jenkins-scripts/create_jenkins_user.sh
index 779d1f7c1..2a8655b61 100755
--- a/jenkins-scripts/create_jenkins_user.sh
+++ b/jenkins-scripts/create_jenkins_user.sh
@@ -15,6 +15,7 @@
OS=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
+groupadd jenkins
useradd -m -s /bin/bash jenkins
# Check if docker group exists
@@ -35,7 +36,15 @@ fi
mkdir /home/jenkins/.ssh
mkdir /w
-cp -r /home/${OS}/.ssh/authorized_keys /home/jenkins/.ssh/authorized_keys
+
+if [ "$OS" = "opensuse" ];
+then
+ OS_USER="root"
+else
+ OS_USER="$OS"
+fi
+#Generate ssh key for use by Robot jobs
+cp -r /${OS_USER}/.ssh/authorized_keys /home/jenkins/.ssh/authorized_keys
# Generate ssh key for use by Robot jobs
echo -e 'y\n' | ssh-keygen -N "" -f /home/jenkins/.ssh/id_rsa -t rsa
chown -R jenkins:jenkins /home/jenkins/.ssh /w
diff --git a/jenkins-scripts/system_type.sh b/jenkins-scripts/system_type.sh
index 88210a4ce..c3083ae28 100755
--- a/jenkins-scripts/system_type.sh
+++ b/jenkins-scripts/system_type.sh
@@ -17,7 +17,8 @@ IFS=','
for i in "basebuild,basebuild" \
"centos,centos" \
"ubuntu1404,ubuntu1404" \
- "ubuntu1604,ubuntu1604"
+ "ubuntu1604,ubuntu1604" \
+ "opensuse,opensuse"
do set -- $i
if [[ $HOST == *"$1"* ]]; then
SYSTEM_TYPE="$2"