Vuepress Deployment

Deploy réunie plusieurs modules utilisant la console, le tout permettant la mise en production de site internet par exemple.

Installation

composer require mediashare/kernel
1

Usage

Exemple avec le déploiment de ce site en vuepress.

<?php
// ./deploy.php
require 'vendor/autoload.php';
use Mediashare\Kernel\Kernel;
// Kernel
$kernel = new Kernel();
$kernel->run();

// Output
$output = $kernel->get('Output');
$output->progressBar(0, 4, '[Init] Deploy'); // ProgressBar

// Git
$output->progressBar(1, 4, '[Git] Push to the remote server');
if ($output->ask("Push to github ? [Y/n]\n")):
    $git = $kernel->get('Git'); // Get Git module from the Kernel
    $git->message = "Production"; // Set Message
    $git->run();    
endif;

// Vuepress Build
$output->progressBar(2, 4, '[VuePress] Build');
$command = $kernel->get('Command');
$command->run('sudo vuepress build -d blog');

// Deploy
$output->progressBar(3, 4, '[SCP] Deploy to the remote server');
$sync = $kernel->get('Sync');
$sync->username = "username";
$sync->host = "blog.com";
$sync->directory = "blog";
$sync->destination = "/var/www";
$sync->run();

// Vuepress remove build
$output->progressBar(4, 4, '[End] Remove build');
$command->run('sudo rm -rf blog');
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Last Updated: 1/7/2020, 7:31:39 PM