Block-style YAML vs Flow-style YAML

Photo by Markus Spiske on Unsplash
default:
image: nginx
before_script:
- echo "hello"
- echo "world"
stages:
- test
.env_vars:
variables:
ENV: $CI_ENVIRONMENT_NAME
.test:
stage: test
when: always
allow_failure: false
artifacts:
paths:
- envs/${ENV}/builds
- envs/${ENV}/caches
expire_in: 30 minutes
script: ./scripts/run_test.sh
dev_test:
environment: { name: dev }
extends: [ .env_vars, .test ]
dev_test:
environment:
name: dev
extends:
- .env_vars
- .test

I avoid flow style in most cases, the only case I want to use flow style is when the data is simple enough so it could be wrote in one line.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Syed Rakib Al Hasan

DevOps Engineer, Backend Developer, Cloud Architect, Night time drive-outs & nice hangouts