Added tagging/versioning/publishing job templates
- Uses the CORD-style versioning workflow described here:
https://guide.opencord.org/developer/test_release_software.html#versioning-projects
but with refactoring and renaming for clarification.
- Added trellis-docs test/publish jobs using these templates
- Cleanup of defaults.yaml file
- Added rsync and virtualenv to ubuntu basebuild
Change-Id: I03692460a5b6eee6b8f131f0fbcc9c5957819ddd
diff --git a/jjb/templates/make-test.yaml b/jjb/templates/make-test.yaml
new file mode 100644
index 0000000..2928e64
--- /dev/null
+++ b/jjb/templates/make-test.yaml
@@ -0,0 +1,66 @@
+---
+# Run Makefile targets and optionally collect unit test data
+
+- job-template:
+ id: 'make-test'
+ name: 'make-test{name-extension}_{project}'
+
+ description: |
+ Created by {id} job-template from ci-management/jjb/templates/make-test.yaml<br/>
+ Runs make with the following test targets - '{make-test-targets}'
+
+ triggers:
+ - onf-infra-gerrit-trigger-patchset:
+ gerrit-server-name: '{gerrit-server-name}'
+ project-regexp: '^{project}$'
+ branch-regexp: '{branch-regexp}'
+ dependency-jobs: '{dependency-jobs}'
+ file-include-regexp: '{all-files-regexp}'
+
+ properties:
+ - onf-infra-properties:
+ build-days-to-keep: '{build-days-to-keep}'
+ artifact-num-to-keep: '{artifact-num-to-keep}'
+
+ wrappers:
+ - lf-infra-wrappers:
+ build-timeout: '{build-timeout}'
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+ scm:
+ - onf-infra-gerrit-scm:
+ git-url: '$GIT_URL/$GERRIT_PROJECT'
+ refspec: '$GERRIT_REFSPEC'
+ branch: '$GERRIT_BRANCH'
+ submodule-recursive: 'false'
+ choosing-strategy: gerrit
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+ basedir: '{project}'
+
+ node: '{build-node}'
+ project-type: freestyle
+ concurrent: true
+
+ builders:
+ - inject:
+ properties-content: |
+ DEST_GOPATH={dest-gopath}
+ MAKE_TEST_TARGETS={make-test-targets}
+ MAKE_TEST_KEEP_GOING={make-test-keep-going}
+ - shell: !include-raw-escape: ../shell/make-test.sh
+
+ publishers:
+ - junit:
+ results: "**/*results.xml,**/*report.xml"
+ allow-empty-results: '{junit-allow-empty-results}'
+ - cobertura:
+ report-file: "**/*coverage.xml"
+ targets:
+ - files:
+ healthy: 80
+ unhealthy: 0
+ failing: 0
+ - method:
+ healthy: 50
+ unhealthy: 0
+ failing: 0
diff --git a/jjb/templates/sync-dir.yaml b/jjb/templates/sync-dir.yaml
new file mode 100644
index 0000000..8faa101
--- /dev/null
+++ b/jjb/templates/sync-dir.yaml
@@ -0,0 +1,65 @@
+---
+# sync built directory to a remote server
+
+- job-template:
+ id: sync-dir
+ name: "sync-dir_{project}"
+ description: |
+ Created by {id} job-template from ci-management/jjb/templates/sync-dir.yaml
+ After merge run a build step then upload files to a directory remote server.
+
+ parameters:
+ - string:
+ name: BUILD_COMMAND
+ default: '{build-command}'
+ description: 'Name of the command to run to generate artifacts'
+
+ - string:
+ name: BUILD_OUTPUT_PATH
+ default: '{build-output-path}'
+ description: 'Path of files where build output is created by build command, relative to code checkout location'
+
+ - string:
+ name: SYNC_TARGET_SERVER
+ default: '{sync-target-server}'
+ description: 'Name of server where built files will be synced'
+
+ - string:
+ name: SYNC_TARGET_PATH
+ default: '{sync-target-path}'
+ description: 'Directory path on target server where the files will be synced'
+
+ triggers:
+ - onf-infra-gerrit-trigger-merge:
+ gerrit-server-name: '{gerrit-server-name}'
+ project-regexp: '^{project}$'
+ branch-regexp: '{branch-regexp}'
+ file-include-regexp: '{all-files-regexp}'
+ dependency-jobs: '{dependency-jobs}'
+
+ properties:
+ - onf-infra-properties:
+ build-days-to-keep: '{build-days-to-keep}'
+ artifact-num-to-keep: '{artifact-num-to-keep}'
+
+ wrappers:
+ - onf-infra-rsync-wrappers:
+ build-timeout: '{build-timeout}'
+ jenkins-ssh-credential: '{gerrit-ssh-credential}'
+
+ scm:
+ - lf-infra-gerrit-scm:
+ git-url: '$GIT_URL/$GERRIT_PROJECT'
+ refspec: '$GERRIT_REFSPEC'
+ branch: '$GERRIT_BRANCH'
+ submodule-recursive: 'false'
+ choosing-strategy: gerrit
+ jenkins-ssh-credential: '{gerrit-ssh-credential}'
+
+ node: '{build-node}'
+ project-type: freestyle
+ concurrent: true
+
+ builders:
+ - shell: !include-raw-escape: ../shell/sync-dir.sh
+
diff --git a/jjb/templates/verify-licensed.yaml b/jjb/templates/verify-licensed.yaml
new file mode 100644
index 0000000..48bf37a
--- /dev/null
+++ b/jjb/templates/verify-licensed.yaml
@@ -0,0 +1,43 @@
+---
+# Verify that there is valid license/copyright on files
+
+- job-template:
+ id: verify-licensed
+ name: 'verify-licensed_{project}'
+ description: |
+ Created by ci-management/jjb/templates/verify-licensed.yaml
+
+ triggers:
+ - onf-infra-gerrit-trigger-patchset:
+ gerrit-server-name: '{gerrit-server-name}'
+ project-regexp: '^{project}$'
+ branch-regexp: '{branch-regexp}'
+ file-include-regexp: '{all-files-regexp}'
+ dependency-jobs: '{dependency-jobs}'
+
+ properties:
+ - onf-infra-properties:
+ build-days-to-keep: '{build-days-to-keep}'
+ artifact-num-to-keep: '{artifact-num-to-keep}'
+
+ wrappers:
+ - lf-infra-wrappers:
+ build-timeout: '{build-timeout}'
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+ scm:
+ - lf-infra-gerrit-scm:
+ git-url: '$GIT_URL/$GERRIT_PROJECT'
+ refspec: '$GERRIT_REFSPEC'
+ branch: '$GERRIT_BRANCH'
+ submodule-recursive: 'false'
+ choosing-strategy: gerrit
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+ node: '{build-node}'
+ project-type: freestyle
+ concurrent: true
+
+ builders:
+ - shell: !include-raw-escape: ../shell/licensecheck.sh
+
diff --git a/jjb/templates/versioning.yaml b/jjb/templates/versioning.yaml
new file mode 100644
index 0000000..9e2f164
--- /dev/null
+++ b/jjb/templates/versioning.yaml
@@ -0,0 +1,111 @@
+---
+# versioning jobs for tagging/releasing software
+
+# Versioning conventions:
+#
+# 1. There is a 1:1 relationship between SemVer _release_ versions described
+# in the commit and the git tag applied to that commit by Jenkins.
+#
+# 2. Non-release versions (ex: 1.0.1-dev3, etc.) can exist in multiple
+# commits, and don't trigger creation of git tags.
+#
+# 3. Git history is public, and therefore shouldn't be rewritten to abandon
+# already merged commits
+#
+# 4. Reverting a commit leaves it in history, so if a broken version is
+# released, the correct action is to make a new fixed version, not try to
+# fix the released version
+#
+# For reference: https://jira.opencord.org/browse/CORD-3117
+
+- job-template:
+ id: tag-check
+ name: "tag-check_{project}"
+ description: |
+ Created by {id} job-template from ci-management/jjb/templates/versioning.yaml
+ Checks for changes to version files, and that they don't duplicate tags
+ already in the git repo.
+
+ triggers:
+ - onf-infra-gerrit-trigger-patchset:
+ gerrit-server-name: '{gerrit-server-name}'
+ project-regexp: '^{project}$'
+ branch-regexp: '{branch-regexp}'
+ file-include-regexp: '{all-files-regexp}'
+ dependency-jobs: '{dependency-jobs}'
+
+ properties:
+ - onf-infra-properties:
+ build-days-to-keep: '{build-days-to-keep}'
+ artifact-num-to-keep: '{artifact-num-to-keep}'
+
+ wrappers:
+ - lf-infra-wrappers:
+ build-timeout: '{build-timeout}'
+ jenkins-ssh-credential: '{gerrit-ssh-credential}'
+
+ scm:
+ - lf-infra-gerrit-scm:
+ git-url: '$GIT_URL/$GERRIT_PROJECT'
+ refspec: '$GERRIT_REFSPEC'
+ branch: '$GERRIT_BRANCH'
+ submodule-recursive: 'false'
+ choosing-strategy: gerrit
+ jenkins-ssh-credential: '{gerrit-ssh-credential}'
+
+ node: '{build-node}'
+ project-type: freestyle
+ concurrent: true
+
+ builders:
+ - inject:
+ properties-content:
+ SEMVER_STRICT={semver-strict}
+ - shell: !include-raw-escape: ../shell/tag-check.sh
+
+
+- job-template:
+ id: version-tag
+ name: "version-tag_{project}"
+ description: |
+ Created by {id} job-template from ci-management/jjb/templates/versioning.yaml
+ When a patch is merged, check if it contains a SemVer released version
+ file and if so tags the commit in git with that same version.
+
+ triggers:
+ - onf-infra-gerrit-trigger-merge:
+ gerrit-server-name: '{gerrit-server-name}'
+ project-regexp: '^{project}$'
+ branch-regexp: '{branch-regexp}'
+ file-include-regexp: '{all-files-regexp}'
+ dependency-jobs: '{dependency-jobs}'
+
+ properties:
+ - onf-infra-properties:
+ build-days-to-keep: '{build-days-to-keep}'
+ artifact-num-to-keep: '{artifact-num-to-keep}'
+
+ wrappers:
+ - lf-infra-wrappers:
+ build-timeout: '{build-timeout}'
+ jenkins-ssh-credential: '{gerrit-ssh-credential}'
+
+ scm:
+ - lf-infra-gerrit-scm:
+ git-url: '$GIT_URL/$GERRIT_PROJECT'
+ refspec: '$GERRIT_REFSPEC'
+ branch: '$GERRIT_BRANCH'
+ submodule-recursive: 'false'
+ choosing-strategy: gerrit
+ jenkins-ssh-credential: '{gerrit-ssh-credential}'
+
+ node: '{build-node}'
+ project-type: freestyle
+ concurrent: true
+
+ builders:
+ - inject:
+ properties-content:
+ SEMVER_STRICT={semver-strict}
+ - shell: !include-raw-escape: ../shell/version-tag.sh
+