Skip to content

Instantly share code, notes, and snippets.

@bitwiseman
Last active October 9, 2019 17:29
Show Gist options
  • Save bitwiseman/167b46621fd6ac6316e39a6b54c16fb3 to your computer and use it in GitHub Desktop.
Save bitwiseman/167b46621fd6ac6316e39a6b54c16fb3 to your computer and use it in GitHub Desktop.
pipeline {
agent none
stages {
stage("BuildAndTest") {
matrix {
agent {
label "${os}"
}
when {
and {
branch 'linux'
not { environment name: 'os', value: 'linux'}
}
}
axes {
axis {
name 'os'
values "linux", "windows", "mac"
}
axis {
name 'browser'
values "firefox", "chrome", "safari", "ie"
}
}
excludes {
exclude {
axis {
name 'os'
values 'linux'
}
axis {
name 'browser'
values 'safari'
}
}
exclude {
axis {
name 'os'
notValues 'windows'
}
axis {
name 'browser'
values "ie"
}
}
}
stages {
stage("first") {
steps {
echo "First branch"
echo "OS=$os"
echo "BROWSER=$browser"
}
}
stage("second") {
steps {
echo "Second branch"
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment