Skip to content

Instantly share code, notes, and snippets.

@harsimranmaan
Created July 24, 2020 18:11
Show Gist options
  • Save harsimranmaan/816ec9f33a5bc573089e3ecb8ffb8cc5 to your computer and use it in GitHub Desktop.
Save harsimranmaan/816ec9f33a5bc573089e3ecb8ffb8cc5 to your computer and use it in GitHub Desktop.
Environment mapping in params.libsonnet
// this file returns the params for the current qbec environment
// you need to add an entry here every time you add a new environment.
local env = std.extVar('qbec.io/env');
local paramsMap = {
_: import './environments/base.libsonnet',
default: import './environments/default.libsonnet',
};
if std.objectHas(paramsMap, env) then paramsMap[env] else error 'environment ' + env + ' not defined in ' + std.thisFile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment