peridot/ci/utils.jsonnet

22 lines
837 B
Plaintext
Raw Permalink Normal View History

2022-07-07 20:11:50 +00:00
local stage = std.extVar('stage');
local ociRegistry = std.extVar('oci_registry');
local ociRegistryDocker = std.extVar('oci_registry_docker');
local localEnvironment = std.extVar('local_environment');
2022-10-31 02:23:40 +00:00
local origUser = std.extVar('user');
local domainUser = std.extVar('domain_user');
2022-07-07 20:11:50 +00:00
local localImage = if localEnvironment == "1" then true else false;
2022-10-31 02:23:40 +00:00
local helm_mode = std.extVar('helm_mode') == 'true';
local stage = if helm_mode then '-{{ template !"resf.stage!" . }}' else std.extVar('stage');
local user = if domainUser != 'user-orig' then domainUser else origUser;
local stage_no_dash = std.strReplace(stage, '-', '');
2022-07-07 20:11:50 +00:00
{
2022-10-31 02:23:40 +00:00
local_image: if helm_mode then false else localImage,
2022-07-07 20:11:50 +00:00
docker_hub_image(name): "%s/%s" % [ociRegistryDocker, name],
2022-10-31 02:23:40 +00:00
helm_mode: helm_mode,
stage: stage,
user: user,
stage_no_dash: stage_no_dash,
2022-07-07 20:11:50 +00:00
}