Browse code

really re-enable jenkins autoprovisioning

Ben Parees authored on 2016/10/25 05:42:57
Showing 3 changed files
... ...
@@ -29,19 +29,7 @@ jenkins template represented by jenkinstemplate.json by running these commands a
29 29
 
30 30
         $ oc new-project pipelineproject
31 31
 
32
-4. Run this command to instantiate a Jenkins server and service account in your project:
33
-
34
-    If your have persistent volumes available in your cluster:
35
-
36
-        $ oc new-app jenkins-persistent
37
-
38
-    Otherwise:
39
-
40
-        $ oc new-app jenkins-ephemeral
41
-
42
-    Note: eventually the instantiation of the Jenkins server and service account will be done automatically when you create a pipeline buildconfig.
43
-
44
-5. Run this command to instantiate the template which will create a pipeline buildconfig and some other resources in your project:
32
+4. Run this command to instantiate the template which will create a pipeline buildconfig and some other resources in your project:
45 33
 
46 34
     If you used cluster up:
47 35
     
... ...
@@ -53,7 +41,7 @@ jenkins template represented by jenkinstemplate.json by running these commands a
53 53
 
54 54
     At this point if you run `oc get pods` you should see a jenkins pod, or at least a jenkins-deploy pod. (along with other items in your project)  This pod was created as a result of the new pipeline buildconfig being defined by the sample-pipeline template.
55 55
 
56
-6. View/Manage Jenkins (optional)
56
+5. View/Manage Jenkins (optional)
57 57
 
58 58
     You should not need to access the jenkins console for anything, but if you want to configure settings or watch the execution,
59 59
     here are the steps to do so:
... ...
@@ -68,7 +56,9 @@ jenkins template represented by jenkinstemplate.json by running these commands a
68 68
     If you take this approach, run the following command before attempting to log into Jenkins:
69 69
 
70 70
         $ oc annotate sa/jenkins serviceaccounts.openshift.io/oauth-redirecturi.1=http://<jenkins_service_ip:jenkins_service_port>/securityRealm/finishLogin --overwrite
71
- 
71
+    
72
+    Only include the port in the uri if it is not port 80.
73
+
72 74
     Login with the user name used to create the "pipelineproject" and any non-empty password.
73 75
 
74 76
 6. Launch a new build
... ...
@@ -42,7 +42,7 @@ func addDefaultingFuncs(scheme *runtime.Scheme) error {
42 42
 				obj.JenkinsPipelineConfig.ServiceName = "jenkins"
43 43
 			}
44 44
 			if obj.JenkinsPipelineConfig.AutoProvisionEnabled == nil {
45
-				v := false
45
+				v := true
46 46
 				obj.JenkinsPipelineConfig.AutoProvisionEnabled = &v
47 47
 			}
48 48
 
... ...
@@ -178,11 +178,17 @@ func setupBuildStrategyTest(t *testing.T, includeControllers bool) (clusterAdmin
178 178
 		t.Fatalf(err.Error())
179 179
 	}
180 180
 
181
-	template, err := testutil.GetTemplateFixture("../../examples/jenkins/jenkins-ephemeral-template.json")
181
+	// we need a template that doesn't create service accounts or rolebindings so editors can create
182
+	// pipeline buildconfig's successfully, so we're not using the standard jenkins template.
183
+	// but we do need a template that creates a service named jenkins.
184
+	template, err := testutil.GetTemplateFixture("../../examples/jenkins/master-slave/jenkins-master-template.json")
182 185
 	if err != nil {
183 186
 		t.Fatalf("unexpected error: %v", err)
184 187
 	}
185
-	template.Name = "jenkins"
188
+
189
+	// pipeline defaults expect to find a template named jenkins-ephemeral
190
+	// in the openshift namespace.
191
+	template.Name = "jenkins-ephemeral"
186 192
 	template.Namespace = "openshift"
187 193
 
188 194
 	_, err = clusterAdminClient.Templates("openshift").Create(template)