Skip to content

Instantly share code, notes, and snippets.

@Alien2150
Created September 8, 2016 11:49
Show Gist options
  • Save Alien2150/4b300102fae862e86fce08281c7f6b38 to your computer and use it in GitHub Desktop.
Save Alien2150/4b300102fae862e86fce08281c7f6b38 to your computer and use it in GitHub Desktop.
node("linux") {
sh 'printenv'
gitlabBuilds(builds: ["build", "test"]) {
/// See: https://jenkins.io/doc/pipeline/steps/gitlab-plugin/
stage("Build") {
echo "Action type: ${env.gitlabActionType}"
if (env.gitlabActionType == "NOTE") {
echo "Someone made a comment on a merge-request"
}
echo "Will run the test on this commit ${env.gitlabMergeRequestLastCommit}"
echo "Might be a merge-request ${env.gitlabSourceBranch} into ${env.gitlabTargetBranch}"
gitlabCommitStatus("build") {
sh 'sbt compile'
}
}
stage("test") {
echo "I am testing the application"
gitlabCommitStatus("test") {
sh 'sbt test'
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment