mirror of
https://github.com/google/nomulus.git
synced 2025-08-03 00:12:11 +02:00
Add support for bsa service to cloud tasks config (#2268)
This commit is contained in:
parent
ecb39d5899
commit
4eee7b8c0d
1 changed files with 8 additions and 2 deletions
|
@ -65,6 +65,7 @@ type Queue struct {
|
|||
type Task struct {
|
||||
URL string `xml:"url"`
|
||||
Description string `xml:"description"`
|
||||
Service string `xml:"service"`
|
||||
Schedule string `xml:"schedule"`
|
||||
Name string `xml:"name"`
|
||||
}
|
||||
|
@ -180,13 +181,18 @@ func (manager TasksSyncManager) getArgs(task Task, operationType string) []strin
|
|||
}
|
||||
description = strings.ReplaceAll(description, "\n", " ")
|
||||
|
||||
var service = "backend"
|
||||
if task.Service != "backend" && task.Service != "" {
|
||||
service = task.Service
|
||||
}
|
||||
|
||||
return []string{
|
||||
"--project", projectName,
|
||||
"scheduler", "jobs", operationType,
|
||||
"http", task.Name,
|
||||
"--location", GcpLocation,
|
||||
"--schedule", task.Schedule,
|
||||
"--uri", fmt.Sprintf("https://backend-dot-%s.appspot.com%s", projectName, strings.TrimSpace(task.URL)),
|
||||
"--uri", fmt.Sprintf("https://%s-dot-%s.appspot.com%s", service, projectName, strings.TrimSpace(task.URL)),
|
||||
"--description", description,
|
||||
"--http-method", "get",
|
||||
"--oidc-service-account-email", getCloudSchedulerServiceAccountEmail(),
|
||||
|
@ -313,7 +319,7 @@ func getExistingEntries(cmd *exec.Cmd) ExistingEntries {
|
|||
func main() {
|
||||
if len(os.Args) < 4 || os.Args[1] == "" || os.Args[2] == "" || os.Args[3] == "" {
|
||||
panic("Error - Invalid Parameters.\n" +
|
||||
"Required params: 1 - Nomulu config YAML path; 2 - config XML path; 3 - project name;")
|
||||
"Required params: 1 - Nomulus config YAML path; 2 - config XML path; 3 - project name;")
|
||||
}
|
||||
// Nomulus YAML config file path, used to extract OAuth client ID.
|
||||
nomulusConfigFileLocation := os.Args[1]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue