From f594fb5c7cda0c153e4a34c871cbed79d7a8f472 Mon Sep 17 00:00:00 2001
From: Khai Do <zaro0508@gmail.com>
Date: Wed, 28 May 2014 14:01:38 -0700
Subject: [PATCH] reference tests as examples

Remove samples and reference the tests as examples instead.

We don't need these samples for two reasons:
1. It is already duplicated in either JJB tests or documentation.
2. We don't test these samples so they may become outdated (some already have).

Change-Id: If1ba6cc8a675091e740fa254951bb8fcbcee6903
---
 samples/README.md           | 11 +++---
 samples/gerrit-trigger.yaml | 28 --------------
 samples/pipeline.yaml       | 73 -------------------------------------
 samples/release.yaml        | 28 --------------
 samples/sonar.yaml          | 13 -------
 5 files changed, 6 insertions(+), 147 deletions(-)
 delete mode 100644 samples/gerrit-trigger.yaml
 delete mode 100644 samples/pipeline.yaml
 delete mode 100644 samples/release.yaml
 delete mode 100644 samples/sonar.yaml

diff --git a/samples/README.md b/samples/README.md
index fce58a697..ac1bd18ce 100644
--- a/samples/README.md
+++ b/samples/README.md
@@ -1,8 +1,9 @@
 # Jenkins Job Builder Examples #
 
-These examples demonstrate the use of particular features of Jenkins
-Job Builder that can be used as starting points for new projects.
+Jenkins Job Builder includes many tests to demonstrate the use of Jenkins
+Job Builder.  All of the tests are in the 'tests' folder.  It can be used
+as a starting point for new projects.  The tests also serve as JJB docs.
 
-These examples are also used in the test framework - if you add a new
-example here, please ensure that it can be processed by Jenkins Job
-Builder.
+Please look in the tests folder for examples of how to define yaml files
+for use with JJB.  Most of the test examples are snippets of yaml, for a
+more complete example look at the tests in the 'tests/yamlparser' folder.
diff --git a/samples/gerrit-trigger.yaml b/samples/gerrit-trigger.yaml
deleted file mode 100644
index 1d1fd3375..000000000
--- a/samples/gerrit-trigger.yaml
+++ /dev/null
@@ -1,28 +0,0 @@
-- job:
-    name: test-gerrit-trigger
-    triggers:
-        - gerrit:
-            trigger-on-change-abandoned-event: true
-            trigger-on-change-merged-event: true
-            trigger-on-change-restored-event: true
-            trigger-on-comment-added-event: true
-            trigger-on-draft-published-event: true
-            trigger-on-patchset-uploaded-event: true
-            trigger-on-ref-updated-event: false
-            trigger-approval-category: CRVW
-            trigger-approval-value: 2
-            failure-message:
-            skip-vote:
-                successful: true
-                failed: false
-                # Missing outcome should default to false.
-                # unstable: false
-                notbuilt: true
-            projects:
-                - project-compare-type: 'PLAIN'
-                  project-pattern: 'myproject'
-                  branch-compare-type: 'PLAIN'
-                  branch-pattern: 'master'
-                  file-paths:
-                      - compare-type: ANT
-                        pattern: subdirectory/**
diff --git a/samples/pipeline.yaml b/samples/pipeline.yaml
deleted file mode 100644
index 8c4da3b43..000000000
--- a/samples/pipeline.yaml
+++ /dev/null
@@ -1,73 +0,0 @@
-# Sample YAML representation of a flexible pipeline for use with the
-# Jenkins Build Pipeline Plugin
-# (https://wiki.jenkins-ci.org/display/JENKINS/Build+Pipeline+Plugin)
-# The pipeline is defined at the project level, using job-specific variable
-# substitution to specify the next job in the pipeline ('pipeline-next') 
-# for each job.
-#
-# This example defines the skeleton of two deployment pipelines: one for
-# a 'base_os' subsystem to three chef servers, and the second to
-# a 'database' subsystem to two chef servers.
-# 
-# The pipeline uses an automatically-executed job in '{subsys}-prepare'
-# (using the Parameterized Trigger Plugin - 
-# https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin),
-# and manually-triggered jobs using the Pipeline publisher (e.g.
-# '{subsys}-initialise').
-#
-# Note how each project defines a different pipeline, with a different
-# length, but re-uses the same job templates.
-
-- project:
-    name: deploy_base_os
-    subsys: base_os
-    jobs:
-      - '{subsys}-prepare':
-          pipeline-next: '{subsys}-initialise'
-      - '{subsys}-initialise':
-          pipeline-next: '{subsys}-upload-chef-server1'
-      - '{subsys}-upload-chef-server1':
-          pipeline-next: '{subsys}-upload-chef-server2'
-      - '{subsys}-upload-chef-server2':
-          pipeline-next: '{subsys}-upload-chef-server3'
-      - '{subsys}-upload-chef-server3':
-          pipeline-next: ''
-
-- project:
-    name: deploy_database
-    subsys: db
-    jobs:
-      - '{subsys}-prepare':
-          pipeline-next: '{subsys}-initialise'
-      - '{subsys}-initialise':
-          pipeline-next: '{subsys}-upload-chef-server1'
-      - '{subsys}-upload-chef-server1':
-          pipeline-next: '{subsys}-upload-chef-server2'
-      - '{subsys}-upload-chef-server2':
-          pipeline-next: ''
-
-- job-template:
-    name: '{subsys}-prepare'
-    builders:
-      - trigger-builds:
-          - project: '{pipeline-next}'
-
-- job-template:
-    name: '{subsys}-initialise'
-    publishers:
-      - pipeline: '{pipeline-next}'
-        
-- job-template:
-    name: '{subsys}-upload-chef-server1'
-    publishers:
-      - pipeline: '{pipeline-next}'
-
-- job-template:
-    name: '{subsys}-upload-chef-server2'
-    publishers:
-      - pipeline: '{pipeline-next}'
-
-- job-template:
-    name: '{subsys}-upload-chef-server3'
-    publishers:
-      - pipeline: '{pipeline-next}'
diff --git a/samples/release.yaml b/samples/release.yaml
deleted file mode 100644
index 416bb0438..000000000
--- a/samples/release.yaml
+++ /dev/null
@@ -1,28 +0,0 @@
-- job:
-    name: 'test-release'
-    wrappers:
-      - release:
-          keep-forever: false
-          override-build-parameters: true
-          version-template: '${RELEASE_VERSION}'
-          parameters:
-            - string:
-                name: RELEASE_BRANCH
-                default: ''
-                description: 'The release branch to build'
-          pre-build:
-            - shell: |
-                #!/bin/bash
-                echo "echo pre-build builder"
-          post-build:
-            - shell: |
-                #!/bin/bash
-                echo "echo post-build builder"
-          post-success:
-            - shell: |
-                #!/bin/bash
-                echo "echo post-success builder"
-          post-fail:
-            - shell: |
-                #!/bin/bash
-                echo "echo post-fail builder"
diff --git a/samples/sonar.yaml b/samples/sonar.yaml
deleted file mode 100644
index 8cb675bbd..000000000
--- a/samples/sonar.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-- job:
-    name: test-sonar
-    publishers:
-        - sonar:
-            jdk: MyJdk
-            branch: myBranch
-            language: java
-            maven-opts: -DskipTests
-            additional-properties: -DsonarHostURL=http://example.com/
-            skip-global-triggers:
-                skip-when-scm-change: true
-                skip-when-upstream-build: true
-                skip-when-envvar-defined: SKIP_SONAR