Skip to content

Commit

Permalink
Plus de config clever cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Banvillet committed Mar 5, 2020
1 parent ee1ec43 commit f6f9347
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// Customization variables
$appName = 'Roger';
//$appVersion = trim(file_get_contents(__DIR__ . '/VERSION'));
$appVersion = '1.2';
$appVersion = '1.3';
$commandClasses = [
\Roger\Commands\CleverCloudCommands::class,
\Roger\Commands\GithubCommands::class,
Expand Down
13 changes: 12 additions & 1 deletion src/Commands/CleverCloudCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,23 @@ public function createCC( $githubName = null, $opt = [ 'localProject|d' => null,
$localProject = $opt['localProject'] ?? $this->ask('path du projet en local ?');
$ccName = $opt['ccName'] ?? $this->askDefault('Nom du nouveau projet Clever Cloud ?', "{$githubName}-WP");

$ccDomain = "{$githubName}.cleverapps.io";

$ccTask = $this->taskExecStack()
->stopOnFail( true )
->exec("clever create --type php {$ccName} --org {$this->ccOrganisation} --github matiere-noire/{$githubName} --alias {$githubName}" )
->exec('clever scale --flavor nano')
->exec("clever addon create mysql-addon --plan dev {$githubName}-MySQL --link {$githubName} --org {$this->ccOrganisation}")
->exec("clever addon create fs-bucket --plan s {$githubName}-fs --link {$githubName} --org {$this->ccOrganisation}");
->exec("clever addon create fs-bucket --plan s {$githubName}-fs --link {$githubName} --org {$this->ccOrganisation}")
->exec("clever domain add {$ccDomain}")
->exec('clever env set WP_ENV production')
->exec("clever env set WP_HOME {$ccDomain}")
->exec("clever env set WP_SITEURL {$ccDomain}/wp")
->exec('clever env set CC_WEBROOT /web');

// TODO ajouter les variable d'environement suivante en récupérer les valeurs avec la commande "clever env"
// ->exec("clever env set DATABASE_URL $MYSQL_ADDON_URI")
// ->exec("clever env set CC_FS_BUCKET /web/app/uploads:$BUCKET_HOST")

if( $localProject ){
$ccTask->dir( $localProject );
Expand Down

0 comments on commit f6f9347

Please sign in to comment.