From 2c64a687b038bdfd06524beadbca9159d31ce189 Mon Sep 17 00:00:00 2001 From: Konstantin Kushnir Date: Sun, 8 Dec 2024 19:49:19 +0000 Subject: [PATCH] Add a new schema for Jenkins configuration --- CHANGELOG.md | 3 +- hrc/hrc/proto.hrc | 12 +- hrc/hrc/scripts/jenkinsfile.hrc | 585 ++++++++++++++++++++++++++++++++ 3 files changed, 598 insertions(+), 2 deletions(-) create mode 100644 hrc/hrc/scripts/jenkinsfile.hrc diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ec0b43..faee305 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,7 +36,7 @@ - Use the new shell-posix schema for shell scripts by default - [json] highlight JSON object keys - rename lib/default.hrc to lib/def.hrc -- move 'default' type implementation from proto.hrc to base/default.hrc +- move 'default' type implementation from proto.hrc to base/default.hrc ### Added - New package type of base - all packed. Hrc and hrd files in one archive. Directory 'auto' not in archive. @@ -74,6 +74,7 @@ - [hcl] add a new schema for HashiCorp HCL - [terraform] add a new schema for HashiCorp Terraform - [dockerfile] add a new schema for Dockerfile +- [jenkinsfile] add a new schema for Jenkins configuration (Jenkinsfile) ## [1.2.0] - 2021-09-12 diff --git a/hrc/hrc/proto.hrc b/hrc/hrc/proto.hrc index 5f81ef9..605b61c 100644 --- a/hrc/hrc/proto.hrc +++ b/hrc/hrc/proto.hrc @@ -223,7 +223,6 @@ /\.groovy$/i /\.gdsl$/i /\.gradle$/i - /Jenkinsfile/i /^import/ /^#!groovy/ @@ -232,6 +231,17 @@ + + + /^Jenkins[Ff]ile\..+$/ + /^.+\.Jenkins[Ff]ile/ + /^Jenkins[Ff]ile$/ + /\.gdsl$/i + /(^|\n)\s*pipeline\s+\{\s*$/ + /(^|\n)\s*node\s+\{\s*$/ + /(^|\n)\s*node\([^\)]\)\s+\{\s*$/ + /(^|\n)\s*import\s+org\.jenkinsci\./ + diff --git a/hrc/hrc/scripts/jenkinsfile.hrc b/hrc/hrc/scripts/jenkinsfile.hrc new file mode 100644 index 0000000..f2ddcd0 --- /dev/null +++ b/hrc/hrc/scripts/jenkinsfile.hrc @@ -0,0 +1,585 @@ + + + + + + + Jenkinsfile + + Notes: + It is not a comprehensive Jenkins goovy DSL syntax analyzer, + but it highlights the basic building blocks. Methods are divided + into 4 categories for easier navigation in Jenkinsfile: + - main methods + - configuration + - conditions + - others + + Links: + https://github.com/jakovistuk/script2/blob/master/src/main/resources/idea.gdsl + https://github.com/jaydubb12/jenkins-dsl-pipelines/blob/main/src/main/jenkins.gdsl + + Home: https://github.com/chpock/ck.colorer-schemes + Send requests there for bug fixes and features. + + + ]]> + + + + + /^Jenkins[Ff]ile\..+$/ + /^.+\.Jenkins[Ff]ile/ + /^Jenkins[Ff]ile$/ + /\.gdsl$/i + /(^|\n)\s*pipeline\s+\{\s*$/ + /(^|\n)\s*node\s+\{\s*$/ + /(^|\n)\s*node\([^\)]\)\s+\{\s*$/ + /(^|\n)\s*import\s+org\.jenkinsci\./ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +