Skip to content

Commit f4d28ef

Browse files
committed
Added yamllint shell script
1 parent 8c81f95 commit f4d28ef

File tree

6 files changed

+27
-19
lines changed

6 files changed

+27
-19
lines changed

.yamllint.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ extends: default
33

44
# For all rules
55
ignore: |
6-
.github/workflows/
76
node_modules/
87
examples/docker-compose-nodejs/node_modules/
8+
examples/docker-swarm-php/vendor/
9+
MergeRequest-Pipelines.gitlab-ci.yml
10+
PHP.gitlab-ci.yml
11+
/.github/workflows/build.yml
912
1013
rules:
1114
line-length: { max: 160 }
12-
comments: disable
1315
braces: { min-spaces-inside: 1, max-spaces-inside: 1 }
14-
brackets: { min-spaces-inside: 0, max-spaces-inside: 0 }

examples/docker-swarm-php/.gitlab-ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
composer-install:
44
stage: .pre
55
image: composer
6-
needs: [ ]
6+
needs: []
77
artifacts:
8-
paths: [ vendor/ ]
8+
paths: [vendor/]
99
script:
1010
- composer install --no-progress
1111

1212
# @Description Build/Push PHP image
1313
build-php:
14-
needs: [ composer-install ]
14+
needs: [composer-install]
1515
stage: build
1616
artifacts:
17-
paths: [ .env-build-php ]
17+
paths: [.env-build-php]
1818
script:
1919
- IMAGE_NAME=fake/php
2020
- IMAGE_PIPELINE_URL=${IMAGE_NAME}:${CI_PIPELINE_IID}
@@ -39,7 +39,7 @@ build-php:
3939
php-cs-fixer-dry-run:
4040
stage: test
4141
image: php
42-
needs: [ composer-install ]
42+
needs: [composer-install]
4343
rules:
4444
- { if: $GITLAB_CI == 'false', allow_failure: true, when: on_success }
4545
- { if: $GITLAB_CI == 'true', allow_failure: false, when: on_success }
@@ -49,15 +49,15 @@ php-cs-fixer-dry-run:
4949
# @Description Find outdated PHP packages
5050
composer-outdated:
5151
stage: test
52-
needs: [ composer-install ]
52+
needs: [composer-install]
5353
allow_failure: true
5454
script:
5555
- composer outdated --strict --direct
5656
- echo "PHP packages are up to date"
5757

5858
# @Description Deploy a docker swarm stack
5959
deploy:
60-
dependencies: [ build-php ]
60+
dependencies: [build-php]
6161
stage: deploy
6262
script:
6363
- export $(grep -vh '^#' .env* | xargs)
@@ -71,6 +71,6 @@ remove-stack:
7171
stage: .post
7272
rules:
7373
- { if: $GITLAB_CI == 'false', allow_failure: true, when: manual }
74-
- { if: $GITLAB_CI == 'true', when: never }
74+
- { if: $GITLAB_CI == 'true', when: never }
7575
script:
7676
- docker stack rm php-project

examples/docker-swarm-php/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ services:
66
image: ${BUILD_PHP_IMAGE_URL}
77
ports:
88
- 8892:80
9-
deploy: # Deploy without downtime.
9+
deploy:
1010
update_config:
11+
# Deploy without downtime.
1112
order: start-first

tests/test-cases/artifacts/.gitlab-ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ test-deep-dir:
4444
- echo "Test dir" > dir/deep/log.txt
4545

4646
# TODO: Readd this, when we come up with a good way
47-
#test-artifact-not-found:
48-
# image: debian
49-
# artifacts:
50-
# paths:
51-
# - dir
52-
# script:
53-
# - echo "Don't generate"
47+
# test-artifact-not-found:
48+
# image: debian
49+
# artifacts:
50+
# paths:
51+
# - dir
52+
# script:
53+
# - echo "Don't generate"

tests/test-cases/include-template/.gitlab-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
include:
23
- template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml'
34

yamllint

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
docker run -t -v /$PWD/:/app/ -w /app/ sdesbure/yamllint yamllint .

0 commit comments

Comments
 (0)