( projectId: string, projectNumber: string, spec: DeploymentInstanceSpec, )
| 9 | * For example, 'my-project-id.appspot.com' becomes '${param:PROJECT_ID}.appspot.com` |
| 10 | */ |
| 11 | export function parameterizeProject( |
| 12 | projectId: string, |
| 13 | projectNumber: string, |
| 14 | spec: DeploymentInstanceSpec, |
| 15 | ): DeploymentInstanceSpec { |
| 16 | const newParams: Record<string, string> = {}; |
| 17 | for (const [key, val] of Object.entries(spec.params)) { |
| 18 | const p1 = val.replace(projectId, "${param:PROJECT_ID}"); |
| 19 | const p2 = p1.replace(projectNumber, "${param:PROJECT_NUMBER}"); |
| 20 | newParams[key] = p2; |
| 21 | } |
| 22 | const newSpec = { ...spec }; |
| 23 | newSpec.params = newParams; |
| 24 | return newSpec; |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * setSecretParamsToLatest searches spec.params for any secret paramsthat are active, and changes their version to latest. |
no outgoing calls
no test coverage detected
searching dependent graphs…