@@ -155,17 +155,20 @@ public function updateSiteEnvironmentFile($serverId, $siteId, $content)
155
155
* @param integer $siteId
156
156
* @param array $data
157
157
* @param boolean $wait
158
- * @return void
158
+ * @return Site
159
159
*/
160
160
public function installGitRepositoryOnSite ($ serverId , $ siteId , array $ data , $ wait = true )
161
161
{
162
- $ this ->post ("servers/ $ serverId/sites/ $ siteId/git " , $ data );
162
+ $ site = $ this ->post ("servers/ $ serverId/sites/ $ siteId/git " , $ data );
163
163
164
164
if ($ wait ) {
165
- $ this ->retry ($ this ->getTimeout (), function () use ($ serverId , $ siteId ) {
166
- return $ this ->site ($ serverId , $ siteId )->repositoryStatus === 'installed ' ;
165
+ return $ this ->retry ($ this ->getTimeout (), function () use ($ serverId , $ siteId ) {
166
+ $ site = $ this ->site ($ serverId , $ siteId );
167
+ return $ site ->repositoryStatus === 'installed ' ? $ site : null ;
167
168
});
168
169
}
170
+
171
+ return new Site ($ site + ['server_id ' => $ serverId ], $ this );
169
172
}
170
173
171
174
/**
@@ -259,13 +262,16 @@ public function disableQuickDeploy($serverId, $siteId)
259
262
*/
260
263
public function deploySite ($ serverId , $ siteId , $ wait = true )
261
264
{
262
- $ this ->post ("servers/ $ serverId/sites/ $ siteId/deployment/deploy " );
265
+ $ site = $ this ->post ("servers/ $ serverId/sites/ $ siteId/deployment/deploy " );
263
266
264
267
if ($ wait ) {
265
- $ this ->retry ($ this ->getTimeout (), function () use ($ serverId , $ siteId ) {
266
- return is_null ($ this ->site ($ serverId , $ siteId )->deploymentStatus );
268
+ return $ this ->retry ($ this ->getTimeout (), function () use ($ serverId , $ siteId ) {
269
+ $ site = $ this ->site ($ serverId , $ siteId );
270
+ return !is_null ($ site ->deploymentStatus ) ? $ site : null ;
267
271
});
268
272
}
273
+
274
+ return new Site ($ site + ['server_id ' => $ serverId ], $ this );
269
275
}
270
276
271
277
/**
0 commit comments