@@ -126,14 +126,19 @@ public function view($buildId)
126126 $ rebuild = Lang::get ('rebuild_now ' );
127127 $ rebuildLink = APP_URL . 'build/rebuild/ ' . $ build ->getId ();
128128
129+ $ rebuildDebug = Lang::get ('rebuild_now_debug ' );
130+
129131 $ delete = Lang::get ('delete_build ' );
130132 $ deleteLink = APP_URL . 'build/delete/ ' . $ build ->getId ();
131133
132134 $ project = Factory::getStore ('Project ' )->getByPrimaryKey ($ build ->getProjectId ());
133135
134136 $ actions = '' ;
135137 if (!$ project ->getArchived ()) {
136- $ actions .= "<a class= \"btn btn-default \" href= \"{$ rebuildLink }\"> {$ rebuild }</a> " ;
138+ if ($ this ->currentUserIsAdmin ()) {
139+ $ actions .= "<a class= \"btn btn-danger \" href= \"{$ rebuildLink }?debug=1 \"> {$ rebuildDebug }</a> " ;
140+ }
141+ $ actions .= "<a class= \"btn btn-success \" href= \"{$ rebuildLink }\"> {$ rebuild }</a> " ;
137142 }
138143
139144 if ($ this ->currentUserIsAdmin ()) {
@@ -239,8 +244,13 @@ protected function getPaginatorHtml($buildId, $plugin, $severity, $isNew, $total
239244 }
240245
241246 /**
242- * Create a build using an existing build as a template:
243- */
247+ * Create a build using an existing build as a template:
248+ *
249+ * @param $buildId
250+ *
251+ * @return RedirectResponse
252+ * @throws NotFoundException
253+ */
244254 public function rebuild ($ buildId )
245255 {
246256 $ copy = BuildFactory::getBuildById ($ buildId );
@@ -250,6 +260,12 @@ public function rebuild($buildId)
250260 throw new NotFoundException (Lang::get ('build_x_not_found ' , $ buildId ));
251261 }
252262
263+ $ debug = (boolean )$ this ->getParam ('debug ' , false );
264+
265+ if ($ debug && $ this ->currentUserIsAdmin ()) {
266+ $ copy ->addExtraValue ('debug ' , true );
267+ }
268+
253269 $ build = $ this ->buildService ->createDuplicateBuild ($ copy );
254270
255271 if ($ this ->buildService ->queueError ) {
0 commit comments