Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions examples/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@ func TestExampleObjectSchemas(t *testing.T) {
"application-template-custombuild": &templateapi.Template{},
},
"../examples/jenkins": {
"jenkins-config": &configapi.Config{},
"docker-registry-config": &configapi.Config{},
"application-template": &templateapi.Template{},
"jenkins-config": &configapi.Config{},
"application-template": &templateapi.Template{},
},
"../examples/image-repositories": {
"image-repositories": &imageapi.ImageRepositoryList{},
Expand Down
38 changes: 13 additions & 25 deletions examples/jenkins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,39 @@ the deployment works, and then tag the test version into production.
Steps
-----

1. Start OpenShift

$ sudo openshift start &> logs/openshift.log &

2. Start the docker registry services

$ osc create -f docker-registry-config.json
1. Follow steps 1-10 from the [sample-app](https://github.com/openshift/origin/blob/master/examples/sample-app/README.md)

3. Start the Jenkins services
2. Start the Jenkins services

$ osc create -f jenkins-config.json

4. Determine the IP address of the docker-registry service:

$ osc get services docker-registry -o template --template="{{ .portalIP }}"
$ osc create -n test -f jenkins-config.json

5. Edit the application-template.json file by replacing all occurences of `172.30.17.3` with the IP address from the previous step.

5. Create the application configuration
3. Create the application configuration

$ osc process -f application-template.json | osc create -f -
$ osc process -n test -f application-template.json | osc create -n test -f -

6. Locate the Jenkins service endpoint and go to it in your browser:
4. Locate the Jenkins service endpoint and go to it in your browser:

$ osc get services | grep jenkins | awk '{print $4":"$5}'
$ osc get services -n test | grep jenkins | awk '{print $4":"$5}'

Once it is available, proceed to the next step.

7. Create the Jenkins job named rubyJob:
5. Create the Jenkins job named rubyJob:

$ JENKINS_ENDPOINT=`osc get services | grep jenkins | awk '{print $4":"$5}'`
$ JENKINS_ENDPOINT=`osc get services -n test | grep jenkins | awk '{print $4":"$5}'`
$ cat job.xml | curl -X POST -H "Content-Type: application/xml" -H "Expect: " --data-binary @- http://$JENKINS_ENDPOINT/createItem?name=rubyJob

8. Run the Jenkins build
6. Run the Jenkins build

Go back to your browser, refresh and select the rubyJob build job and choose `Build with parameters`.
You should not need to modify the `OPENSHIFT_HOST`.

9. Watch the job output
7. Watch the job output

It will trigger an OpenShift build of the application, wait for the build to result in a deployment,
confirm the new deployment works, and re-tag the image for production. This re-tagging will trigger
another deployment, this time creating/updated the production service.

10. Confirm both the test and production services are available by browsing to both services:
8. Confirm both the test and production services are available by browsing to both services:

$ osc get services | grep frontend
$ osc get services -n test | grep frontend

Loading