Skip to content

Commit

Permalink
Update readme Jenkinsfile example
Browse files Browse the repository at this point in the history
  • Loading branch information
sthaha authored Oct 2, 2018
1 parent d662730 commit d8b4a60
Showing 1 changed file with 12 additions and 20 deletions.
32 changes: 12 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,34 @@ This git repository contains functions that are used in `Jenkinsfile` to do Cont
The following example builds a nodejs booster and deploys it to a `stage` enviroment and then on approval to the `run` environment.

```groovy
#!/usr/bin/groovy
@Library('github.com/fabric8io/osio-pipeline@master')_
@Library('github.com/fabric8io/osio-pipeline@master') _
osio {
config runtime: 'node'
ci {
def app = processTemplate(params: [
release_version: "1.0.${env.BUILD_NUMBER}"
// runs oc process
def resources = processTemplate(params: [
RELEASE_VERSION: "1.0.${env.BUILD_NUMBER}-PR" // indicate pull request
])
build resources: app, commands: """
npm version
oc version
"""
// performs an s2i build
build resources: resources
}
cd {
def resources = processTemplate(params: [
release_version: "1.0.${env.BUILD_NUMBER}"
RELEASE_VERSION: "1.0.${env.BUILD_NUMBER}"
])
build resources: resources, commands: """
npm version
oc version
"""
build resources: resources
deploy resources: resources, env: 'stage'
// wait for user to approve the promotion to "run" environment
deploy resources: resources, env: 'run', approval: 'manual'
}
}
```
Expand All @@ -51,10 +44,9 @@ osio {
To use the functions in this library just add the following to the top of your `Jenkinsfile`:

```groovy
#!/usr/bin/groovy
@Library('github.com/fabric8io/osio-pipeline@master') _
```
That will use the master branch of this repository.
That will use the master branch (bleeding edge) of this repository.

## API

Expand Down

0 comments on commit d8b4a60

Please sign in to comment.