feat: added Groovy (and Jenkinsfile) syntax

This commit is contained in:
Jimmy C. Kromann 2024-02-16 11:53:55 +01:00 committed by GitHub
parent f33905bf5a
commit 32bbb2136c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 114 additions and 0 deletions

View file

@ -36,6 +36,7 @@ Note: if you need support for Neovim 0.6.x please use the tag `compat/0.6`.
- [x] `glimmer`
- [x] `go`
- [x] `graphql`
- [x] `groovy`
- [x] `haskell`
- [x] `html_tags`
- [x] `ini`

View file

@ -0,0 +1,6 @@
(juxt_function_call) @context
([
(function_call)
(closure)
] @context)

107
test/test.groovy Normal file
View file

@ -0,0 +1,107 @@
pipeline {
agent {
label "docker"
}
options {
ansiColor('xterm')
timeout(time: 60, unit: 'MINUTES')
timestamps()
}
environment {
// Kubernetes deploy (default)
KUBERNETES_CONFIG = 'kube.yaml'
KUBERNETES_ENV="test"
KUBERNETES_NAMESPACE="namspace-test"
// Docker
HOME = "$WORKSPACE"
DOCKER_WORKSPACE = "/workdir"
GIT_COMMIT = sh(
script: "printf \$(git rev-parse --short HEAD)",
returnStdout: true
)
GIT_BRANCH = sh(
script: "printf \$(git rev-parse --abbrev-ref HEAD)",
returnStdout: true
)
GIT_TAG = sh(
script: "git tag --points-at ${env.GIT_COMMIT}",
returnStdout: true
// ...
)?.trim()
TAG_NAME = "${GIT_TAG}"
// ....
}
stages {
stage ('Checkout') {
steps {
checkout scm
sh 'git rev-parse --abbrev-ref HEAD'
sh 'git rev-parse --short HEAD'
sh 'echo ${GIT_COMMIT}'
sh 'echo ${GIT_BRANCH}'
stash name: "source"
script {
env.VERSION = env.TAG_NAME // will be NULL when empty
sh "echo 'Found version ${env.VERSION}'"
// ...
} // script
// ...
} // steps
} // Checkout
} // stages
} // pipeline