-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from SublimeText/drone_ci
[Drone CI] initial support for Drone CI
- Loading branch information
Showing
3 changed files
with
123 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
%YAML 1.2 | ||
--- | ||
# https://docs.drone.io/quickstart/docker/ | ||
scope: source.yaml.pipeline.drone | ||
version: 2 | ||
|
||
extends: Packages/YamlPipelines/YamlPipeline.sublime-syntax | ||
|
||
file_extensions: | ||
- .drone.yml | ||
|
||
variables: | ||
global_keywords: |- | ||
(?x)\b(?: | ||
services | ||
| steps | ||
| trigger | ||
)\b | ||
contexts: | ||
node: | ||
- meta_prepend: true | ||
- match: ^(\s+)(commands)\s*(:)(?=\s|$) | ||
captures: | ||
2: string.unquoted.plain.out.yaml keyword.control.flow.script.pipeline | ||
3: punctuation.separator.key-value.yaml | ||
push: script-block-sequence | ||
- match: ^({{global_keywords}})\s*(:)$ | ||
captures: | ||
1: meta.mapping.key.yaml meta.string.yaml string.unquoted.plain.out.yaml | ||
2: meta.mapping.yaml punctuation.separator.key-value.mapping.yaml | ||
- match: ^(?=[\.\w])([-.\w ]+)\s*(:)$ | ||
captures: | ||
1: entity.name.label.gitlab | ||
2: punctuation.separator.key-value.yaml | ||
|
||
script-block-sequence: | ||
- match: (-)[ \t]+(?=\S) | ||
captures: | ||
1: punctuation.definition.block.sequence.item.yaml | ||
push: script-block-node | ||
- match: ^(?!\1\s*-) | ||
pop: 1 | ||
|
||
script-block-node: | ||
- meta_prepend: true | ||
- include: flow-alias | ||
- match: '{{_flow_scalar_end_plain_out}}' | ||
pop: 1 | ||
|
||
embedded-bash: | ||
- meta_include_prototype: false | ||
- meta_scope: source.shell.bash.embedded | ||
- include: scope:source.shell.bash | ||
|
||
embedded-bash-folded: | ||
- meta_include_prototype: false | ||
- meta_scope: source.shell.bash.embedded | ||
- include: scope:source.shell.bash.folded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Yaml Pipelines for Sublime Text | ||
|
||
Syntax highlighting definitions for YAML pipeline files, like GitHub Actions and AzureDevops. | ||
Syntax highlighting definitions for YAML pipeline files, like GitHub Actions and AzureDevops, Drone CI, GitLab CICD etc. | ||
Includes a small plugin to automatically apply the GitHub Actions filetype when loading or saving a YAML file in a `.github/workflows` folder. | ||
|
||
Why not just use the default YAML syntax definition? Because it doesn't highlight conditions, variables or embedded Bash or PowerShell scripts! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# SYNTAX TEST "Packages/YamlPipelines/Drone CI.sublime-syntax" | ||
kind: pipeline | ||
type: docker | ||
name: en | ||
|
||
steps: | ||
# ^ meta.mapping.key meta.string string.unquoted.plain.out | ||
- name: greeting | ||
image: alpine | ||
commands: | ||
# ^^^^^^^^ string.unquoted.plain.out keyword.control.flow.script | ||
# ^ punctuation.separator.key-value | ||
- echo hello world | ||
# ^ meta.block.script punctuation.definition.block.sequence.item | ||
# ^^^^^^^^^^^^^^^^ source.shell.bash | ||
# ^^^^ support.function.echo | ||
|
||
# <- - source.shell | ||
trigger: | ||
event: | ||
- push | ||
|
||
--- | ||
kind: pipeline | ||
type: docker | ||
name: fr | ||
|
||
steps: | ||
- name: greeting | ||
image: alpine | ||
commands: | ||
- echo bonjour monde | ||
|
||
trigger: | ||
event: | ||
- pull_request | ||
|
||
--- | ||
# <- entity.other.document.begin | ||
kind: pipeline | ||
type: docker | ||
name: default | ||
|
||
steps: | ||
- name: test | ||
image: golang:1.13 | ||
# TODO: scope this like the Containerfile syntax does | ||
commands: | ||
- go build | ||
# ^ meta.block.script punctuation.definition.block.sequence.item | ||
# ^^^^^^^^ source.shell.bash | ||
- go test -v | ||
# ^ meta.block.script punctuation.definition.block.sequence.item - source.shell | ||
# ^^ source.shell.bash meta.function-call.identifier variable.function | ||
|
||
- name: notify | ||
# <- punctuation.definition.block.sequence.item - meta.block.script | ||
image: plugins/slack | ||
settings: | ||
channel: dev | ||
webhook: | ||
from_secret: endpoint |