setGitProjectValues randomly sets attributes for a Git project
(gitProject *schema.GitProjectSource)
| 194 | |
| 195 | // setGitProjectValues randomly sets attributes for a Git project |
| 196 | func setGitProjectValues(gitProject *schema.GitProjectSource) { |
| 197 | |
| 198 | if len(gitProject.Remotes) > 1 { |
| 199 | numKey := GetRandomNumber(1, len(gitProject.Remotes)) |
| 200 | for key, _ := range gitProject.Remotes { |
| 201 | numKey-- |
| 202 | if numKey <= 0 { |
| 203 | gitProject.CheckoutFrom = &schema.CheckoutFrom{} |
| 204 | gitProject.CheckoutFrom.Remote = key |
| 205 | gitProject.CheckoutFrom.Revision = GetRandomString(8, false) |
| 206 | LogInfoMessage(fmt.Sprintf("set CheckoutFrom remote = %s, and revision = %s", gitProject.CheckoutFrom.Remote, gitProject.CheckoutFrom.Revision)) |
| 207 | break |
| 208 | } |
| 209 | } |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | // setZipProjectValues randomly sets attributes for a Zip Project |
| 214 | func setZipProjectValues(zipProject *schema.ZipProjectSource) { |
no test coverage detected