You've already forked woodpecker
							
							
				mirror of
				https://github.com/woodpecker-ci/woodpecker.git
				synced 2025-10-30 23:27:39 +02:00 
			
		
		
		
	set machine on proc update
This commit is contained in:
		| @@ -144,6 +144,14 @@ func (s *RPC) Update(c context.Context, id string, state rpc.State) error { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	metadata, ok := metadata.FromContext(c) | ||||
| 	if ok { | ||||
| 		hostname, ok := metadata["hostname"] | ||||
| 		if ok && len(hostname) != 0 { | ||||
| 			proc.Machine = hostname[0] | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	repo, err := s.store.GetRepo(build.RepoID) | ||||
| 	if err != nil { | ||||
| 		log.Printf("error: cannot find repo with id %d: %s", build.RepoID, err) | ||||
| @@ -209,14 +217,6 @@ func (s *RPC) Upload(c context.Context, id string, file *rpc.File) error { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	metadata, ok := metadata.FromContext(c) | ||||
| 	if ok { | ||||
| 		hostname, ok := metadata["hostname"] | ||||
| 		if ok && len(hostname) != 0 { | ||||
| 			proc.Machine = hostname[0] | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if file.Mime == "application/json+logs" { | ||||
| 		return s.store.LogSave( | ||||
| 			proc, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user