Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Exploring syntax for more root verbs in Otto (.groovy just for syntax highlighting)
use stdlib
environment {
}
pipeline {
// Parallel will build all sub-stages concurrently without stopping if one
// fails. Any of the stages failing will halt the pipeline after the parallel
// however
parallel {
stage {
name = 'Build Linux/amd64'
steps {
}
}
stage {
name = 'Build Linux/aarch64'
steps {
}
}
stage {
name = 'Build Windows/amd64'
steps {
}
}
}
stage {
name = 'Staging deploy'
steps {
}
}
// Fan out will terminate sub-stages if any one fails
fanout {
stage {
name = 'API testing'
steps {
}
}
stage {
name = 'Load testing'
steps { }
}
}
// Force a UI or other pause in the pipeline state machine
confirm {
message = 'Safe to deploy production?'
}
stage {
name = 'Production deploy'
steps { }
}
rollback {
// Not sure what the right predicate matching here
on = 'some-event-name'
threshold = 10
steps {
sh 'foo'
}
}
}
use stdlib
pipeline {
// For simple cases, perhaps no need for a stage
steps {
git url: 'https://github.com/rtyler/otto', branch: 'main'
sh 'make build test'
archive 'target/release/otto-*'
}
stage {
name = 'Deploy'
steps {
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.