Last active
May 26, 2020 14:05
-
-
Save eldadfux/f52593877f89a1729556936400240075 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run appwrite/cli:0.1.0 client.php set-endpoint --value=https://demo.com/v1 | |
docker run appwrite/cli:0.1.0 client.php set-project --value=sdkajsdkjadks | |
docker run appwrite/cli:0.1.0 client.php set-key --value=sdasdashdjashdjashdjahsdjh | |
docker run appwrite/cli:0.1.0 account.php create | |
/bin/client.php | |
/bin/account.php | |
/bin/database.php | |
#!/bin/env php | |
<?php | |
require_once __DIR__.'/../vendor/autoload.php'; | |
global $request; | |
use Utopia\CLI\CLI; | |
use Utopia\CLI\Console; | |
use Utopia\Validator\Domain; | |
use Utopia\Validator\Range; | |
use Utopia\Validator\URL; | |
use Utopia\Validator\Text; | |
$cli = new CLI(); | |
$cli | |
->task('create') | |
->desc('Install Appwrite') | |
->param('email', 'latest', function() {return new Text(10);}, 'Installation version', true) | |
->param('password', 'https://appwrite.io', function() {return new URL();}, 'Installation source', true) | |
->param('name', 'localhost', function() {return new Domain();}, 'Installation domain', true) | |
->param('httpPort', 80, function() {return new Range(0, 65535);}, 'Installation HTTP port', true) | |
->param('httpsPort', 443, function() {return new Range(0, 65535);}, 'Installation HTTPS port', true) | |
->param('target', 'localhost', function() {return new Domain();}, 'Installation CNAME target', true) | |
->action(function ($version, $source, $domain, $httpPort, $httpsPort, $target) { | |
$response = Console::execute('client.php call --method=POST --path=/account'); | |
echo $response; | |
}); | |
$cli->run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment