Add release job template 53/37853/2
authorThanh Ha <thanh.ha@linuxfoundation.org>
Tue, 19 Apr 2016 23:20:36 +0000 (19:20 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 20 Apr 2016 14:26:32 +0000 (10:26 -0400)
This new release job type will allow projects not part of autorelease to
perform a release by staging their release in Nexus similar to
autorelease and release the artifacts to opendaylight.release repo once
approved.

Change-Id: I7a26c160a9a49236e6ae2744336bcfeaecade9a3
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
jjb/include-raw-stage-release.sh [new file with mode: 0644]
jjb/releng-macros.yaml
jjb/releng-templates.yaml
jjb/yangide/yangide-releng.yaml [new file with mode: 0644]

diff --git a/jjb/include-raw-stage-release.sh b/jjb/include-raw-stage-release.sh
new file mode 100644 (file)
index 0000000..bf45078
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/bash
+# @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
+##############################################################################
+# Copyright (c) 2016 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
+##############################################################################
+
+# Assuming that mvn deploy created the hide/from/pom/files/stage directory.
+cd hide/from/pom/files
+mkdir -p m2repo/org/opendaylight/
+
+rsync -avz --exclude 'maven-metadata*' \
+           --exclude '_remote.repositories' \
+           --exclude 'resolver-status.properties' \
+           "stage/org/opendaylight/$m" m2repo/org/opendaylight/
+
+mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.2:deploy-staged-repository \
+    -DrepositoryDirectory="`pwd`/m2repo" \
+    -DnexusUrl=https://nexus.opendaylight.org/ \
+    -DstagingProfileId="$STAGING_PROFILE_ID" \
+    -DserverId="opendaylight-staging" \
+    -s $SETTINGS_FILE \
+    -gs $GLOBAL_SETTINGS_FILE | tee $WORKSPACE/deploy-staged-repository.log
index b188da33d8a0557b199628997c904fad3643afb5..97d13d9ec7a9068e07db1be5c78f6e8b99a52a97 100644 (file)
             default: '{refspec}'
             description: "GERRIT_REFSPEC parameter if not given by trigger"
 
+- parameter:
+    name: build-tag
+    parameters:
+        - string:
+            name: BUILD_TAG
+            default: ''
+            description: 'Tag in Git to checkout'
+
 - parameter:
     name: controller-version-parameter
     parameters:
             default: 'master'
             description: 'distribution repo branch to build with'
 
+- parameter:
+    name: stage-id-parameter
+    parameters:
+        - string:
+            name: STAGING_PROFILE_ID
+            default: '{stage-id}'
+            description: 'Nexus staging profile id'
+
 - scm:
     name: git-scm
     scm:
           variable: 'GLOBAL_SETTINGS_FILE'
         - file-id: '{settings-file}'
           variable: 'SETTINGS_FILE'
+
+- builder:
+    name: releng-stage-release
+    builders:
+        - shell: !include-raw: include-raw-stage-release.sh
index f48e2b6e1bad303b641be09ccc18d48f0c2a3909..a90aec478c532fb77ff9005b60487c18cf6f84e7 100644 (file)
@@ -1,3 +1,64 @@
+- job-template:
+    name: '{name}-release-java'
+
+    # Job template for producing a release candidate by creating a staging repo
+    # in Nexus.
+
+    project-type: maven
+    node: dynamic_merge
+    jdk: '{jdk}'
+
+    logrotate:
+        daysToKeep: '30'
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+        - build-tag
+        - stage-id-parameter:
+            stage-id: '{stage-id}'
+
+    scm:
+        - git:
+            credentials-id: '{ssh-credentials}'
+            url: '$GIT_BASE'
+            branches:
+                - '$BUILD_TAG'
+            skip-tag: true
+            shallow-clone: true
+            wipe-workspace: true
+
+    wrappers:
+        - build-timeout
+        - ssh-agent-credentials:
+            users:
+                - '{ssh-credentials}'
+
+    prebuilders:
+        - wipe-org-opendaylight-repo
+        - jacoco-nojava-workaround
+        - provide-maven-settings:
+            global-settings-file: '{odl-global-settings}'
+            settings-file: '{autorelease-settings}'
+
+    maven:
+        maven-name: '{mvn33}'
+        root-pom: 'pom.xml'
+        goals: 'clean deploy -V -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r  -Djenkins -DaltDeploymentRepository=staging::default::file:hide/from/pom/files/stage'
+        maven-opts: '-Xmx1024m -XX:MaxPermSize=256m'
+        settings: '{autorelease-settings}'
+        global-settings: '{odl-global-settings}'
+        post-step-run-condition: UNSTABLE
+
+    postbuilders:
+        - releng-stage-release
+
+    publishers:
+        - archive-artifacts:
+            artifacts: '*.log'
+        - email-notification:
+            email-prefix: '[releng]'
+
 - job-template:
     name: '{name}-verify-python-{stream}'
 
diff --git a/jjb/yangide/yangide-releng.yaml b/jjb/yangide/yangide-releng.yaml
new file mode 100644 (file)
index 0000000..19d3f7e
--- /dev/null
@@ -0,0 +1,8 @@
+- project:
+    name: yangide-releng
+    jobs:
+    - '{name}-release-java'
+
+    project: yangide
+    jdk: 'openjdk8'
+    stage-id: 'fba306956f98'