Refactor OpFlex jobs to push to nexus 32/62232/8
authorAnil Belur <abelur@linuxfoundation.org>
Tue, 29 Aug 2017 02:16:38 +0000 (12:16 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Tue, 5 Sep 2017 21:17:00 +0000 (07:17 +1000)
OpFlex project builds and archives dependencies (libuv, rapidjson
and ovs) on Jenkins.

Now the jobs are modified to build and push the dependencies to
nexus thridparty repository. The verify, merge and release jobs are
modified to download these dependencies from nexus while building
opflex artifacts.

The jobs are designed to take the version number of the dependency
to build.

Move all scripts to a common `scripts` directory.

Move all builders and scms to opflex macros file.

Rename the jobs to exclude files extension.

Jira: releng-3
Change-Id: Icf6f8d1a16f7cebfb5fe37bf8c6f8f350d7eb9fa
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
13 files changed:
jjb/opflex/deps-inc-v1/libuv_tgz-build.sh [deleted file]
jjb/opflex/deps-inc-v1/openvswitch_tgz-build.sh [deleted file]
jjb/opflex/deps-inc-v1/rapidjson_tgz-build.sh [deleted file]
jjb/opflex/deps-inc-v2/openvswitch_tgz-build.sh [deleted file]
jjb/opflex/opflex-custom.yaml
jjb/opflex/opflex-dependencies.yaml
jjb/opflex/opflex-macros.yaml [new file with mode: 0644]
jjb/opflex/opflex.yaml
jjb/opflex/scripts/deploy-opflex.sh [moved from jjb/opflex/deploy-opflex.sh with 97% similarity]
jjb/opflex/scripts/libuv-build.sh [new file with mode: 0644]
jjb/opflex/scripts/openvswitch-build.sh [new file with mode: 0644]
jjb/opflex/scripts/opflex-build.sh [moved from jjb/opflex/opflex-build.sh with 52% similarity]
jjb/opflex/scripts/rapidjson-build.sh [new file with mode: 0644]

diff --git a/jjb/opflex/deps-inc-v1/libuv_tgz-build.sh b/jjb/opflex/deps-inc-v1/libuv_tgz-build.sh
deleted file mode 100644 (file)
index 54130ed..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-
-set -e
-set -x
-
-./autogen.sh
-ROOT=/tmp/opflex-prefix
-./configure --prefix=$ROOT
-mkdir install-root
-DESTDIR=`pwd`/install-root make clean install
-pushd install-root
-tar -czf libuv.tgz *
-popd
diff --git a/jjb/opflex/deps-inc-v1/openvswitch_tgz-build.sh b/jjb/opflex/deps-inc-v1/openvswitch_tgz-build.sh
deleted file mode 100644 (file)
index d939f6e..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-# Build script for openvswitch
-
-set -e
-set -x
-
-ROOT=/tmp/opflex-prefix
-DESTDIR=install-root
-
-mkdir -p "$DESTDIR"
-
-./boot.sh
-./configure --prefix="$ROOT" --enable-shared
-make -j4
-DESTDIR=`pwd`/$DESTDIR make install
-find lib ofproto -name "*.h" -exec cp --parents -t "$DESTDIR/$ROOT/include/openvswitch/" {} \;
-
-pushd $DESTDIR
-tar -czf openvswitch.tgz *
-popd
diff --git a/jjb/opflex/deps-inc-v1/rapidjson_tgz-build.sh b/jjb/opflex/deps-inc-v1/rapidjson_tgz-build.sh
deleted file mode 100644 (file)
index 47b1fa0..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-# Build script for rapidjson
-
-set -e
-set -x
-
-ROOT=/tmp/opflex-prefix
-DESTDIR=install-root
-
-mkdir -p "$DESTDIR/$ROOT/lib/pkgconfig"
-mkdir -p "$DESTDIR/$ROOT/include"
-
-cp -R include/rapidjson "$DESTDIR/$ROOT/include"
-sed -e "s|@INCLUDE_INSTALL_DIR@|$ROOT/include|" \
-    -e "s|@PROJECT_NAME@|RapidJSON|" \
-    -e "s|@LIB_VERSION_STRING@|1.0.2|" RapidJSON.pc.in > \
-    "$DESTDIR/$ROOT/lib/pkgconfig/RapidJSON.pc"
-
-pushd $DESTDIR
-tar -czf rapidjson.tgz *
diff --git a/jjb/opflex/deps-inc-v2/openvswitch_tgz-build.sh b/jjb/opflex/deps-inc-v2/openvswitch_tgz-build.sh
deleted file mode 100644 (file)
index 182fec2..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-# Build script for openvswitch
-
-set -e
-set -x
-
-ROOT=/tmp/opflex-prefix
-DESTDIR=install-root
-
-mkdir -p "$DESTDIR"
-
-./boot.sh
-./configure --prefix="$ROOT" --enable-shared
-make -j4
-DESTDIR=`pwd`/$DESTDIR make install
-
-# OVS headers get installed to weird and inconsistent locations.  Try
-# to clean things up
-mkdir -p $DESTDIR/$ROOT/include/openvswitch/openvswitch
-mv $DESTDIR/$ROOT/include/openvswitch/*.h $DESTDIR/$ROOT/include/openvswitch/openvswitch
-mv $DESTDIR/$ROOT/include/openflow $DESTDIR/$ROOT/include/openvswitch
-cp -t "$DESTDIR/$ROOT/include/openvswitch/" include/*.h
-find lib -name "*.h" -exec cp --parents -t "$DESTDIR/$ROOT/include/openvswitch/" {} \;
-
-pushd $DESTDIR
-tar -czf openvswitch.tgz *
-popd
-
index 6d2699c8860f1b8a698705ef4c6c5ff49d003631..bc59fd09a6558e9aa0926cdc8b026e7e9d81c426 100644 (file)
@@ -8,37 +8,28 @@
     stream:
       - oxygen:
           branch: 'master'
-          jdk: 'openjdk8'
+          libuv-version: '1.8.0'
+          rapidjson-version: '1.0.2'
+          openvswitch-version: '2.6.0'
       - nitrogen:
           branch: 'stable/nitrogen'
-          jdk: openjdk8
+          libuv-version: '1.8.0'
+          rapidjson-version: '1.0.2'
+          openvswitch-version: '2.6.0'
       - carbon:
           branch: 'stable/carbon'
-          jdk: openjdk8
+          libuv-version: '1.8.0'
+          rapidjson-version: '1.0.2'
+          openvswitch-version: '2.6.0'
       - boron:
           branch: 'stable/boron'
-          jdk: openjdk8
+          libuv-version: '1.7.5'
+          rapidjson-version: '1.0.1'
+          openvswitch-version: 'noiro'
 
     project: 'opflex'
     archive-artifacts: '**/*.tar.gz'
-
-- builder:
-    name: opflex-build
-    builders:
-      - maven-target:
-          maven-version: 'mvn33'
-          pom: genie/pom.xml
-          goals: compile
-      - copyartifact:
-          project: opflex-libuv_tgz-{stream}
-          flatten: true
-      - copyartifact:
-          project: opflex-rapidjson_tgz-{stream}
-          flatten: true
-      - copyartifact:
-          project: opflex-openvswitch_tgz-{stream}
-          flatten: true
-      - shell: !include-raw-escape: opflex-build.sh
+    jdk: 'openjdk8'
 
 - job-template:
     name: 'opflex-verify-{stream}'
           branch: '{branch}'
           refspec: 'refs/heads/{branch}'
           artifacts: '{archive-artifacts}'
+      - string:
+          name: LIBUV_VERSION
+          # yamllint disable-line rule:line-length
+          default: '{libuv-version}'
+          description: 'libuv version'
+      - string:
+          name: RAPIDJSON_VERSION
+          # yamllint disable-line rule:line-length
+          default: '{rapidjson-version}'
+          description: 'rapidjson version'
+      - string:
+          name: OPENVSWITCH_VERSION
+          # yamllint disable-line rule:line-length
+          default: '{openvswitch-version}'
+          description: 'openvswitch-version'
 
     scm:
       - gerrit-trigger-scm:
           branch: '{branch}'
           refspec: 'refs/heads/{branch}'
           artifacts: ''
+      - string:
+          name: LIBUV_VERSION
+          # yamllint disable-line rule:line-length
+          default: '{libuv-version}'
+          description: 'libuv version'
+      - string:
+          name: RAPIDJSON_VERSION
+          # yamllint disable-line rule:line-length
+          default: '{rapidjson-version}'
+          description: 'rapidjson version'
+      - string:
+          name: OPENVSWITCH_VERSION
+          # yamllint disable-line rule:line-length
+          default: '{openvswitch-version}'
+          description: 'openvswitch version'
 
     scm:
       - gerrit-trigger-scm:
index 963228095cda3832b30d5d5936d45db318355d53..69555d3bb64b13dd9403f3bae9dc3117a7169243 100644 (file)
 - project:
     name: opflex-dependencies
     jobs:
-      - 'opflex-libuv_tgz-{stream}'
-      - 'opflex-rapidjson_tgz-{stream}'
-      - 'opflex-openvswitch_tgz-{stream}'
+      - 'opflex-libuv-{stream}'
+      - 'opflex-rapidjson-{stream}'
+      - 'opflex-openvswitch-{stream}'
 
+    # todo: remove 'ovs-scm' after boron EOL
     stream:
       - oxygen:
           branch: 'master'
-          libuv-build: v1
-          libuv-scm: v2
-          rapidjson-build: v1
-          rapidjson-scm: v2
-          openvswitch-build: v2
-          openvswitch-scm: v2
+          libuv-version: '1.8.0'
+          rapidjson-version: '1.0.2'
+          openvswitch-version: '2.6.0'
+          ovs-scm: v2
       - nitrogen:
           branch: 'stable/nitrogen'
-          libuv-build: v1
-          libuv-scm: v2
-          rapidjson-build: v1
-          rapidjson-scm: v2
-          openvswitch-build: v2
-          openvswitch-scm: v2
+          libuv-version: '1.8.0'
+          rapidjson-version: '1.0.2'
+          openvswitch-version: '2.6.0'
+          ovs-scm: v2
       - carbon:
           branch: 'stable/carbon'
-          libuv-build: v1
-          libuv-scm: v2
-          rapidjson-build: v1
-          rapidjson-scm: v2
-          openvswitch-build: v2
-          openvswitch-scm: v2
+          libuv-version: '1.8.0'
+          rapidjson-version: '1.0.2'
+          openvswitch-version: '2.6.0'
+          ovs-scm: v2
       - boron:
           branch: 'stable/boron'
-          libuv-build: v1
-          libuv-scm: v1
-          rapidjson-build: v1
-          rapidjson-scm: v1
-          openvswitch-build: v1
-          openvswitch-scm: v1
+          libuv-version: '1.7.5'
+          rapidjson-version: '1.0.1'
+          openvswitch-version: 'noiro'
+          ovs-scm: v1
 
     project: 'opflex'
 
-- scm:
-    name: 'git-opflex-libuv-v1'
-    scm:
-      - git:
-          url: https://github.com/libuv/libuv.git
-          branches:
-            - 'refs/tags/v1.7.5'
-          wipe-workspace: true
-
-- scm:
-    name: 'git-opflex-libuv-v2'
-    scm:
-      - git:
-          url: https://github.com/libuv/libuv.git
-          branches:
-            - 'refs/tags/v1.8.0'
-          wipe-workspace: true
-
-- scm:
-    name: 'git-opflex-rapidjson-v1'
-    scm:
-      - git:
-          url: https://github.com/miloyip/rapidjson.git
-          branches:
-            - 'refs/tags/v1.0.1'
-          wipe-workspace: true
-
-- scm:
-    name: 'git-opflex-rapidjson-v2'
-    scm:
-      - git:
-          url: https://github.com/miloyip/rapidjson.git
-          branches:
-            - 'refs/tags/v1.0.2'
-          wipe-workspace: true
-
-- scm:
-    name: 'git-opflex-ovs-v1'
-    scm:
-      - git:
-          url: https://github.com/noironetworks/ovs.git
-          branches:
-            - 'origin/noiro'
-          wipe-workspace: true
-
-- scm:
-    name: 'git-opflex-ovs-v2'
-    scm:
-      - git:
-          url: https://github.com/openvswitch/ovs.git
-          branches:
-            - 'refs/tags/v2.6.0'
-          wipe-workspace: true
-
-- builder:
-    name: 'builder-opflex-libuv-v1'
-    builders:
-      - shell: !include-raw-escape: deps-inc-v1/libuv_tgz-build.sh
+    mvn-opts: ''
+    mvn-params: ''
+    mvn-version: mvn33
+
+    # common parameters required for 'lf-infra-deploy-maven-file' builder
+    repo-id: 'thirdparty'
+    upload-files-dir: '$WORKSPACE/upload_files'
 
 - job-template:
-    name: 'opflex-libuv_tgz-{stream}'
+    name: 'opflex-libuv-{stream}'
 
     project-type: freestyle
     node: centos7-java-builder-2c-8g
     concurrent: true
 
+    group-id: 'libuv'
+
     properties:
       - opendaylight-infra-properties:
           build-days-to-keep: '{build-days-to-keep}'
 
+    parameters:
+      - opendaylight-infra-parameters:
+          os-cloud: '{os-cloud}'
+          project: '{project}'
+          branch: '{branch}'
+          refspec: 'refs/heads/{branch}'
+          artifacts: '{archive-artifacts}'
+      - lf-infra-maven-parameters:
+          mvn-opts: '{mvn-opts}'
+          mvn-params: '{mvn-params}'
+          mvn-version: '{mvn-version}'
+          staging-profile-id: ''
+      - string:
+          name: LIBUV_VERSION
+          # yamllint disable-line rule:line-length
+          default: '{libuv-version}'
+          description: 'libuv version'
+
     scm:
-      - git-opflex-libuv-{libuv-scm}
+      - git-opflex-libuv
 
     wrappers:
       - opendaylight-infra-wrappers:
           build-timeout: '{build-timeout}'
 
     builders:
-      - builder-opflex-libuv-{libuv-build}
+      - opflex-build-libuv
+      - lf-infra-deploy-maven-file:
+          global-settings-file: 'global-settings'
+          settings-file: 'opflex-settings'
+          mvn-version: '{mvn-version}'
+          repo-id: '{repo-id}'
+          group-id: '{group-id}'
+          upload-files-dir: '{upload-files-dir}'
+          maven-repo-url: '$NEXUS_URL/content/repositories/thirdparty'
 
     publishers:
       - email-notification:
           email-recipients: '{email-recipients}'
           email-prefix: '[opflex]'
-      - archive:
-          artifacts: 'install-root/*.tgz'
-
-- builder:
-    name: 'builder-opflex-rapidjson-v1'
-    builders:
-      - shell: !include-raw-escape: deps-inc-v1/rapidjson_tgz-build.sh
+      - lf-infra-publish
 
 - job-template:
-    name: 'opflex-rapidjson_tgz-{stream}'
+    name: 'opflex-rapidjson-{stream}'
 
     project-type: freestyle
     node: centos7-java-builder-2c-8g
     concurrent: true
 
+    group-id: 'rapidjson'
+
     properties:
       - opendaylight-infra-properties:
           build-days-to-keep: '{build-days-to-keep}'
 
+    parameters:
+      - opendaylight-infra-parameters:
+          os-cloud: '{os-cloud}'
+          project: '{project}'
+          branch: '{branch}'
+          refspec: 'refs/heads/{branch}'
+          artifacts: '{archive-artifacts}'
+      - lf-infra-maven-parameters:
+          mvn-opts: '{mvn-opts}'
+          mvn-params: '{mvn-params}'
+          mvn-version: '{mvn-version}'
+          staging-profile-id: ''
+      - string:
+          name: RAPIDJSON_VERSION
+          # yamllint disable-line rule:line-length
+          default: '{rapidjson-version}'
+          description: 'rapidjson version'
+
     scm:
-      - git-opflex-rapidjson-{rapidjson-scm}
+      - git-opflex-rapidjson
 
     wrappers:
       - opendaylight-infra-wrappers:
           build-timeout: '{build-timeout}'
 
     builders:
-      - builder-opflex-rapidjson-{rapidjson-build}
+      - opflex-build-rapidjson
+      - lf-infra-deploy-maven-file:
+          global-settings-file: 'global-settings'
+          settings-file: 'opflex-settings'
+          mvn-version: '{mvn-version}'
+          repo-id: '{repo-id}'
+          group-id: '{group-id}'
+          upload-files-dir: '{upload-files-dir}'
+          maven-repo-url: '$NEXUS_URL/content/repositories/thirdparty'
 
     publishers:
       - email-notification:
           email-recipients: '{email-recipients}'
           email-prefix: '[opflex]'
-      - archive:
-          artifacts: 'install-root/*.tgz'
-
-- builder:
-    name: 'builder-opflex-openvswitch-v1'
-    builders:
-      - shell: !include-raw: deps-inc-v1/openvswitch_tgz-build.sh
-
-- builder:
-    name: 'builder-opflex-openvswitch-v2'
-    builders:
-      - shell: !include-raw: deps-inc-v2/openvswitch_tgz-build.sh
+      - lf-infra-publish
 
 - job-template:
-    name: 'opflex-openvswitch_tgz-{stream}'
+    name: 'opflex-openvswitch-{stream}'
 
     project-type: freestyle
     node: centos7-java-builder-2c-8g
     concurrent: true
 
+    group-id: 'openvswitch'
+
     properties:
       - opendaylight-infra-properties:
           build-days-to-keep: '{build-days-to-keep}'
 
+    parameters:
+      - opendaylight-infra-parameters:
+          os-cloud: '{os-cloud}'
+          project: '{project}'
+          branch: '{branch}'
+          refspec: 'refs/heads/{branch}'
+          artifacts: '{archive-artifacts}'
+      - lf-infra-maven-parameters:
+          mvn-opts: '{mvn-opts}'
+          mvn-params: '{mvn-params}'
+          mvn-version: '{mvn-version}'
+          staging-profile-id: ''
+      - string:
+          name: OPENVSWITCH_VERSION
+          # yamllint disable-line rule:line-length
+          default: '{openvswitch-version}'
+          description: 'openvswitch-version'
+
     scm:
-      - git-opflex-ovs-{openvswitch-scm}
+      - git-opflex-ovs-{ovs-scm}
 
     wrappers:
       - opendaylight-infra-wrappers:
           build-timeout: '{build-timeout}'
 
     builders:
-      - builder-opflex-openvswitch-{openvswitch-build}
+      - opflex-build-openvswitch
+      - lf-infra-deploy-maven-file:
+          global-settings-file: 'global-settings'
+          settings-file: 'opflex-settings'
+          mvn-version: '{mvn-version}'
+          repo-id: '{repo-id}'
+          group-id: '{group-id}'
+          upload-files-dir: '{upload-files-dir}'
+          maven-repo-url: '$NEXUS_URL/content/repositories/thirdparty'
 
     publishers:
       - email-notification:
           email-recipients: '{email-recipients}'
           email-prefix: '[opflex]'
-      - archive:
-          artifacts: 'install-root/*.tgz'
+      - lf-infra-publish
diff --git a/jjb/opflex/opflex-macros.yaml b/jjb/opflex/opflex-macros.yaml
new file mode 100644 (file)
index 0000000..44ebfef
--- /dev/null
@@ -0,0 +1,114 @@
+---
+# OpFlex macros
+
+- builder:
+    name: opflex-build
+    builders:
+      - maven-target:
+          maven-version: 'mvn33'
+          pom: genie/pom.xml
+          goals: compile
+      - shell: !include-raw-escape: scripts/opflex-build.sh
+
+- builder:
+    name: 'opflex-build-libuv'
+    builders:
+      - shell: !include-raw-escape: scripts/libuv-build.sh
+
+- builder:
+    name: 'opflex-build-openvswitch'
+    builders:
+      - shell: !include-raw: scripts/openvswitch-build.sh
+
+- builder:
+    name: 'opflex-build-rapidjson'
+    builders:
+      - shell: !include-raw-escape: scripts/rapidjson-build.sh
+
+- builder:
+    name: opflex-deploy-maven-file
+    # Todo: Remove this builder when the generic version of the builder is
+    # available in global-jjb. Change no: 5753
+    # Deploy artifacts to a repository.
+    #
+    # The builder requires passing the following parameters
+    # REPO_ID:           Repository ID
+    # GROUP_ID:          Group ID of the repository
+    # UPLOAD_FILES_PATH: Path to directory containing one or more files
+    builders:
+      - lf-maven-install:
+          mvn-version: '{mvn-version}'
+      - lf-provide-maven-settings:
+          global-settings-file: '{global-settings-file}'
+          settings-file: '{settings-file}'
+      - inject:
+          properties-content: |
+              MAVEN_REPO_URL=file://$WORKSPACE/m2repo
+              REPO_ID={repo-id}
+              GROUP_ID={group-id}
+              UPLOAD_FILES_PATH={upload-files-dir}
+      - shell: !include-raw-escape:
+          - ../global-jjb/shell/lftools-install.sh
+          - ../global-jjb/shell/common-variables.sh
+          - scripts/deploy-opflex.sh
+
+- builder:
+    name: opflex-maven-stage
+    # Todo: Migrate to the generic version of the builders available in
+    # global-jjb. Change no: 5753
+    # Stage files to Nexus repository.
+    #
+    # The builder requires passing the following parameters
+    # REPO_ID             : Repository ID
+    # GROUP_ID            : Group ID of the repository
+    # UPLOAD_FILES_PATH   : Path to directory containing one or more files
+    # STAGING_PROFILE_ID  : Staging profile id created on Nexus
+    builders:
+      - lf-provide-maven-settings:
+          global-settings-file: '{global-settings-file}'
+          settings-file: '{settings-file}'
+      - lf-infra-create-netrc:
+          server-id: opendaylight-staging
+      - inject:
+          properties-content: |
+              STAGING_PROFILE_ID={staging-profile-id}
+      - shell: !include-raw-escape:
+          - ../global-jjb/shell/lftools-install.sh
+          - ../global-jjb/shell/maven-stage.sh
+
+- scm:
+    name: 'git-opflex-libuv'
+    scm:
+      - git:
+          url: https://github.com/libuv/libuv.git
+          branches:
+            - 'refs/tags/v$LIBUV_VERSION'
+          wipe-workspace: true
+
+- scm:
+    name: 'git-opflex-ovs-v2'
+    scm:
+      - git:
+          url: https://github.com/openvswitch/ovs.git
+          branches:
+            - 'refs/tags/v$OPENVSWITCH_VERSION'
+          wipe-workspace: true
+
+# todo: remove 'git-opflex-ovs-v1' after boron EOL
+- scm:
+    name: 'git-opflex-ovs-v1'
+    scm:
+      - git:
+          url: https://github.com/noironetworks/ovs.git
+          branches:
+            - 'origin/noiro'
+          wipe-workspace: true
+
+- scm:
+    name: 'git-opflex-rapidjson'
+    scm:
+      - git:
+          url: https://github.com/miloyip/rapidjson.git
+          branches:
+            - 'refs/tags/v$RAPIDJSON_VERSION'
+          wipe-workspace: true
index 09927a0c2431b9ca9301cd10c97f996005bc9f9b..7dd048e1ae472a35ebafee2a8c7e6f87584238ab 100644 (file)
@@ -7,20 +7,30 @@
     stream:
       - oxygen:
           branch: 'master'
-          jdk: 'openjdk8'
+          libuv-version: '1.8.0'
+          rapidjson-version: '1.0.2'
+          openvswitch-version: '2.6.0'
       - nitrogen:
           branch: 'stable/nitrogen'
-          jdk: openjdk8
+          libuv-version: '1.8.0'
+          rapidjson-version: '1.0.2'
+          openvswitch-version: '2.6.0'
       - carbon:
           branch: 'stable/carbon'
-          jdk: openjdk8
+          libuv-version: '1.8.0'
+          rapidjson-version: '1.0.2'
+          openvswitch-version: '2.6.0'
       - boron:
           branch: 'stable/boron'
-          jdk: openjdk8
+          libuv-version: '1.7.5'
+          rapidjson-version: '1.0.1'
+          openvswitch-version: 'origin/noiro'
 
     project: 'opflex'
     project-name: 'opflex'
 
+    jdk: 'openjdk8'
+
     branch: master
     global-settings-file: global-settings
     settings-file: opflex-settings
     # Used by the release job
     staging-profile-id: 906b0d53d714e
 
-
-- builder:
-    name: opflex-deploy-maven-file
-    # Todo: Remove this builder when the generic version of the builder is
-    # available in global-jjb. Change no: 5753
-    # Deploy artifacts to a repository.
-    #
-    # The builder requires passing the following parameters
-    # REPO_ID:           Repository ID
-    # GROUP_ID:          Group ID of the repository
-    # UPLOAD_FILES_PATH: Path to directory containing one or more files
-    builders:
-      - lf-maven-install:
-          mvn-version: '{mvn-version}'
-      - lf-provide-maven-settings:
-          global-settings-file: '{global-settings-file}'
-          settings-file: '{settings-file}'
-      - inject:
-          properties-content: |
-              MAVEN_REPO_URL=file://$WORKSPACE/m2repo
-              REPO_ID={repo-id}
-              GROUP_ID={group-id}
-              UPLOAD_FILES_PATH={upload-files-dir}
-      - shell: !include-raw-escape:
-          - ../global-jjb/shell/lftools-install.sh
-          - ../global-jjb/shell/common-variables.sh
-          - deploy-opflex.sh
-
-- builder:
-    name: opflex-maven-stage
-    # Todo: Migrate to the generic version of the builders available in
-    # global-jjb. Change no: 5753
-    # Stage files to Nexus repository.
-    #
-    # The builder requires passing the following parameters
-    # REPO_ID             : Repository ID
-    # GROUP_ID            : Group ID of the repository
-    # UPLOAD_FILES_PATH   : Path to directory containing one or more files
-    # STAGING_PROFILE_ID  : Staging profile id created on Nexus
-    builders:
-      - lf-provide-maven-settings:
-          global-settings-file: '{global-settings-file}'
-          settings-file: '{settings-file}'
-      - lf-infra-create-netrc:
-          server-id: opendaylight-staging
-      - inject:
-          properties-content: |
-              STAGING_PROFILE_ID={staging-profile-id}
-      - shell: !include-raw-escape:
-          - ../global-jjb/shell/lftools-install.sh
-          - ../global-jjb/shell/maven-stage.sh
-
 - job-template:
     name: 'opflex-release-{stream}'
 
           mvn-params: '{mvn-params}'
           mvn-version: '{mvn-version}'
           staging-profile-id: '{staging-profile-id}'
+      - string:
+          name: LIBUV_VERSION
+          # yamllint disable-line rule:line-length
+          default: '{libuv-version}'
+          description: 'libuv version to pull from thirdparty repository'
+      - string:
+          name: RAPIDJSON_VERSION
+          # yamllint disable-line rule:line-length
+          default: '{rapidjson-version}'
+          description: 'rapidjson version to pull from thirdparty repository'
+      - string:
+          name: OPENVSWITCH_VERSION
+          # yamllint disable-line rule:line-length
+          default: '{openvswitch-version}'
+          description: 'openvswitch version to pull from thirdparty repository'
 
     scm:
       - gerrit-trigger-scm:
similarity index 97%
rename from jjb/opflex/deploy-opflex.sh
rename to jjb/opflex/scripts/deploy-opflex.sh
index 4d7b95a3847c019c42b8ea192ec7d7f626137029..2fa61bd60e63dd22c5c6f550b8ea8548e89dc23b 100644 (file)
@@ -16,7 +16,7 @@
 # $REPO_ID                 :  Provided by a job parameter.
 # $GROUP_ID                :  Provided by a job parameter.
 # $UPLOAD_FILES_PATH        :  Provided by a job parameter.
-echo "---> deploy-opflex.sh"
+echo "---> scripts/deploy-opflex.sh"
 
 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
 # Ensure we fail the job if any steps fail.
diff --git a/jjb/opflex/scripts/libuv-build.sh b/jjb/opflex/scripts/libuv-build.sh
new file mode 100644 (file)
index 0000000..eea1bef
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/bash
+# SPDX-License-Identifier: EPL-1.0
+##############################################################################
+# Copyright (c) 2017 The Linux Foundation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+##############################################################################
+echo "---> scripts/libuv-build.sh"
+
+set -e
+set -x
+
+./autogen.sh
+ROOT=/tmp/opflex-prefix
+./configure --prefix=$ROOT
+mkdir install-root
+DESTDIR=`pwd`/install-root make clean install
+pushd install-root
+tar -cvzf "libuv-$LIBUV_VERSION.tar.gz" *
+# Move tarball to dir of files that will be uploaded to Nexus
+UPLOAD_FILES_PATH="$WORKSPACE/upload_files"
+mkdir -p "$UPLOAD_FILES_PATH"
+mv *.tar.gz "$_"
+popd
diff --git a/jjb/opflex/scripts/openvswitch-build.sh b/jjb/opflex/scripts/openvswitch-build.sh
new file mode 100644 (file)
index 0000000..2d379c7
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/bash
+# SPDX-License-Identifier: EPL-1.0
+##############################################################################
+# Copyright (c) 2017 The Linux Foundation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+##############################################################################
+# Build script for openvswitch
+
+set -e
+set -x
+
+echo "---> scripts/openvswitch-build.sh"
+
+ROOT=/tmp/opflex-prefix
+DESTDIR=install-root
+
+mkdir -p "$DESTDIR"
+
+./boot.sh
+./configure --prefix="$ROOT" --enable-shared
+make -j4
+DESTDIR=`pwd`/$DESTDIR make install
+
+if [[ $OPENVSWITCH_VERSION =~ 2.6.0 ]]; then
+    mkdir -p $DESTDIR/$ROOT/include/openvswitch/openvswitch
+    mv $DESTDIR/$ROOT/include/openvswitch/*.h $DESTDIR/$ROOT/include/openvswitch/openvswitch
+    mv $DESTDIR/$ROOT/include/openflow $DESTDIR/$ROOT/include/openvswitch
+    cp -t "$DESTDIR/$ROOT/include/openvswitch/" include/*.h
+    find lib -name "*.h" -exec cp --parents -t "$DESTDIR/$ROOT/include/openvswitch/" {} \;
+elif [[ $OPENVSWITCH_VERSION =~ noiro ]]; then
+    find lib ofproto -name "*.h" -exec cp --parents -t "$DESTDIR/$ROOT/include/openvswitch/" {} \;
+fi
+
+pushd $DESTDIR
+tar -cvzf "openvswitch-$OPENVSWITCH_VERSION.tar.gz" *
+# Move tarball to dir of files that will be uploaded to Nexus
+UPLOAD_FILES_PATH="$WORKSPACE/upload_files"
+mkdir -p "$UPLOAD_FILES_PATH"
+mv *.tar.gz "$_"
+popd
similarity index 52%
rename from jjb/opflex/opflex-build.sh
rename to jjb/opflex/scripts/opflex-build.sh
index a35cecd8d74bfbf20b6f90539c9e34d72ce7dd81..ed202bff8c00df7d47ea02629da053aaf3e44ea3 100644 (file)
@@ -1,4 +1,15 @@
 #!/bin/bash
+# SPDX-License-Identifier: EPL-1.0
+##############################################################################
+# Copyright (c) 2017 The Linux Foundation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+##############################################################################
+echo "---> scripts/opflex-build.sh"
+
 # Build script for opflex
 
 set -e
@@ -15,9 +26,14 @@ cleanup
 mkdir -p "$ROOT"
 trap cleanup EXIT
 
-tar -xz -C "$ROOT" --strip-components=2 -f libuv.tgz
-tar -xz -C "$ROOT" --strip-components=2 -f rapidjson.tgz
-tar -xz -C "$ROOT" --strip-components=2 -f openvswitch.tgz
+# Download the artifacts from nexus thirdparty
+wget -nv ${NEXUS_URL}/service/local/repositories/thirdparty/content/openvswitch/openvswitch/${OPENVSWITCH_VERSION}/openvswitch-${OPENVSWITCH_VERSION}.tar.gz
+wget -nv ${NEXUS_URL}/service/local/repositories/thirdparty/content/rapidjson/rapidjson/${RAPIDJSON_VERSION}/rapidjson-${RAPIDJSON_VERSION}.tar.gz
+wget -nv ${NEXUS_URL}/service/local/repositories/thirdparty/content/libuv/libuv/${LIBUV_VERSION}/libuv-${LIBUV_VERSION}.tar.gz
+
+tar -xz -C "$ROOT" --strip-components=2 -f libuv-${LIBUV_VERSION}.tar.gz
+tar -xz -C "$ROOT" --strip-components=2 -f rapidjson-${RAPIDJSON_VERSION}.tar.gz
+tar -xz -C "$ROOT" --strip-components=2 -f openvswitch-${OPENVSWITCH_VERSION}.tar.gz
 
 export PATH="$ROOT/bin:$PATH"
 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$ROOT/lib"
diff --git a/jjb/opflex/scripts/rapidjson-build.sh b/jjb/opflex/scripts/rapidjson-build.sh
new file mode 100644 (file)
index 0000000..2ed6560
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/bash
+# SPDX-License-Identifier: EPL-1.0
+##############################################################################
+# Copyright (c) 2017 The Linux Foundation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+##############################################################################
+echo "---> scripts/rapidjson-build.sh"
+
+# Build script for rapidjson
+
+set -e
+set -x
+
+ROOT=/tmp/opflex-prefix
+DESTDIR=install-root
+
+mkdir -p "$DESTDIR/$ROOT/lib/pkgconfig"
+mkdir -p "$DESTDIR/$ROOT/include"
+
+cp -R include/rapidjson "$DESTDIR/$ROOT/include"
+sed -e "s|@INCLUDE_INSTALL_DIR@|$ROOT/include|" \
+    -e "s|@PROJECT_NAME@|RapidJSON|" \
+    -e "s|@LIB_VERSION_STRING@|1.0.2|" RapidJSON.pc.in > \
+    "$DESTDIR/$ROOT/lib/pkgconfig/RapidJSON.pc"
+
+pushd $DESTDIR
+tar -cvzf "rapidjson-$RAPIDJSON_VERSION.tar.gz" *
+# Move tarball to dir of files that will be uploaded to Nexus
+UPLOAD_FILES_PATH="$WORKSPACE/upload_files"
+mkdir -p "$UPLOAD_FILES_PATH"
+mv *.tar.gz "$_"
+popd