Merge "Refactor OpFlex jobs to push to nexus"
authorThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 6 Sep 2017 01:06:36 +0000 (01:06 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 6 Sep 2017 01:06:36 +0000 (01:06 +0000)
jjb/packaging/build-deb.sh
jjb/packaging/build-rpm-snap.sh
jjb/packaging/build-rpm.sh
jjb/releng-jobs.yaml
packer/provision/devstack-pre-pip.sh
packer/templates/devstack-pre-pip-pike.json [new file with mode: 0644]

index 4ccffa201fdde4fac94c75eb21f59a087f34d803..608f3bc79e826e05de3177acbc614165e1779b2f 100644 (file)
@@ -21,9 +21,19 @@ $PYTHON -m pip install -r "$WORKSPACE/packaging/packages/requirements.txt"
                                          direct \
                                          --download_url "$DOWNLOAD_URL"
 
-# Copy the debs to be upload
-UPLOAD_FILES_PATH="$WORKSPACE/upload_files"
-mkdir -p "$UPLOAD_FILES_PATH"
-# Note: no source packages are available, since the debs are not built
-# from the actual source
-mv "$WORKSPACE/packaging/packages/deb/opendaylight/"*.deb "$_"
+# Publish debs to Nexus if in production Jenkins, else host on sandbox Jenkins
+if [ "$SILO" == "sandbox" ]; then
+  # TODO: Host debs on Jenkins temporarily
+  echo "Not uploading debs to Nexus because running in sandbox"
+elif  [ "$SILO" == "releng" ]; then
+  # Copy the debs to be upload
+  # Move debs to dir of files that will be uploaded to Nexus
+  UPLOAD_FILES_PATH="$WORKSPACE/upload_files"
+  mkdir -p "$UPLOAD_FILES_PATH"
+  # Note: no source packages are available, since the debs are not built
+  # from the actual source
+  mv "$WORKSPACE/packaging/packages/deb/opendaylight/"*.deb "$_"
+else
+  echo "Unknown Jenkins silo: $SILO"
+  exit 1
+fi
index ebecea802b8a61d68591de7e4f0112b7dc9dae7c..b981c707b5ce9d5175b5723b8cdc0b79d4d2c92c 100644 (file)
@@ -39,8 +39,17 @@ fi
                                          latest_snap \
                                          --major "$VERSION_MAJOR"
 
-# Copy the rpm to be upload
-UPLOAD_FILES_PATH="$WORKSPACE/upload_files"
-mkdir -p "$UPLOAD_FILES_PATH"
-mv "/home/$USER/rpmbuild/RPMS/noarch/"*.rpm "$_"
-mv "/home/$USER/rpmbuild/SRPMS/"*.rpm "$_"
+# Publish RPMs to Nexus if in production Jenkins, else host on sandbox Jenkins
+if [ "$SILO" == "sandbox" ]; then
+  # TODO: Host RPMs on Jenkins temporarily
+  echo "Not uploading RPMs to Nexus because running in sandbox"
+elif  [ "$SILO" == "releng" ]; then
+  # Move RPMs (SRPM and noarch) to dir of files that will be uploaded to Nexus
+  UPLOAD_FILES_PATH="$WORKSPACE/upload_files"
+  mkdir -p "$UPLOAD_FILES_PATH"
+  mv "/home/$USER/rpmbuild/RPMS/noarch/"*.rpm "$_"
+  mv "/home/$USER/rpmbuild/SRPMS/"*.rpm "$_"
+else
+  echo "Unknown Jenkins silo: $SILO"
+  exit 1
+fi
index 4d411ff35003ad6813d12d8108a5e03e911afb57..73d6c198cf25ee81afd621a70a707e499167d188 100644 (file)
@@ -36,8 +36,17 @@ fi
                                          direct \
                                          --download_url "$DOWNLOAD_URL"
 
-# Move RPMs (SRPM and noarch) to dir of files that will be uploaded to Nexus
-UPLOAD_FILES_PATH="$WORKSPACE/upload_files"
-mkdir -p "$UPLOAD_FILES_PATH"
-mv "/home/$USER/rpmbuild/RPMS/noarch/"*.rpm "$_"
-mv "/home/$USER/rpmbuild/SRPMS/"*.rpm "$_"
+# Publish RPMs to Nexus if in production Jenkins, else host on sandbox Jenkins
+if [ "$SILO" == "sandbox" ]; then
+  # TODO: Host RPMs on Jenkins temporarily
+  echo "Not uploading RPMs to Nexus because running in sandbox"
+elif  [ "$SILO" == "releng" ]; then
+  # Move RPMs (SRPM and noarch) to dir of files that will be uploaded to Nexus
+  UPLOAD_FILES_PATH="$WORKSPACE/upload_files"
+  mkdir -p "$UPLOAD_FILES_PATH"
+  mv "/home/$USER/rpmbuild/RPMS/noarch/"*.rpm "$_"
+  mv "/home/$USER/rpmbuild/SRPMS/"*.rpm "$_"
+else
+  echo "Unknown Jenkins silo: $SILO"
+  exit 1
+fi
index 1c58b82896eeca8eba7d7d50c2273f4777a078fa..0c40a66521f55881d885bb593e0e35727578a0b2 100644 (file)
@@ -44,6 +44,8 @@
           build-timeout: 75
       - devstack-pre-pip-ocata:
           build-timeout: 60
+      - devstack-pre-pip-pike:
+          build-timeout: 75
       - docker
       - gbp
       - java-builder:
@@ -70,6 +72,8 @@
         templates: devstack-pre-pip-newton
       - platforms: ubuntu-14.04
         templates: devstack-pre-pip-ocata
+      - platforms: ubuntu-14.04
+        templates: devstack-pre-pip-pike
       - platforms: ubuntu-14.04
         templates: devstack
       - platforms: ubuntu-14.04
index a081c84e9b5cb138d12b8f52d0be4398e99a5ccf..5153a4a6d5c2d6279a746b311da5fea0ce391d1e 100644 (file)
@@ -24,6 +24,8 @@ echo '---> Pre-installing yum and pip packages'
 projs="requirements keystone glance cinder neutron nova horizon"
 # shellcheck disable=SC2154
 branch=${os_branch}
+# strip the "stable" off of the branch
+branch_name=$(cut -d'/' -f2 <<< ${branch})
 
 wget https://bootstrap.pypa.io/get-pip.py
 python get-pip.py
@@ -44,9 +46,8 @@ do
     pip install -c requirements/upper-constraints.txt -r ${proj}/test-requirements.txt
 done
 
-# the ocata release has ovs 2.6.1
-echo '---> Installing openvswitch from openstack Ocata repo (2.6.1)'
-yum install -y http://rdoproject.org/repos/openstack-ocata/rdo-release-ocata.rpm
+echo '---> Installing openvswitch from relevant openstack branch'
+yum install -y centos-release-openstack-${branch_name}
 
 yum install -y --nogpgcheck openvswitch
 
diff --git a/packer/templates/devstack-pre-pip-pike.json b/packer/templates/devstack-pre-pip-pike.json
new file mode 100644 (file)
index 0000000..3a88914
--- /dev/null
@@ -0,0 +1,71 @@
+{
+  "variables": {
+    "public_base_image": null,
+    "public_network": null,
+    "public_cloud_user": null,
+    "public_auth_url": null,
+    "public_tenant": null,
+    "public_user": null,
+    "public_pass": null,
+    "private_base_image": null,
+    "private_network": null,
+    "private_cloud_user": null,
+    "private_auth_url": null,
+    "private_tenant": null,
+    "private_user": null,
+    "private_pass": null,
+    "distro": null,
+    "cloud_user_data": null
+  },
+  "builders": [
+    {
+      "type": "openstack",
+      "name": "public_cloud",
+      "identity_endpoint": "{{user `public_auth_url`}}",
+      "tenant_name": "{{user `public_tenant`}}",
+      "username": "{{user `public_user`}}",
+      "password": "{{user `public_pass`}}",
+      "region": "DFW",
+      "ssh_username": "{{user `public_cloud_user`}}",
+      "image_name": "{{user `distro`}} - devstack-pike - {{isotime \"20060102-1504\"}}",
+      "source_image": "{{user `public_base_image`}}",
+      "flavor": "general1-1",
+      "networks": [
+        "{{user `public_network`}}"
+      ],
+      "user_data_file": "{{user `cloud_user_data`}}"
+    },
+    {
+      "type": "openstack",
+      "name": "private_cloud",
+      "identity_endpoint": "{{user `private_auth_url`}}",
+      "tenant_name": "{{user `private_tenant`}}",
+      "username": "{{user `private_user`}}",
+      "password": "{{user `private_pass`}}",
+      "ssh_username": "{{user `private_cloud_user`}}",
+      "image_name": "{{user `distro`}} - devstack-pike - {{isotime \"20060102-1504\"}}",
+      "source_image_name": "{{user `private_base_image`}}",
+      "flavor": "general1-1",
+      "networks": [
+        "{{user `private_network`}}"
+      ],
+      "user_data_file": "{{user `cloud_user_data`}}"
+    }
+  ],
+  "provisioners": [
+    {
+      "type": "shell",
+      "environment_vars": [
+        "os_branch=stable/pike",
+        "rdo_branch=pike"
+      ],
+      "scripts": [
+        "provision/baseline.sh",
+        "provision/devstack-pre-pip.sh",
+        "provision/system_reseal_local_env.sh",
+        "provision/system_reseal.sh"
+      ],
+      "execute_command": "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"
+    }
+  ]
+}