GEODE: Add Src Release job for geode-native 98/2898/2
authorrobert.tomczyk <robert.tomczyk@est.tech>
Thu, 14 Nov 2019 13:43:46 +0000 (13:43 +0000)
committerRobert Tomczyk <robert.tomczyk@est.tech>
Thu, 14 Nov 2019 13:46:45 +0000 (13:46 +0000)
- Publish geode-native source to Nordix Artifactory
- Change default branch to release-nordix
- Publish status of the jobs to Geode Slack channel

Change-Id: I774e690e7e6dfc9f0fc95a4edd28c7b37ef40a7f

jjb/geode-native/apache-geode-native-macros.yaml
jjb/geode-native/apache-geode-native-release/apache-geode-native-SrcRelease.yaml [new file with mode: 0644]
jjb/geode-native/apache-geode-native-release/src_release.sh [new file with mode: 0755]
jjb/geode-native/apache-geode-native-verify.yaml
jjb/geode-native/global-template-apache-geode-native-test.yaml
jjb/geode/apache-geode-macros.yaml
jjb/global/jjb-macros.yaml
jjb/global/verify_geode_tag.sh [moved from jjb/geode/verify_geode_tag.sh with 95% similarity]

index efb2dbb31fdcb658571ba8509128151c80c6d97c..03184452e6c10a407a0799974e1726e0e9264587 100644 (file)
@@ -44,3 +44,8 @@
     builders:
       - shell:
           !include-raw: ./apache-geode-native-test/new_integrationtest.sh
+- builder:
+    name: 'apache-geode-native-srcrelease-macro'
+    builders:
+      - shell:
+          !include-raw: ./apache-geode-native-release/src_release.sh
diff --git a/jjb/geode-native/apache-geode-native-release/apache-geode-native-SrcRelease.yaml b/jjb/geode-native/apache-geode-native-release/apache-geode-native-SrcRelease.yaml
new file mode 100644 (file)
index 0000000..44c2770
--- /dev/null
@@ -0,0 +1,65 @@
+---
+#
+# ============LICENSE_START=======================================================
+#  Copyright (C) 2018-2019 Nordix Foundation.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIN D, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+- job:
+    name: 'apache-geode-native-SrcRelease'
+
+    node: geode-ubuntu1804
+    disabled: false
+    concurrent: true
+
+    properties:
+      - logrotate
+      - github:
+          url: 'https://github.com/Nordix/geode-native.git/'
+
+    parameters:
+      - string:
+          name: PROJECT
+          default: 'Nordix/geode-native'
+          description: JJB configured PROJECT parameter to identify a Nordix GitHub project
+      - string:
+          name: BRANCH
+          default: 'release-nordix/1.10.0'
+          description: JJB configured BRANCH parameter for Nordix GitHub project
+
+    wrappers:
+      - credentials-binding:
+          - username-password-separated:
+              credential-id: infra-nordix-artifactory-api-key
+              username: ARTIFACTORY_USER
+              password: ARTIFACTORY_API_KEY
+    scm:
+      - git-scm-github:
+          branch: '$BRANCH'
+          refspec: ''
+          wipe_workspace: true
+          clean_before: false
+          base_dir: 'geode-native'
+
+    builders:
+      - 'apache-geode-native-srcrelease-macro'
+
+    publishers:
+      - notify-slack:
+          slack-channel: '#geode'
+          notify-start: true
+          notify-success: true
+          notify-failure: true
+          notify-back-to-normal: true
\ No newline at end of file
diff --git a/jjb/geode-native/apache-geode-native-release/src_release.sh b/jjb/geode-native/apache-geode-native-release/src_release.sh
new file mode 100755 (executable)
index 0000000..e7b72d1
--- /dev/null
@@ -0,0 +1,49 @@
+#!/usr/bin/env bash
+# ============LICENSE_START=======================================================
+#  Copyright (C) 2018-2019 Nordix Foundation.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+set -o nounset
+set -o errexit
+set -o pipefail
+#set -o xtrace
+
+ARTIFACTORY_URL="https://artifactory.nordix.org/artifactory"
+GEODE_VERSION=$(cd geode-native ; git describe --abbrev=0 --tags | sed -r "s#rel/v(.*)#\1#")
+# Make sure the Geode tag version is in agreed format.
+if [[ ${GEODE_VERSION} =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]$ ]] ; then
+   GEODE_UPSTREAM_VERSION=$(echo ${GEODE_VERSION} | awk -F "." '{print $1"."$2"."$3}')
+   BUILD_DATE=$(date '+%Y%m%d%H%M')
+   GEODE_ARTIFACT="geode_client_src-${GEODE_VERSION}-NORDIX.${BUILD_DATE}.tgz"
+   tar czvf ${GEODE_ARTIFACT} geode-native/
+else
+   echo "ERROR: Incorrect geode-native tag version on the branch: ${GEODE_VERSION}"
+   exit 1
+fi
+
+SHA_CHECKSUM=$(shasum -a 1 ${GEODE_ARTIFACT} | awk '{ print $1 }')
+SHA256_CHECKSUM=$(sha256sum ${GEODE_ARTIFACT} | awk '{ print $1 }')
+MD5_CHECKSUM=$(md5sum ${GEODE_ARTIFACT} | awk '{ print $1 }')
+echo "-----------------------------------------------------------"
+echo -e "\nUploading ${GEODE_ARTIFACT} to geode-client area: "
+echo -e "geode-client/${GEODE_UPSTREAM_VERSION}/src on artifactory.nordix.org\n"
+curl -H "X-JFrog-Art-Api:${ARTIFACTORY_API_KEY}" \
+     -H "X-Checksum-Sha1:${SHA_CHECKSUM}" \
+     -H "X-Checksum-Sha256:${SHA256_CHECKSUM}" \
+     -H "X-Checksum-MD5:${MD5_CHECKSUM}" \
+     -X PUT "${ARTIFACTORY_URL}/geode-client/${GEODE_UPSTREAM_VERSION}/src/${GEODE_ARTIFACT}" \
+     -T ${GEODE_ARTIFACT}
+echo "-----------------------------------------------------------"
index ca0668c04e05cee028ee0ad09482922cc96cae57..2d085f2c75aa604da5bcbae1ffca5e3cd0761ace 100644 (file)
@@ -22,8 +22,8 @@
     project: 'Nordix/geode-native'
 
     stream:
