The Issue is with the indentation of your yaml. ENVIRONMENT
is having different indent compared to CONFIG
, which is in next line.
You can use any online validators like http://www.yamllint.com or https://codebeautify.org/yaml-validator to validate your yaml files.
This is valid YAML:
appName: test
logLevel: WARN
TESTER:
ENVIRONMENT: staging
CONFIG:
DATABASE:
HOST: 2123.3123.2112.12
USERNAME: x
PASSWORD: y
DB: Q
CLASSIFIER:
IMG_WIDTH: 380
IMG_HEIGHT: 380
HOST: 0.0.0.0:3201
UPDATE:
If you want to use multiple configurations, then generally list of maps is used with a name attribute like below.
It is a good practice to give NAME attribute, even if there is only one config.
appName: test
logLevel: WARN
TESTER:
- NAME: staging
ENVIRONMENT: staging
CONFIG:
DATABASE:
HOST: 2123.3123.2112.12
USERNAME: x
PASSWORD: 'y'
DB: Q
CLASSIFIER:
IMG_WIDTH: 380
IMG_HEIGHT: 380
HOST: '0.0.0.0:3201'
- NAME: production
ENVIRONMENT: production
CONFIG:
DATABASE:
HOST: 2123.3123.2112.14
USERNAME: xP
PASSWORD: yP
DB: Q
CLASSIFIER:
IMG_WIDTH: 380
IMG_HEIGHT: 380
HOST: '0.0.0.0:3201'
In this YAML, he similarly uses two maps under deploy
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…