mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Support commit type
This commit is contained in:
parent
69ed3bb776
commit
8376b176cb
4 changed files with 32 additions and 28 deletions
24
composer.lock
generated
24
composer.lock
generated
|
|
@ -5085,16 +5085,16 @@
|
||||||
"packages-dev": [
|
"packages-dev": [
|
||||||
{
|
{
|
||||||
"name": "appwrite/sdk-generator",
|
"name": "appwrite/sdk-generator",
|
||||||
"version": "0.40.6",
|
"version": "0.40.7",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/appwrite/sdk-generator.git",
|
"url": "https://github.com/appwrite/sdk-generator.git",
|
||||||
"reference": "d8816209a07e7d64ef62dbcaf8ad4aa1262f58b9"
|
"reference": "9e89b0bc4d8e6c81817d27096629f34a149fa873"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/d8816209a07e7d64ef62dbcaf8ad4aa1262f58b9",
|
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/9e89b0bc4d8e6c81817d27096629f34a149fa873",
|
||||||
"reference": "d8816209a07e7d64ef62dbcaf8ad4aa1262f58b9",
|
"reference": "9e89b0bc4d8e6c81817d27096629f34a149fa873",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
|
@ -5130,9 +5130,9 @@
|
||||||
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
|
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/appwrite/sdk-generator/issues",
|
"issues": "https://github.com/appwrite/sdk-generator/issues",
|
||||||
"source": "https://github.com/appwrite/sdk-generator/tree/0.40.6"
|
"source": "https://github.com/appwrite/sdk-generator/tree/0.40.7"
|
||||||
},
|
},
|
||||||
"time": "2025-03-10T19:04:24+00:00"
|
"time": "2025-03-12T08:43:55+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "doctrine/annotations",
|
"name": "doctrine/annotations",
|
||||||
|
|
@ -5881,16 +5881,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpbench/phpbench",
|
"name": "phpbench/phpbench",
|
||||||
"version": "1.4.0",
|
"version": "1.4.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpbench/phpbench.git",
|
"url": "https://github.com/phpbench/phpbench.git",
|
||||||
"reference": "4248817222514421cba466bfa7adc7d8932345d4"
|
"reference": "78cd98a9aa34e0f8f80ca01972a8b88d2c30194b"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpbench/phpbench/zipball/4248817222514421cba466bfa7adc7d8932345d4",
|
"url": "https://api.github.com/repos/phpbench/phpbench/zipball/78cd98a9aa34e0f8f80ca01972a8b88d2c30194b",
|
||||||
"reference": "4248817222514421cba466bfa7adc7d8932345d4",
|
"reference": "78cd98a9aa34e0f8f80ca01972a8b88d2c30194b",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
|
@ -5967,7 +5967,7 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/phpbench/phpbench/issues",
|
"issues": "https://github.com/phpbench/phpbench/issues",
|
||||||
"source": "https://github.com/phpbench/phpbench/tree/1.4.0"
|
"source": "https://github.com/phpbench/phpbench/tree/1.4.1"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
|
@ -5975,7 +5975,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2025-01-26T19:54:45+00:00"
|
"time": "2025-03-12T08:01:40+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpdocumentor/reflection-common",
|
"name": "phpdocumentor/reflection-common",
|
||||||
|
|
|
||||||
|
|
@ -119,25 +119,29 @@ class Base extends Action
|
||||||
throw new Exception(Exception::PROVIDER_REPOSITORY_NOT_FOUND);
|
throw new Exception(Exception::PROVIDER_REPOSITORY_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Support tag and commit in future
|
$commitDetails = [];
|
||||||
|
$branchUrl = "";
|
||||||
|
$providerBranch = "";
|
||||||
|
|
||||||
|
// TODO: Support tag in future
|
||||||
if ($referenceType === 'branch') {
|
if ($referenceType === 'branch') {
|
||||||
$providerBranch = empty($reference) ? $site->getAttribute('providerBranch', 'main') : $reference;
|
$providerBranch = empty($reference) ? $site->getAttribute('providerBranch', 'main') : $reference;
|
||||||
|
$branchUrl = "https://github.com/$owner/$repositoryName/tree/$providerBranch";
|
||||||
|
try {
|
||||||
|
$commitDetails = $github->getLatestCommit($owner, $repositoryName, $providerBranch);
|
||||||
|
} catch (\Throwable $error) {
|
||||||
|
// Ignore; deployment can continue
|
||||||
|
}
|
||||||
|
} elseif ($referenceType === 'commit') {
|
||||||
|
try {
|
||||||
|
$commitDetails = $github->getCommit($owner, $repositoryName, $reference);
|
||||||
|
} catch (\Throwable $error) {
|
||||||
|
// Ignore; deployment can continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$authorUrl = "https://github.com/$owner";
|
$authorUrl = "https://github.com/$owner";
|
||||||
$repositoryUrl = "https://github.com/$owner/$repositoryName";
|
$repositoryUrl = "https://github.com/$owner/$repositoryName";
|
||||||
$branchUrl = "https://github.com/$owner/$repositoryName/tree/$providerBranch";
|
|
||||||
|
|
||||||
$commitDetails = [];
|
|
||||||
if ($template->isEmpty()) {
|
|
||||||
try {
|
|
||||||
$commitDetails = $github->getLatestCommit($owner, $repositoryName, $providerBranch);
|
|
||||||
} catch (\Throwable $error) {
|
|
||||||
Console::warning('Failed to get latest commit details');
|
|
||||||
Console::warning($error->getMessage());
|
|
||||||
Console::warning($error->getTraceAsString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$commands = [];
|
$commands = [];
|
||||||
if (!empty($site->getAttribute('installCommand', ''))) {
|
if (!empty($site->getAttribute('installCommand', ''))) {
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,8 @@ class Create extends Base
|
||||||
],
|
],
|
||||||
))
|
))
|
||||||
->param('siteId', '', new UID(), 'Site ID.')
|
->param('siteId', '', new UID(), 'Site ID.')
|
||||||
// TODO: Support tag and commit in future
|
// TODO: Support tag in future
|
||||||
->param('type', '', new WhiteList(['branch']), 'Type of reference passed. Allowed values are: branch')
|
->param('type', '', new WhiteList(['branch', 'commit']), 'Type of reference passed. Allowed values are: branch')
|
||||||
->param('reference', '', new Text(255), 'VCS reference to create deployment from. Depending on type this can be: branch name')
|
->param('reference', '', new Text(255), 'VCS reference to create deployment from. Depending on type this can be: branch name')
|
||||||
->param('activate', false, new Boolean(), 'Automatically activate the deployment when it is finished building.', true)
|
->param('activate', false, new Boolean(), 'Automatically activate the deployment when it is finished building.', true)
|
||||||
->inject('request')
|
->inject('request')
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ class Deployment extends Model
|
||||||
])
|
])
|
||||||
->addRule('status', [
|
->addRule('status', [
|
||||||
'type' => self::TYPE_STRING,
|
'type' => self::TYPE_STRING,
|
||||||
'description' => 'The deployment status. Possible values are "processing", "building", "waiting", "ready", and "failed".',
|
'description' => 'The deployment status. Possible values are "waiting", "processing", "building", "waiting", "ready", and "failed".',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'example' => 'ready',
|
'example' => 'ready',
|
||||||
])
|
])
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue