Created
October 1, 2018 01:36
-
-
Save gkumarau/3346332f745a3b6cedd4ddc834e468ac to your computer and use it in GitHub Desktop.
This file demonstrates the use of variables and loops for object and arrays in the JSON configuration using Jsonnet.
This file contains hidden or 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
local environments = [ 'prod', 'test', 'dev' ]; | |
local services = [ 'service1', 'service2', 'service3', 'service4' ]; | |
{ | |
environments: [ | |
{ | |
name: env, | |
services: [ | |
'https://%s.%s.example.com' % [service, env] | |
for service in services | |
] | |
} | |
for env in environments | |
], | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment