[HICN-3] Added first jjb configuration for hicn. 68/16968/2
authorMauro Sardara <msardara@cisco.com>
Tue, 22 Jan 2019 13:07:55 +0000 (14:07 +0100)
committerMauro Sardara <msardara@cisco.com>
Tue, 22 Jan 2019 13:14:15 +0000 (14:14 +0100)
Change-Id: I6d44b8c2b59edb5ba75c64aef50b79a2345605a3
Signed-off-by: Mauro Sardara <msardara@cisco.com>
jjb/hicn/hicn.yaml [new file with mode: 0644]
jjb/hicn/include-raw-hicn-build.sh [new file with mode: 0644]
jjb/hicn/include-raw-hicn-checkstyle.sh [new file with mode: 0644]
jjb/hicn/include-raw-hicn-maven-push.sh [new file with mode: 0644]

diff --git a/jjb/hicn/hicn.yaml b/jjb/hicn/hicn.yaml
new file mode 100644 (file)
index 0000000..5f334c8
--- /dev/null
@@ -0,0 +1,173 @@
+---
+- project:
+    name: hicn
+    jobs:
+      - 'hicn-verify-{stream}-{os}'
+      - 'hicn-merge-{stream}-{os}'
+
+    project: 'hicn'
+    os:
+      - ubuntu1804:
+          repo-os-part: 'ubuntu.bionic.main'
+      - ubuntu1604:
+          repo-os-part: 'ubuntu.xenial.main'
+      - centos7:
+          repo-os-part: 'centos7'
+
+    stream:
+      - master:
+          branch: 'master'
+          repo-stream-part: 'master'
+
+    type:
+      - short
+      - long
+
+- job-template:
+    name: 'hicn-verify-{stream}-{os}'
+
+    project-type: freestyle
+    node: '{os}-us'
+    concurrent: true
+
+    build-discarder:
+      daysToKeep: '{build-days-to-keep}'
+      numToKeep: 100
+      artifactDaysToKeep: '{build-artifact-days-to-keep}'
+      artifactNumToKeep: '{build-artifact-num-to-keep}'
+
+    parameters:
+      - project-parameter:
+          project: '{project}'
+      - gerrit-parameter:
+          branch: '{branch}'
+      - os-parameter:
+          os: '{os}'
+      - repo-name-parameter:
+          repo-name: '{repo-stream-part}.{repo-os-part}'
+      - stream-parameter:
+          stream: '{stream}'
+
+    scm:
+      - gerrit-trigger-scm:
+          credentials-id: 'jenkins-gerrit-credentials'
+          refspec: '$GERRIT_REFSPEC'
+          choosing-strategy: 'gerrit'
+
+    wrappers:
+      - fdio-infra-wrappers:
+          build-timeout: 120
+
+    triggers:
+      - gerrit-trigger-checkstyle:
+          name: '{project}'
+          branch: '{branch}'
+
+    builders:
+      - shell:
+          !include-raw-escape:
+          - include-raw-hicn-build.sh
+
+    publishers:
+      - archive:
+          artifacts: >
+            **/build/*.rpm,
+            **/build/*.deb
+          allow-empty: 'true'
+          fingerprint: false
+          only-if-success: true
+          default-excludes: false
+      - fdio-infra-shiplogs:
+          maven-version: 'mvn33-new'
+
+- job-template:
+    name: 'hicn-merge-{stream}-{os}'
+
+    project-type: freestyle
+    node: '{os}-us'
+
+    build-discarder:
+      daysToKeep: '{build-days-to-keep}'
+      numToKeep: 100
+      artifactDaysToKeep: '{build-artifact-days-to-keep}'
+      artifactNumToKeep: '{build-artifact-num-to-keep}'
+
+    parameters:
+      - project-parameter:
+          project: '{project}'
+      - gerrit-parameter:
+          branch: '{branch}'
+      - os-parameter:
+          os: '{os}'
+      - maven-project-parameter:
+          maven: 'mvn33-new'
+      - maven-exec:
+          maven-version: 'mvn33-new'
+      - stream-parameter:
+          stream: '{stream}'
+      - repo-name-parameter:
+          repo-name: '{repo-stream-part}.{repo-os-part}'
+
+    scm:
+      - gerrit-trigger-scm:
+          credentials-id: 'jenkins-gerrit-credentials'
+          refspec: ''
+          choosing-strategy: 'default'
+
+    wrappers:
+      - fdio-infra-wrappers:
+          build-timeout: '{build-timeout}'
+
+    triggers:
+      - gerrit-trigger-patch-merged:
+          name: '{project}'
+          branch: '{branch}'
+
+    builders:
+      - config-file-provider:
+          files:
+            - file-id: '.packagecloud'
+              target: '/root'
+      - config-file-provider:
+          files:
+            - file-id: 'packagecloud_api'
+              target: '/root'
+      - maven-target:
+          maven-version: 'mvn33-new'
+          goals: '--version'
+          settings: 'hicn-settings'
+          settings-type: cfp
+          global-settings: 'global-settings'
+          global-settings-type: cfp
+      - shell:
+          !include-raw-escape:
+          - include-raw-hicn-checkstyle.sh
+      - shell:
+          !include-raw-escape:
+          - include-raw-hicn-build.sh
+      - provide-maven-settings:
+          settings-file: 'hicn-settings'
+          global-settings-file: 'global-settings'
+      - shell:
+          !include-raw-escape:
+          - ../scripts/packagecloud_push.sh
+      - shell:
+          !include-raw-escape:
+          - ../scripts/maven_push_functions.sh
+          - include-raw-hicn-maven-push.sh
+
+    publishers:
+      - archive:
+          artifacts: >
+            **/build/*.rpm,
+            **/build/*.deb
+          allow-empty: 'true'
+          fingerprint: false
+          only-if-success: true
+          default-excludes: false
+      - fdio-infra-shiplogs:
+          maven-version: 'mvn33-new'
+      - naginator:
+          rerun-unstable-builds: false
+          max-failed-builds: 1
+          fixed-delay: 90
diff --git a/jjb/hicn/include-raw-hicn-build.sh b/jjb/hicn/include-raw-hicn-build.sh
new file mode 100644 (file)
index 0000000..e1d20a4
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+# basic build script example
+set -euxo pipefail
+
+pushd scripts
+bash ./build-packages.sh
+popd
diff --git a/jjb/hicn/include-raw-hicn-checkstyle.sh b/jjb/hicn/include-raw-hicn-checkstyle.sh
new file mode 100644 (file)
index 0000000..636590e
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+if [ -f ./scripts/checkstyle.sh ];then
+    bash scripts/checkstyle.sh
+else
+    echo "Cannot find scripts/checkstyle.sh - skipping checkstyle"
+fi
diff --git a/jjb/hicn/include-raw-hicn-maven-push.sh b/jjb/hicn/include-raw-hicn-maven-push.sh
new file mode 100644 (file)
index 0000000..6e3c9a8
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/bash
+set -xe -o pipefail
+echo "*******************************************************************"
+echo "* STARTING PUSH OF PACKAGES TO REPOS"
+echo "* NOTHING THAT HAPPENS BELOW THIS POINT IS RELATED TO BUILD FAILURE"
+echo "*******************************************************************"
+
+[ "$MVN" ] || MVN="/opt/apache/maven/bin/mvn"
+GROUP_ID="io.fd.${PROJECT}"
+BASEURL="${NEXUSPROXY}/content/repositories/fd.io."
+BASEREPOID='fdio-'
+
+if [ "${OS}" == "ubuntu1604" ]; then
+    # Find the files
+    JARS=$(find . -type f -iname '*.jar')
+    DEBS=$(find . -type f -iname '*.deb')
+    for i in $JARS
+    do
+        push_jar "$i"
+    done
+
+    for i in $DEBS
+    do
+        push_deb "$i"
+    done
+elif [ "${OS}" == "ubuntu1804" ]; then
+    # Find the files
+    JARS=$(find . -type f -iname '*.jar')
+    DEBS=$(find . -type f -iname '*.deb')
+    for i in $JARS
+    do
+        push_jar "$i"
+    done
+
+    for i in $DEBS
+    do
+        push_deb "$i"
+    done
+elif [ "${OS}" == "centos7" ]; then
+    # Find the files
+    RPMS=$(find . -type f -iname '*.rpm')
+    SRPMS=$(find . -type f -iname '*.srpm')
+    SRCRPMS=$(find . -type f -name '*.src.rpm')
+    for i in $RPMS $SRPMS $SRCRPMS
+    do
+        push_rpm "$i"
+    done
+fi