1import * as _ from 'lodash-es' 8export const runtimeOnlyDockerEnvKeys = ['PT_DEPLOY_NAME', 'PT_DEPLOY_HOSTNAME'] 9// FYI: these vary per deploy target; omitting from nextbuild dockerEnv keeps image tags 10// identical across deploys of the same commit (avoiding redundant kaniko rebuilds) 12export const getDefaultEnv = () => { 13 const {git_sha, prebuildEnvConfH={}, defaultSsTz, publicJsonH={}, name, wcHostname, nonWcHostname} = getAppCfg() 15 const isDev = getIsDevAction({action}) 17 Object.assign(publicJsonH, {isDev}) 19 let retH: Record<string, string | undefined> = { 20 NEXT_PUBLIC_GIT_SHA: git_sha, 21 NEXT_PUBLIC_JSON: JSON.stringify({ 24 PREBUILD_ENVJSON: JSON.stringify(prebuildEnvConfH), 26 PT_DEPLOY_HOSTNAME: nonWcHostname || wcHostname, 30 NEXT_PUBLIC_DEFAULTTZ: defaultSsTz, 33 return _.omitBy(retH, _.isUndefined) as Record<string, string> 36export const getIsDevAction = ({action}: {action?: string} = {}): boolean => { 37 // true -> dev action below, false -> actually deploying 38 if (isRunningDevCtx.getStore()) return true 43 'setenv', 'setprocenv',