## 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
+```
---
- 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
---
- 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
--- /dev/null
+#!/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}'
# 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
#!/bin/bash -l
-echo "---> verify.sh"
+echo "---> vagrant-verify.sh"
# Ensure we fail the job if any steps fail
# Disable 'globbing'