OLD | NEW |
1 // Copyright 2015 The LUCI Authors. | 1 // Copyright 2015 The LUCI Authors. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 parts = append(parts, "") | 372 parts = append(parts, "") |
373 } | 373 } |
374 updatedIf(step, UpdateIterative, step.SetProperty(parts[0], part
s[1])) | 374 updatedIf(step, UpdateIterative, step.SetProperty(parts[0], part
s[1])) |
375 | 375 |
376 // @@@STEP_TRIGGER@<spec>@@@ | 376 // @@@STEP_TRIGGER@<spec>@@@ |
377 case "STEP_TRIGGER": | 377 case "STEP_TRIGGER": |
378 // Annotee will stop short of sending an actual request to Build
Bucket. | 378 // Annotee will stop short of sending an actual request to Build
Bucket. |
379 break | 379 break |
380 | 380 |
381 // This is ONLY supported by annotee, not by buildbot. | 381 // This is ONLY supported by annotee, not by buildbot. |
382 » // @@@DEPLOYMENT_MANIFEST@<name>@<sha256>@<url>@@@ | 382 » // @@@SOURCE_MANIFEST@<name>@<sha256>@<url>@@@ |
383 » case "DEPLOYMENT_MANIFEST": | 383 » case "SOURCE_MANIFEST": |
384 parts := strings.SplitN(params, "@", 3) | 384 parts := strings.SplitN(params, "@", 3) |
385 if len(parts) != 3 { | 385 if len(parts) != 3 { |
386 » » » return fmt.Errorf("DEPLOYMENT_MANIFEST expected 3 params
, got %q", params) | 386 » » » return fmt.Errorf("SOURCE_MANIFEST expected 3 params, go
t %q", params) |
387 } | 387 } |
388 | 388 |
389 step := s.RootStep() | 389 step := s.RootStep() |
390 » » if step.DeploymentManifests == nil { | 390 » » if step.SourceManifests == nil { |
391 » » » step.DeploymentManifests = map[string]*milo.Step_Manifes
tLink{} | 391 » » » step.SourceManifests = map[string]*milo.Step_ManifestLin
k{} |
392 } | 392 } |
393 | 393 |
394 name, hashHex, url := parts[0], parts[1], parts[2] | 394 name, hashHex, url := parts[0], parts[1], parts[2] |
395 hash, err := hex.DecodeString(hashHex) | 395 hash, err := hex.DecodeString(hashHex) |
396 if err != nil { | 396 if err != nil { |
397 » » » return fmt.Errorf("DEPLOYMENT_MANIFEST has bad hash: %s"
, err) | 397 » » » return fmt.Errorf("SOURCE_MANIFEST has bad hash: %s", er
r) |
398 } | 398 } |
399 » » if _, ok := step.DeploymentManifests[name]; ok { | 399 » » if _, ok := step.SourceManifests[name]; ok { |
400 » » » return fmt.Errorf("repeated DEPLOYMENT_MANIFEST name %q"
, name) | 400 » » » return fmt.Errorf("repeated SOURCE_MANIFEST name %q", na
me) |
401 } | 401 } |
402 | 402 |
403 » » step.DeploymentManifests[name] = &milo.Step_ManifestLink{ | 403 » » step.SourceManifests[name] = &milo.Step_ManifestLink{ |
404 Sha256: hash, | 404 Sha256: hash, |
405 Url: url, | 405 Url: url, |
406 } | 406 } |
407 updated = step | 407 updated = step |
408 } | 408 } |
409 | 409 |
410 if updated != nil { | 410 if updated != nil { |
411 s.Callbacks.Updated(updated, updateType) | 411 s.Callbacks.Updated(updated, updateType) |
412 } | 412 } |
413 return nil | 413 return nil |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
980 as.StderrStream, updated = as.maybeSetLogDogStream(as.StderrStream, st) | 980 as.StderrStream, updated = as.maybeSetLogDogStream(as.StderrStream, st) |
981 return | 981 return |
982 } | 982 } |
983 | 983 |
984 func (as *Step) maybeSetLogDogStream(target *milo.LogdogStream, st *milo.LogdogS
tream) (*milo.LogdogStream, bool) { | 984 func (as *Step) maybeSetLogDogStream(target *milo.LogdogStream, st *milo.LogdogS
tream) (*milo.LogdogStream, bool) { |
985 if (target == nil && st == nil) || (target != nil && st != nil && *targe
t == *st) { | 985 if (target == nil && st == nil) || (target != nil && st != nil && *targe
t == *st) { |
986 return target, false | 986 return target, false |
987 } | 987 } |
988 return st, true | 988 return st, true |
989 } | 989 } |
OLD | NEW |