@@ -416,7 +416,7 @@ func (p Plugin) Exec() error {
416416 // Initial values
417417 args := []string {
418418 "-Dsonar.host.url=" + p .Config .Host ,
419- "-Dsonar.login =" + p .Config .Token ,
419+ "-Dsonar.token =" + p .Config .Token ,
420420 }
421421
422422 // Map of potential configurations
@@ -570,29 +570,40 @@ func (p Plugin) Exec() error {
570570 "error" : err ,
571571 }).Fatal ("Unable to parse scan results!" )
572572 }
573- logrus .WithFields (logrus.Fields {
574- "job url" : report .CeTaskURL ,
575- }).Info ("Job url" )
576- fmt .Printf ("\n " )
577- fmt .Printf ("\n \n Waiting Analysis to finish:\n \n " )
578- fmt .Printf ("\n " )
579-
580- task , err := waitForSonarJob (report )
581573
582- if err != nil {
574+ if p . Config . WaitQualityGate {
583575 logrus .WithFields (logrus.Fields {
584- "error" : err ,
585- }).Fatal ("Unable to get Job state" )
586- return err
587- }
576+ "job url" : report .CeTaskURL ,
577+ }).Info ("Job url" )
578+ fmt .Printf ("\n " )
579+ fmt .Printf ("\n \n Waiting Analysis to finish:\n \n " )
580+ fmt .Printf ("\n " )
588581
589- fmt .Printf ("\n " )
590- fmt .Printf ("#######################################\n " )
591- fmt .Printf ("Waiting for quality gate validation...\n " )
592- fmt .Printf ("#######################################\n " )
593- fmt .Printf ("\n " )
582+ task , err := waitForSonarJob (report )
583+
584+ if err != nil {
585+ logrus .WithFields (logrus.Fields {
586+ "error" : err ,
587+ }).Fatal ("Unable to get Job state" )
588+ return err
589+ }
590+
591+ fmt .Printf ("\n " )
592+ fmt .Printf ("#######################################\n " )
593+ fmt .Printf ("Waiting for quality gate validation...\n " )
594+ fmt .Printf ("#######################################\n " )
595+ fmt .Printf ("\n " )
596+
597+ status = getStatus (task , report )
598+ } else {
599+ fmt .Printf ("\n " )
600+ fmt .Printf ("#######################################\n " )
601+ fmt .Printf ("Delaying for quality gate validation...\n " )
602+ fmt .Printf ("#######################################\n " )
603+ fmt .Printf ("\n " )
594604
595- status = getStatus (task , report )
605+ status = "OK"
606+ }
596607 }
597608
598609 fmt .Printf ("\n " )
@@ -616,7 +627,7 @@ func (p Plugin) Exec() error {
616627 // fmt.Printf("\n==> FAILED <==\n")
617628 logrus .WithFields (logrus.Fields {
618629 "status" : status ,
619- }).Info ("Quality Gate Status FAILED " )
630+ }).Info ("Quality Gate Status disabled " )
620631 }
621632 if status == p .Config .Quality {
622633 // fmt.Printf("\n==> QUALITY GATEWAY ENALED \n")
0 commit comments