(flagContext *AppParams)
| 120 | } |
| 121 | |
| 122 | func (app *AppParams) Merge(flagContext *AppParams) { |
| 123 | if flagContext.BuildpackURL != nil { |
| 124 | app.BuildpackURL = flagContext.BuildpackURL |
| 125 | } |
| 126 | if flagContext.Command != nil { |
| 127 | app.Command = flagContext.Command |
| 128 | } |
| 129 | if flagContext.DiskQuota != nil { |
| 130 | app.DiskQuota = flagContext.DiskQuota |
| 131 | } |
| 132 | if flagContext.DockerImage != nil { |
| 133 | app.DockerImage = flagContext.DockerImage |
| 134 | } |
| 135 | |
| 136 | switch { |
| 137 | case flagContext.DockerUsername != nil: |
| 138 | app.DockerUsername = flagContext.DockerUsername |
| 139 | // the password is always non-nil after we parse the flag context |
| 140 | app.DockerPassword = flagContext.DockerPassword |
| 141 | case app.DockerUsername != nil: |
| 142 | password := os.Getenv("CF_DOCKER_PASSWORD") |
| 143 | // if the password is empty, we will get a CC error |
| 144 | app.DockerPassword = &password |
| 145 | } |
| 146 | |
| 147 | if flagContext.Domains != nil { |
| 148 | app.Domains = flagContext.Domains |
| 149 | } |
| 150 | if flagContext.EnableSSH != nil { |
| 151 | app.EnableSSH = flagContext.EnableSSH |
| 152 | } |
| 153 | if flagContext.EnvironmentVars != nil { |
| 154 | app.EnvironmentVars = flagContext.EnvironmentVars |
| 155 | } |
| 156 | if flagContext.GUID != nil { |
| 157 | app.GUID = flagContext.GUID |
| 158 | } |
| 159 | if flagContext.HealthCheckType != nil { |
| 160 | app.HealthCheckType = flagContext.HealthCheckType |
| 161 | } |
| 162 | if flagContext.HealthCheckHTTPEndpoint != nil { |
| 163 | app.HealthCheckHTTPEndpoint = flagContext.HealthCheckHTTPEndpoint |
| 164 | } |
| 165 | if flagContext.HealthCheckTimeout != nil { |
| 166 | app.HealthCheckTimeout = flagContext.HealthCheckTimeout |
| 167 | } |
| 168 | if flagContext.Hosts != nil { |
| 169 | app.Hosts = flagContext.Hosts |
| 170 | } |
| 171 | if flagContext.InstanceCount != nil { |
| 172 | app.InstanceCount = flagContext.InstanceCount |
| 173 | } |
| 174 | if flagContext.Memory != nil { |
| 175 | app.Memory = flagContext.Memory |
| 176 | } |
| 177 | if flagContext.Name != nil { |
| 178 | app.Name = flagContext.Name |
| 179 | } |
no test coverage detected