mirror of
https://github.com/appwrite/appwrite
synced 2026-05-21 16:08:22 +00:00
Merge branch '1.7.x' into chore-cli-release
This commit is contained in:
commit
021fb48dc1
3 changed files with 6 additions and 34 deletions
|
|
@ -89,8 +89,6 @@ class Update extends Base
|
|||
throw new Exception(Exception::BUILD_NOT_READY);
|
||||
}
|
||||
|
||||
$oldDeploymentInternalId = $function->getAttribute('deploymentInternalId', '');
|
||||
|
||||
$function = $dbForProject->updateDocument('functions', $function->getId(), new Document(array_merge($function->getArrayCopy(), [
|
||||
'deploymentInternalId' => $deployment->getInternalId(),
|
||||
'deploymentId' => $deployment->getId(),
|
||||
|
|
@ -106,18 +104,13 @@ class Update extends Base
|
|||
Authorization::skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule));
|
||||
|
||||
$queries = [
|
||||
Query::equal('trigger', 'manual'),
|
||||
Query::equal('trigger', ['manual']),
|
||||
Query::equal("type", ["deployment"]),
|
||||
Query::equal("deploymentResourceType", ["function"]),
|
||||
Query::equal("deploymentResourceInternalId", [$function->getInternalId()]),
|
||||
Query::equal("deploymentVcsProviderBranch", [""]),
|
||||
];
|
||||
|
||||
if (empty($oldDeploymentInternalId)) {
|
||||
$queries[] = Query::equal("deploymentInternalId", [""]);
|
||||
} else {
|
||||
$queries[] = Query::equal("deploymentInternalId", [$oldDeploymentInternalId]);
|
||||
}
|
||||
|
||||
$this->listRules($project, $queries, $dbForPlatform, function (Document $rule) use ($dbForPlatform, $deployment) {
|
||||
$rule = $rule
|
||||
->setAttribute('deploymentId', $deployment->getId())
|
||||
|
|
|
|||
|
|
@ -1075,8 +1075,6 @@ class Builds extends Action
|
|||
$resource->setAttribute('live', true);
|
||||
switch ($resource->getCollection()) {
|
||||
case 'functions':
|
||||
$oldDeploymentInternalId = $resource->getAttribute('deploymentInternalId', '');
|
||||
|
||||
$resource->setAttribute('deploymentId', $deployment->getId());
|
||||
$resource->setAttribute('deploymentInternalId', $deployment->getInternalId());
|
||||
$resource->setAttribute('deploymentCreatedAt', $deployment->getCreatedAt());
|
||||
|
|
@ -1088,14 +1086,9 @@ class Builds extends Action
|
|||
Query::equal("deploymentResourceInternalId", [$resource->getInternalId()]),
|
||||
Query::equal('deploymentResourceType', ['function']),
|
||||
Query::equal('trigger', ['manual']),
|
||||
Query::equal('deploymentVcsProviderBranch', ['']),
|
||||
];
|
||||
|
||||
if (empty($oldDeploymentInternalId)) {
|
||||
$queries[] = Query::equal("deploymentInternalId", [""]);
|
||||
} else {
|
||||
$queries[] = Query::equal("deploymentInternalId", [$oldDeploymentInternalId]);
|
||||
}
|
||||
|
||||
$rulesUpdated = false;
|
||||
$this->listRules($project, $queries, $dbForPlatform, function (Document $rule) use ($dbForPlatform, $deployment, &$rulesUpdated) {
|
||||
$rulesUpdated = true;
|
||||
|
|
@ -1106,8 +1099,6 @@ class Builds extends Action
|
|||
});
|
||||
break;
|
||||
case 'sites':
|
||||
$oldDeploymentInternalId = $resource->getAttribute('deploymentInternalId', '');
|
||||
|
||||
$resource->setAttribute('deploymentId', $deployment->getId());
|
||||
$resource->setAttribute('deploymentInternalId', $deployment->getInternalId());
|
||||
$resource->setAttribute('deploymentScreenshotDark', $deployment->getAttribute('screenshotDark', ''));
|
||||
|
|
@ -1120,14 +1111,9 @@ class Builds extends Action
|
|||
Query::equal("deploymentResourceInternalId", [$resource->getInternalId()]),
|
||||
Query::equal('deploymentResourceType', ['site']),
|
||||
Query::equal('trigger', ['manual']),
|
||||
Query::equal('deploymentVcsProviderBranch', ['']),
|
||||
];
|
||||
|
||||
if (empty($oldDeploymentInternalId)) {
|
||||
$queries[] = Query::equal("deploymentInternalId", [""]);
|
||||
} else {
|
||||
$queries[] = Query::equal("deploymentInternalId", [$oldDeploymentInternalId]);
|
||||
}
|
||||
|
||||
$this->listRules($project, $queries, $dbForPlatform, function (Document $rule) use ($dbForPlatform, $deployment) {
|
||||
$rule = $rule
|
||||
->setAttribute('deploymentId', $deployment->getId())
|
||||
|
|
|
|||
|
|
@ -86,8 +86,6 @@ class Update extends Base
|
|||
throw new Exception(Exception::BUILD_NOT_READY);
|
||||
}
|
||||
|
||||
$oldDeploymentInternalId = $site->getAttribute('deploymentInternalId', '');
|
||||
|
||||
$site = $dbForProject->updateDocument('sites', $site->getId(), new Document(array_merge($site->getArrayCopy(), [
|
||||
'deploymentInternalId' => $deployment->getInternalId(),
|
||||
'deploymentId' => $deployment->getId(),
|
||||
|
|
@ -97,18 +95,13 @@ class Update extends Base
|
|||
])));
|
||||
|
||||
$queries = [
|
||||
Query::equal('trigger', 'manual'),
|
||||
Query::equal('trigger', ['manual']),
|
||||
Query::equal("type", ["deployment"]),
|
||||
Query::equal("deploymentResourceType", ["site"]),
|
||||
Query::equal("deploymentResourceInternalId", [$site->getInternalId()]),
|
||||
Query::equal("deploymentVcsProviderBranch", [""]),
|
||||
];
|
||||
|
||||
if (empty($oldDeploymentInternalId)) {
|
||||
$queries[] = Query::equal("deploymentInternalId", [""]);
|
||||
} else {
|
||||
$queries[] = Query::equal("deploymentInternalId", [$oldDeploymentInternalId]);
|
||||
}
|
||||
|
||||
$this->listRules($project, $queries, $dbForPlatform, function (Document $rule) use ($dbForPlatform, $deployment) {
|
||||
$rule = $rule
|
||||
->setAttribute('deploymentId', $deployment->getId())
|
||||
|
|
|
|||
Loading…
Reference in a new issue