1
0
Fork 0
mirror of synced 2024-07-02 21:20:58 +12:00

Fix template issues

This commit is contained in:
Matej Bačo 2023-08-04 10:56:46 +02:00
parent 1db0c57518
commit 8bc933ab91
5 changed files with 19 additions and 6 deletions

@ -1 +1 @@
Subproject commit 1d75b39555221479ff92d54ecf8b452bfd503f5e
Subproject commit cd583f44f7a71a34e7b4de7f6225d82ae473711c

View file

@ -635,6 +635,14 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories')
$repository = $github->createRepository($owner, $name, $private);
}
if (isset($repository['errors'])) {
$message = $repository['message'] ?? 'Unknown error.';
if (isset($repository['errors'][0])) {
$message .= ' ' . $repository['errors'][0]['message'];
}
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'Provider Error: ' . $message);
}
$repository['id'] = \strval($repository['id']) ?? '';
$repository['pushedAt'] = $repository['pushed_at'] ?? '';
$repository['organization'] = $installation->getAttribute('organization', '');

View file

@ -58,8 +58,8 @@ function router(App $utopia, Database $dbForConsole, SwooleRequest $swooleReques
if ($route === null) {
$mainDomain = App::getEnv('_APP_DOMAIN', '');
if($mainDomain === 'localhost') {
if ($mainDomain === 'localhost') {
throw new AppwriteException(AppwriteException::GENERAL_SERVER_ERROR, 'Please configure domain environment variables before using Appwrite outside of localhost.');
} else {
throw new AppwriteException(AppwriteException::ROUTER_HOST_NOT_FOUND);

View file

@ -187,8 +187,8 @@ class BuildsV1 extends Worker
}
// Build from template
$templateRepositoryName = $template->getAttribute('repository', '');
$templateOwnerName = $template->getAttribute('owner', '');
$templateRepositoryName = $template->getAttribute('repositoryName', '');
$templateOwnerName = $template->getAttribute('ownerName', '');
$templateBranch = $template->getAttribute('branch', '');
$templateRootDirectory = $template->getAttribute('rootDirectory', '');
@ -220,6 +220,9 @@ class BuildsV1 extends Worker
throw new \Exception('Unable to push code repository: ' . $stderr);
}
\var_dump($stdout);
\var_dump($stderr);
$exit = Console::execute('cd ' . $tmpDirectory . ' && git rev-parse HEAD', '', $stdout, $stderr);
if ($exit !== 0) {

View file

@ -86,7 +86,9 @@ use Appwrite\Utopia\Response\Model\UsageProject;
use Appwrite\Utopia\Response\Model\UsageStorage;
use Appwrite\Utopia\Response\Model\UsageUsers;
use Appwrite\Utopia\Response\Model\Variable;
use Appwrite\Utopia\Response\Model\Mock; // Keep last
use Appwrite\Utopia\Response\Model\Mock;
// Keep last
/**
* @method Response setStatusCode(int $code = 200)