summaryrefslogtreecommitdiffstats
path: root/jenkins-scripts
diff options
context:
space:
mode:
authorVanessa Rene Valderrama <vvalderrama@linuxfoundation.org>2017-05-17 07:05:45 -0500
committerVanessa Rene Valderrama <vvalderrama@linuxfoundation.org>2017-08-10 15:12:38 -0500
commit253cb0b321dcf44ee0d2291427ef001d031532bf (patch)
tree2bef507360847af770a51a2f732637a89318e45b /jenkins-scripts
parent0f7d85ebf0eba038a0a3c4676e4eb164b683ed2d (diff)
Add openSuSE image
Configure baseline and basebuild scripts to build openSuSE packer images Configure Jenkins keys for openSuSE Add openSuSE as a Jenkins system type Change-Id: I69bdd265773fa9c50753179b0b3f0d214490b28e Signed-off-by: Vanessa Rene Valderrama <vvalderrama@linuxfoundation.org>
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 779d1f7c..2a8655b6 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 88210a4c..c3083ae2 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"