Add job for bm deployment 40/1940/2
authorchengli3 <cheng1.li@intel.com>
Fri, 8 Nov 2019 06:27:10 +0000 (14:27 +0800)
committerchengli3 <cheng1.li@intel.com>
Fri, 8 Nov 2019 07:08:14 +0000 (15:08 +0800)
Change-Id: Id2ae36f0e8cca73d1fd42f8654cc69bf63761d8d
Signed-off-by: chengli3 <cheng1.li@intel.com>
ci/README.md
ci/jjb/akraino-icn-templates.yaml
ci/jjb/project.yaml
ci/jjb/shell/bm-verify.sh [new file with mode: 0644]
ci/jjb/shell/org-logs-deploy.sh
ci/jjb/shell/vagrant-verify.sh [moved from ci/jjb/shell/verify.sh with 93% similarity]

index 5e3e444..d3a4200 100644 (file)
@@ -25,17 +25,33 @@ Once the playbook is successful, we can visite the jenkins server at http://<lis
 ## What to do next
 
 1. Add the gerrit ssh key as jenkins credential, so that our jobs can pull code from the gerrit.
-The credential ID field must be `jenkins-ssh`. As this is hard coded in the jobs.
+The credential ID field must be `jenkins-ssh`, as this is hard coded in the jobs. The type should
+be private key. The user name is the gerrit account name.
 2. To push the logs to Akraino Nexus server, we need to create the authentication file for lftools.
-The file path is `/var/lib/jenkins/.netrc` and the content should be one line
-`machine nexus.akraino.org login the_name password the_pass`
+The file should be owned by jenkins user. The file path is `/var/lib/jenkins/.netrc` and
+the content should be one line `machine nexus.akraino.org login the_name password the_pass`
 3. The last step is to deploy our CD jobs by jenkins-job-builder tool.
 
 ```
-git clone "https://gerrit.akraino.org/r/ci-management"
+git clone --recursive "https://gerrit.akraino.org/r/ci-management"
 git clone "https://gerrit.akraino.org/r/icn"
 # create the jjb config file before moving on
 # https://docs.releng.linuxfoundation.org/en/latest/jenkins-sandbox.html
 jenkins-jobs test ci-management/jjb:icn/ci/jjb icn-master-verify
 jenkins-jobs update ci-management/jjb:icn/ci/jjb icn-master-verify
 ```
+
+A sample of jjb config file
+```
+[job_builder]
+ignore_cache=True
+keep_descriptions=False
+recursive=True
+retain_anchors=True
+update=jobs
+
+[jenkins]
+user=admin
+password=admin
+url=http://localhost:8080
+```
index b2367ef..3bab6ac 100644 (file)
@@ -1,7 +1,7 @@
 ---
 - job-template:
-    id: icn-stream-verify-target
-    name: 'icn-{stream}-verify-{target}'
+    id: icn-stream-vagrant-verify-target
+    name: 'icn-{stream}-vagrant-verify-{target}'
     defaults: icn
     archive-artifacts: >
       **/*.log
 
     builders:
       - shell: !include-raw:
-          - shell/verify.sh
+          - shell/vagrant-verify.sh
+
+    publishers:
+      - icn-infra-publish
+#      - email:
+#          recipients: icn.jenkins@intel.com
+
+- job-template:
+    id: icn-stream-bm-verify-target
+    name: 'icn-{stream}-bm-verify-{target}'
+    defaults: icn
+    archive-artifacts: >
+      **/*.log
+    build-days-to-keep: 30
+    build-timeout: 60
+    stream: master
+    target: verifier
+    project-type: freestyle
+    submodule-recursive: true
+    #node: '{build-node}'
+
+    properties:
+      - lf-infra-properties:
+          build-days-to-keep: '{build-days-to-keep}'
+
+    parameters:
+      - lf-infra-parameters:
+          project: '{project}'
+          stream: '{stream}'
+          branch: '{branch}'
+          lftools-version: '{lftools-version}'
+
+      - string:
+          name: ARCHIVE_ARTIFACTS
+          default: '{archive-artifacts}'
+          description: Artifacts to archive to the logs server.
+
+      - string:
+          name: NEXUS_LOG_SUBDIR
+          default: '{nexus_log_subdir}'
+          description: Organization sub dir on Akraino Nexus server.
+
+    wrappers:
+      - lf-infra-wrappers:
+          build-timeout: '{build-timeout}'
+          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+    scm:
+      - lf-infra-gerrit-scm:
+          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+          git-url: '{git-url}/{project}.git'
+          refspec: '$GERRIT_REFSPEC'
+          branch: '$GERRIT_BRANCH'
+          submodule-recursive: '{submodule-recursive}'
+          submodule-timeout: '{submodule-timeout}'
+          submodule-disable: false
+          choosing-strategy: 'gerrit'
+
+    triggers:
+      - timed: "@midnight"
+
+    builders:
+      - shell: !include-raw:
+          - shell/bm-verify.sh
 
     publishers:
       - icn-infra-publish
index eb0415f..e3800c4 100644 (file)
@@ -1,6 +1,6 @@
 ---
 - project:
-    name: icn-private
+    name: icn-vagrant
     project: icn
     project-name: icn
     nexus_log_subdir: intel/ICN_CD_logs
       - master:
           branch: master
     jobs:
-      - icn-stream-verify-target
+      - icn-stream-vagrant-verify-target
+
+- project:
+    name: icn-bm
+    project: icn
+    project-name: icn
+    nexus_log_subdir: intel/ICN_CD_logs
+    target:
+      - bm_verifer
+    stream:
+      - master:
+          branch: master
+    jobs:
+      - icn-stream-bm-verify-target
diff --git a/ci/jjb/shell/bm-verify.sh b/ci/jjb/shell/bm-verify.sh
new file mode 100644 (file)
index 0000000..c9308fa
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/bash -l
+echo "---> bm-verify.sh"
+
+# Ensure we fail the job if any steps fail
+# Disable 'globbing'
+set -exuf -o pipefail
+
+sudo apt update
+sudo apt install -y make
+sudo su -c 'make {target}'
index ca828cb..4919a4f 100644 (file)
@@ -14,7 +14,7 @@ echo "---> logs-deploy.sh"
 # Disable 'globbing'
 set -euf -o pipefail
 
-JENKINS_HOSTNAME=pod14-node2
+JENKINS_HOSTNAME=`hostname`
 NEXUS_URL=https://nexus.akraino.org
 LOGS_SERVER=https://logs.akraino.org
 
similarity index 93%
rename from ci/jjb/shell/verify.sh
rename to ci/jjb/shell/vagrant-verify.sh
index a5e68fa..65148aa 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/bash -l
-echo "---> verify.sh"
+echo "---> vagrant-verify.sh"
 
 # Ensure we fail the job if any steps fail
 # Disable 'globbing'