-      - 'develop':
-          branch: 'develop'
+      - 'release-nordix-1.10.0':
+          branch: 'release-nordix/1.10.0'
     jobs:
       - 'apache-geode-native-{stream}-verify'
 
@@ -45,7 +45,7 @@
           description: JJB configured BRANCH parameter for Nordix GitHub project
       - string:
           name: JOBS
-          default: '6'
+          default: '24'
           description: JJB configured JOBS parameter. Specifies the number of make jobs to run simultaneously while building geode-native
       - string:
           name: GEODE_NATIVE_DOCKER_IMAGE
@@ -73,6 +73,7 @@
       - github
 
     builders:
+      - 'verify-geode-tag-macro'
       - multijob:
           name: SlaveSetup
           condition: SUCCESSFUL
               git-revision: true
               abort-all-job: true
               node-parameters: true
-#      - multijob:
-#          name: Release
-#          condition: SUCCESSFUL
-#          execution-type: SEQUENTIALLY
-#          projects:
-#            - name: 'apache-geode-native-SrcRelease'
-#              current-parameters: true
-#              git-revision: true
-#              abort-all-job: true
-#              node-parameters: true
+      - multijob:
+          name: Release
+          condition: SUCCESSFUL
+          execution-type: SEQUENTIALLY
+          projects:
+            - name: 'apache-geode-native-SrcRelease'
+              current-parameters: true
+              git-revision: true
+              abort-all-job: true
+              node-parameters: true
 
-#    publishers:
-#      - notify-slack:
-#          slack-channel: '#geode'
-#          notify-start: true
-#          notify-success: true
-#          notify-failure: true
-#          notify-back-to-normal: true
\ No newline at end of file
+    publishers:
+      - notify-slack:
+          slack-channel: '#geode'
+          notify-start: true
+          notify-success: true
+          notify-failure: true
+          notify-back-to-normal: true
\ No newline at end of file
index cedc0dbb5c7d22d31a42557b9ef5a0f885957aa2..e59d5b5b7d972913841cbc7cf33a8c6f21677329 100644 (file)
@@ -40,7 +40,7 @@
           description: JJB configured BRANCH parameter for Nordix GitHub project
       - string:
           name: JOBS
-          default: '6'
+          default: '24'
           description: JJB configured JOBS parameter. Specifies the number of make jobs to run simultaneously while building geode-native
       - string:
           name: GEODE_NATIVE_DOCKER_IMAGE
@@ -62,9 +62,9 @@
       - workspace-cleanup:
           clean-if:
             - failure: false
-#      - notify-slack:
-#          slack-channel: '#geode'
-#          notify-start: true
-#          notify-success: true
-#          notify-failure: true
-#          notify-back-to-normal: true
+      - notify-slack:
+          slack-channel: '#geode'
+          notify-start: true
+          notify-success: true
+          notify-failure: true
+          notify-back-to-normal: true
index 04f94d3f4da99fec3e75413f9325c5e9c35731db..220baa7e758c2d5401aabfb992bb8217a9db55e3 100644 (file)
@@ -46,9 +46,3 @@
     builders:
       - shell:
           !include-raw: ./apache-geode-slave/slave_setup.sh
-
-- builder:
-    name: 'verify-geode-tag-macro'
-    builders:
-      - shell:
-          !include-raw: ./verify_geode_tag.sh
\ No newline at end of file
index 58ba0f4803e3e009e0ceae917f60f9759ce7df5d..6a4d11ef8e8743869a9eeb4431e699d651580dbd 100644 (file)
           default: ssh://$GERRIT_USER@gerrit.o-ran-sc.org:29418
           description: SSH URL to Project Repo on ORAN-SC Gerrit to clone repo
 
+# Verify job for Geode git tags to make sure there are in agreed format
+- builder:
+    name: 'verify-geode-tag-macro'
+    builders:
+      - shell:
+          !include-raw: ./verify_geode_tag.sh
+
 # defaults for job build history
 - property:
     name: logrotate-default
similarity index 95%
rename from jjb/geode/verify_geode_tag.sh
rename to jjb/global/verify_geode_tag.sh
index b77b3de2893b2b674a787763bde9590743c586be..d9eceae0235a8c6efaa511b58b5922255dff3a11 100755 (executable)
@@ -25,7 +25,8 @@ gitlog(){
     awk -F '|' '{ printf "%s %-20s %s\n", $1, $2, $3 }' | head -${1}
 }
 
-cd $WORKSPACE/geode
+# There could be 2 directory with source: geode or geode-native
+cd ${WORKSPACE}/geode*
 GEODE_VERSION=$(git describe --abbrev=0 --tags | sed -r "s#rel/v(.*)#\1#")
 GIT_LOGS=8