bndr/gojenkins

Can not get Build after Invoke

Open

#161 opened on Nov 29, 2018

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Go (454 forks)github user discovery
help wanted

Repository metrics

Stars
 (903 stars)
PR merge metrics
 (PR metrics pending)

Description

I'm working with this code.

               var params = map[string]string{
			"PLATFORM_CONFIG_URL": purl,
			"DEVICE_CONFIG_URL":   durl,
		}

		jid, err := job.InvokeSimple(params)
		if err != nil {
			log.Errorf("Some error triggered while invoking job  %s for engine %s Error %s", id, engine.Name, err)
			return
		}

		log.Infof("Invoked job with number %d", jid)
	
		b, err := job.GetBuild(jid)
		if err != nil {
			log.Errorf("Some error triggered while getting the build for job  %s  (ID %d)  Error %s", id, jid, err)
			return
		}

Allways returing this log:

time="2018-11-29 16:40:40" level=error msg="Some error triggered while getting the build for job  device_add_snmpcollector  (ID 160)  Error 404"

But the job has been correctly triggered

image

There is any workarround I can do to get the build related info ( status/url/etc) ?

Contributor guide