Skip to content

Commit

Permalink
docs: add Jenkins example with Groovy
Browse files Browse the repository at this point in the history
Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 committed Aug 10, 2024
1 parent 3369163 commit 59a49c3
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion docs/tutorials/jenkins.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ By specifying the git provider flags (i.e. `git-provider-type` and/or `git-serve

</details>

### Build a basic [Jenkins Job Builder](https://docs.openstack.org/infra/jenkins-job-builder/) job template for trestle-bot
## Build a basic [Jenkins Job Builder](https://docs.openstack.org/infra/jenkins-job-builder/) job template for trestle-bot

1. Install `jenkins-job-builder`: `pip install --user jenkins-job-builder`
2. [Configure](https://jenkins-job-builder.readthedocs.io/en/latest/execution.html) `jenkins-job-builder`
Expand Down Expand Up @@ -62,4 +62,29 @@ By specifying the git provider flags (i.e. `git-provider-type` and/or `git-serve
model: profile
```
## Example with Groovy
```groovy
pipeline {
agent {
docker {
image 'quay.io/continuouscompliance/trestle-bot:v0.10'
args "-v ${WORKSPACE}:/trestle-workspace -w /trestle-workspace --entrypoint=''"
reuseNode true
}
}
stages {
stage('Autosync') {
parameters {
string(name: 'MARKDOWN', defaultValue: 'md_profiles', description: 'Markdown path to use')
string(name: 'MODEL', defaultValue: 'profile', description: 'OSCAL model to author')
}
steps {
sh 'trestlebot-autosync --markdown-path=${params.MARKDOWN} --oscal-model=${params.MODEL} '
}
}
}
}
```


0 comments on commit 59a49c3

Please sign in to comment.