Skip to content

Commit 7ef1f3c

Browse files
Merge pull request #11 from amido/feature/yamllint-pipeline
2 parents 2d37ba9 + 4d88cd0 commit 7ef1f3c

File tree

3 files changed

+56
-2
lines changed

3 files changed

+56
-2
lines changed

build/azDevops/azure/azure-pipelines-javaspring-k8s.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# ==> `$company$project$stage$componenet` #
99

1010
#############################################################################################################################
11-
name: "$(build.sourcebranchname)-init"
11+
name: "$(Build.SourceBranchName)-init"
1212

1313
pr:
1414
- master
@@ -77,7 +77,7 @@ variables:
7777
# Versioning
7878
version_major: 0
7979
version_minor: 0
80-
version_revision: $[counter(variables['version_minor'], 0)]
80+
version_revision: "$[counter(join(variables['version_major'], join('-', variables['version_minor'])), 0)]"
8181
# Docker Config
8282
docker_dockerfile_path: "."
8383
docker_image_name: $(self_generic_name)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: "$(Build.SourceBranchName)-init"
2+
3+
variables:
4+
yaml_lint_version: '1.23.0'
5+
python_wheel_version: '0.34.2'
6+
version_major: 0
7+
version_minor: 0
8+
version_revision: "$[counter(join(variables['version_major'], join('-', variables['version_minor'])), 0)]"
9+
10+
trigger:
11+
branches:
12+
include:
13+
- '*'
14+
paths:
15+
include:
16+
- '*'
17+
18+
pr:
19+
branches:
20+
include:
21+
- '*'
22+
paths:
23+
include:
24+
- '*'
25+
26+
jobs:
27+
- job: ValidateYamlFiles
28+
displayName: 'Validate YAML Files'
29+
condition: succeeded()
30+
pool:
31+
vmImage: 'ubuntu-18.04'
32+
steps:
33+
- bash: |
34+
sudo apt-get install python3-setuptools
35+
pip3 install -I 'wheel==${{ variables.python_yamllint_version }}'
36+
pip3 install -I 'yamllint==${{ variables.yaml_lint_version }}'
37+
displayName: 'Install `yamllint`'
38+
- bash: |
39+
python3 -m yamllint -c ./yamllint.conf . ./yamllint.conf
40+
displayName: 'Validates YAML files in the repo'

yamllint.conf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
extends: default
2+
3+
yaml-files:
4+
- 'files/*.yml'
5+
- 'files/*.yaml'
6+
7+
rules:
8+
document-start: disable
9+
line-length: disable
10+
truthy: disable
11+
indentation:
12+
spaces: 2
13+
indent-sequences: true
14+
check-multi-line-strings: false

0 commit comments

Comments
 (0)