Merge "Support recheck and reverify in global-jjb"
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Fri, 13 Jul 2018 15:30:47 +0000 (15:30 +0000)
committerGerrit Code Review <gerrit@linuxfoundation.org>
Fri, 13 Jul 2018 15:30:47 +0000 (15:30 +0000)
docs/jjb/lf-ci-jobs.rst
shell/jenkins-configure-clouds.sh
shell/sigul-install.sh

index 1ce9859..d7d4b03 100644 (file)
@@ -298,6 +298,8 @@ configuration in the format ``KEY=value``.
     :RETENTION_TIME: Number of minutes to wait for an idle slave to be used
         again before it's removed. If set to -1, the slave will be kept
         forever. (default: 0)
+    :CONNECTION_TYPE: The connection type for Jenkins to connect to the build
+        minion. Valid options: JNLP, SSH. (default: "SSH")
 
 For a live example see the OpenDaylight project jenkins-config directory.
 https://github.com/opendaylight/releng-builder/tree/master/jenkins-config
index 4469106..47023f7 100644 (file)
@@ -102,6 +102,24 @@ get_cloud_cfg() {
     echo ")"
 }
 
+get_launcher_factory() {
+    if [ -z $1 ]; then
+        >&2 echo "Usage: get_launcher_factory JNLP|SSH"
+        exit 1
+    fi
+
+    local connection_type="$1"
+
+    if [ "$connection_type" == "JNLP" ]; then
+        echo "new LauncherFactory.JNLP()"
+    elif [ "$connection_type" == "SSH" ]; then
+        echo "new LauncherFactory.SSH(\"$key_pair_name\", \"\")"
+    else
+        >&2 echo "Unknown connection type $connection_type"
+        exit 1
+    fi
+}
+
 get_minion_options() {
     if [ -z $1 ]; then
         >&2 echo "Usage: get_minion_options CFG_FILE"
@@ -148,7 +166,9 @@ get_minion_options() {
     volume_size=$(get_cfg "$cfg_file" VOLUME_SIZE "")
     hardware_id=$(get_cfg "$cfg_file" HARDWARE_ID "")
     network_id=$(get_cfg "$cfg_file" NETWORK_ID "")
-    user_data_id=$(get_cfg "$cfg_file" USER_DATA_ID "jenkins-init-script")
+
+    udi_default="$(get_cfg "$(dirname $cfg_file)/cloud.cfg" USER_DATA_ID "jenkins-init-script")"
+    user_data_id=$(get_cfg "$cfg_file" USER_DATA_ID "$udi_default")
 
     # Handle Sandbox systems that might have a different cap.
     instance_cap=$(get_cfg "$cfg_file" INSTANCE_CAP "null")
@@ -161,15 +181,19 @@ get_minion_options() {
     security_groups=$(get_cfg "$cfg_file" SECURITY_GROUPS "default")
     availability_zone=$(get_cfg "$cfg_file" AVAILABILITY_ZONE "")
     start_timeout=$(get_cfg "$cfg_file" START_TIMEOUT "600000")
-    key_pair_name=$(get_cfg "$cfg_file" KEY_PAIR_NAME "jenkins-ssh")
+
+    kpn_default="$(get_cfg "$(dirname $cfg_file)/cloud.cfg" KEY_PAIR_NAME "jenkins-ssh")"
+    key_pair_name=$(get_cfg "$cfg_file" KEY_PAIR_NAME "$kpn_default")
+
     num_executors=$(get_cfg "$cfg_file" NUM_EXECUTORS "1")
     jvm_options=$(get_cfg "$cfg_file" JVM_OPTIONS "")
     fs_root=$(get_cfg "$cfg_file" FS_ROOT "/w")
     retention_time=$(get_cfg "$cfg_file" RETENTION_TIME "0")
+    connection_type=$(get_cfg "$cfg_file" CONNECTION_TYPE "SSH")
+    launcher_factory=$(get_launcher_factory "$connection_type")
 
     OS_PLUGIN_VER="$(lftools jenkins plugins list \
         | grep -i 'OpenStack Cloud Plugin' | awk -F':' '{print $2}')"
-    echo "OpenStack Cloud Plugin version: $OS_PLUGIN_VER"
     if version_ge "$OS_PLUGIN_VER" "2.35"; then
         if [ ! -z "$volume_size" ]; then
             echo "    new BootSource.VolumeFromImage(\"$image_name\", $volume_size),"
@@ -189,7 +213,7 @@ get_minion_options() {
         echo "    $num_executors,"
         echo "    \"$jvm_options\","
         echo "    \"$fs_root\","
-        echo "    new LauncherFactory.SSH(\"$key_pair_name\", \"\"),"
+        echo "    $launcher_factory,"
         echo "    $retention_time"
 
     else  # SlaveOptions() structure for versions <= 2.34
@@ -210,7 +234,7 @@ get_minion_options() {
         echo "    $num_executors,"
         echo "    \"$jvm_options\","
         echo "    \"$fs_root\","
-        echo "    new LauncherFactory.SSH(\"$key_pair_name\", \"\"),"
+        echo "    $launcher_factory,"
         echo "    $retention_time"
     fi
 }
index 71db786..5d015ff 100644 (file)
@@ -16,7 +16,7 @@ set -eu -o pipefail
 # Setup sigul RPM repo
 echo "[fedora-infra-sigul]
 name=Fedora builder packages for sigul
-baseurl=https://infrastructure.fedoraproject.org/repo/infra/epel\$releasever-infra/\$basearch/
+baseurl=https://kojipkgs.fedoraproject.org/repos-dist/epel\$releasever-infra/latest/\$basearch/
 enabled=1
 gpgcheck=1
 gpgkey=https://infrastructure.fedoraproject.org/repo/infra/RPM-GPG-KEY-INFRA-TAGS