@@ -20,7 +20,9 @@ public function __construct()
2020 /**
2121 * Display a listing of the resource.
2222 *
23- * @return \Illuminate\Http\Response
23+ * @param Project $project
24+ * @param Server $server
25+ * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
2426 */
2527 public function index (Project $ project , Server $ server )
2628 {
@@ -81,37 +83,62 @@ public function show(Project $project,Server $server,Deployment $deployment)
8183 return view ('deployments.show ' , compact ('project ' ,'server ' , 'deployment ' ));
8284 }
8385
84- /**
85- * Show the form for editing the specified resource.
86- *
87- * @param \App\Deployment $deployment
88- * @return \Illuminate\Http\Response
89- */
90- public function edit (Deployment $ deployment )
91- {
92- //
93- }
86+ // /**
87+ // * Show the form for editing the specified resource.
88+ // *
89+ // * @param \App\Deployment $deployment
90+ // * @return \Illuminate\Http\Response
91+ // */
92+ // public function edit(Deployment $deployment)
93+ // {
94+ // //
95+ // }
96+ //
97+ // /**
98+ // * Update the specified resource in storage.
99+ // *
100+ // * @param \Illuminate\Http\Request $request
101+ // * @param \App\Deployment $deployment
102+ // * @return \Illuminate\Http\Response
103+ // */
104+ // public function update(Request $request, Deployment $deployment)
105+ // {
106+ // //
107+ // }
108+ //
109+ // /**
110+ // * Remove the specified resource from storage.
111+ // *
112+ // * @param \App\Deployment $deployment
113+ // * @return \Illuminate\Http\Response
114+ // */
115+ // public function destroy(Deployment $deployment)
116+ // {
117+ // //
118+ // }
94119
95120 /**
96- * Update the specified resource in storage.
121+ * Show git diff
97122 *
98- * @param \Illuminate\Http\Request $request
99- * @param \App\Deployment $deployment
100- * @return \Illuminate\Http\Response
123+ * @param Project $project
124+ * @param Server $server
125+ * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
101126 */
102- public function update ( Request $ request , Deployment $ deployment )
127+ public function gitDiff ( Project $ project , Server $ server )
103128 {
104- //
129+ $ gitDiff = [];
130+ $ commitRef = request ('commit ' );
131+ $ connection = new SshConnection ($ server ->toArray ());
132+ $ response = $ connection ->connect ();
133+ if ($ response ['success ' ] != 0 ) {
134+ $ git = new Git (
135+ $ connection ,
136+ $ server
137+ );
138+ $ gitDiff = $ git ->getGitDiff ($ commitRef );
139+ }
140+ return view ('deployments.gitDiff ' ,compact ('server ' ,'project ' , 'commitRef ' , 'gitDiff ' ));
105141 }
106142
107- /**
108- * Remove the specified resource from storage.
109- *
110- * @param \App\Deployment $deployment
111- * @return \Illuminate\Http\Response
112- */
113- public function destroy (Deployment $ deployment )
114- {
115- //
116- }
143+
117144}
0 commit comments