Core while running forjj update/workspace/... in Jenkins context
Created by: clarsonneur
In Jenkins, when a new PR is created, forjj works properly except that
forjj.json set null for infra
This fails jenkins PR, with a core, when infra is null, with the following core:
+ ./forjj workspace unset contrib-repo-path
branch HEAD, build_date 2018-10-04_19:28:50_+0200, build_commit 7efc19697ea82f3af5be3998975c0751edb0d680, build_tag false.
WARNING ! forjj/forjfile.(*Forge).Load: Both, a Forjfile and a Forjfile model were loaded. The model has been ignored.
2018/10/08 08:30:18 Organization : 'pdxc-software-factory'
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x83fffd]
goroutine 1 [running]:
main.(*Forj).setInfraName(0xc659c0, 0x991a03, 0x9, 0x0, 0x0)
/go/workspace/src/forjj/cli_context.go:327 +0x5ad
main.(*Forj).ParseContext(0xc659c0, 0xc4200a8fc0, 0x0, 0x0, 0xc4202d8e10, 0xc5f9b0, 0xc4202da9c0)
/go/workspace/src/forjj/cli_context.go:159 +0xae8
main.(*Forj).ParseContext-fm(0xc4200a8fc0, 0x0, 0x0, 0x0, 0x0, 0x0)
/go/workspace/src/forjj/app.go:252 +0x48
forjj/vendor/github.com/forj-oss/forjj-modules/cli.(*ForjCli).contextHook(0xc4200a8fc0, 0x0, 0x0, 0xc42000ce70, 0x0, 0x0)
/go/workspace/src/forjj/vendor/github.com/forj-oss/forjj-modules/cli/forjj-context.go:151 +0x34d
forjj/vendor/github.com/forj-oss/forjj-modules/cli.(*ForjCli).loadContext(0xc4200a8fc0, 0xc42000e090, 0x3, 0x3, 0x0, 0x0, 0x990b4f, 0x7)
/go/workspace/src/forjj/vendor/github.com/forj-oss/forjj-modules/cli/forjj-context.go:58 +0x1b2
forjj/vendor/github.com/forj-oss/forjj-modules/cli.(*ForjCli).Parse(0xc4200a8fc0, 0xc42000e090, 0x3, 0x3, 0x0, 0x0, 0xc420121e60, 0xc4201abf30, 0x7ca674, 0x8f1380)
/go/workspace/src/forjj/vendor/github.com/forj-oss/forjj-modules/cli/forj-cli.go:69 +0x6e
main.main()
/go/workspace/src/forjj/forjj.go:35 +0xdd
The worekaround for now is to remove this json file everytime.