mirror of
https://github.com/google/nomulus.git
synced 2025-08-15 14:04:06 +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 {
|
type Task struct {
|
||||||
URL string `xml:"url"`
|
URL string `xml:"url"`
|
||||||
Description string `xml:"description"`
|
Description string `xml:"description"`
|
||||||
|
Service string `xml:"service"`
|
||||||
Schedule string `xml:"schedule"`
|
Schedule string `xml:"schedule"`
|
||||||
Name string `xml:"name"`
|
Name string `xml:"name"`
|
||||||
}
|
}
|
||||||
|
@ -180,13 +181,18 @@ func (manager TasksSyncManager) getArgs(task Task, operationType string) []strin
|
||||||
}
|
}
|
||||||
description = strings.ReplaceAll(description, "\n", " ")
|
description = strings.ReplaceAll(description, "\n", " ")
|
||||||
|
|
||||||
|
var service = "backend"
|
||||||
|
if task.Service != "backend" && task.Service != "" {
|
||||||
|
service = task.Service
|
||||||
|
}
|
||||||
|
|
||||||
return []string{
|
return []string{
|
||||||
"--project", projectName,
|
"--project", projectName,
|
||||||
"scheduler", "jobs", operationType,
|
"scheduler", "jobs", operationType,
|
||||||
"http", task.Name,
|
"http", task.Name,
|
||||||
"--location", GcpLocation,
|
"--location", GcpLocation,
|
||||||
"--schedule", task.Schedule,
|
"--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,
|
"--description", description,
|
||||||
"--http-method", "get",
|
"--http-method", "get",
|
||||||
"--oidc-service-account-email", getCloudSchedulerServiceAccountEmail(),
|
"--oidc-service-account-email", getCloudSchedulerServiceAccountEmail(),
|
||||||
|
@ -313,7 +319,7 @@ func getExistingEntries(cmd *exec.Cmd) ExistingEntries {
|
||||||
func main() {
|
func main() {
|
||||||
if len(os.Args) < 4 || os.Args[1] == "" || os.Args[2] == "" || os.Args[3] == "" {
|
if len(os.Args) < 4 || os.Args[1] == "" || os.Args[2] == "" || os.Args[3] == "" {
|
||||||
panic("Error - Invalid Parameters.\n" +
|
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.
|
// Nomulus YAML config file path, used to extract OAuth client ID.
|
||||||
nomulusConfigFileLocation := os.Args[1]
|
nomulusConfigFileLocation := os.Args[1]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue