Skip to content

Commit

Permalink
feat: added Groovy (and Jenkinsfile) syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
charnley committed Feb 16, 2024
1 parent f33905b commit 32bbb21
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
6 changes: 6 additions & 0 deletions queries/groovy/context.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(juxt_function_call) @context

([
(function_call)
(closure)
] @context)
107 changes: 107 additions & 0 deletions test/test.groovy
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 32bbb21

Please sign in to comment.