-
-
Save blakewrege/7368e94b2a9171e44c8c7bd56c9c6cec 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