/**
 * @param string $path
 */
function requireDeployServerInclude($path)
{
    if (file_exists($include = __DIR__ . '/../../' . $path) || file_exists($include = __DIR__ . '/../../../../../' . $path)) {
        serverList($include);
        return;
    }
    Context::get()->getOutput()->writeln(sprintf('Could not locate required deploy server file include "%s(/../../|/../../../../../)%s".', __DIR__, $path));
    exit(255);
}
Ejemplo n.º 2
0
<?php

include_once './include/config.php';
include_once './include/functions.php';
include_once './include/dashboard.php';
include SMARTY_LIB;
$spine = new Smarty();
$dbh = DBconnect();
// pobieramy liste serwerow z bazy
$HostMenu = serverList($dbh);
$spine->assign('HostMenu', $HostMenu);
$HostTotalCount = serverCount($dbh);
$spine->assign('HostTotalCount', $HostTotalCount);
// calkowita liczba wolnego miejsca na serwerach w GB
$FreeTotalGB = hddFreeTotal($dbh);
$spine->assign('FreeTotalGB', round($FreeTotalGB, 1));
// ilosc wolnego miejsca na poszczegolnych serwerach
$SrvHDDFree = hddFreePerServer($dbh);
$spine->assign('SrvHDDFree', $SrvHDDFree);
// uptime na poszczegolnych serwerach
$uptimePerHost = uptimePerServer($dbh);
$spine->assign('uptimePerHost', $uptimePerHost);
// calkowita liczba stron www
$websiteCount = allWebsitesCount($dbh);
$spine->assign('websiteCount', $websiteCount);
// status wszystkich hostow z z bazy
$allHostStatus = serverStatus($dbh);
$spine->assign('allHostStatus', $allHostStatus);
// tworzymy jsona z opcjami konfiguracyjnymi apacza
vhostOptionFile($dbh);
if (isset($_GET['serverid'])) {
Ejemplo n.º 3
0
<?php

/**
 * Deploying recipe for deployer utility
 *
 * NOTE: you should add the following permission to the sudo file (with visudo command)
 *
 * user_name ALL=(ALL) NOPASSWD: /usr/bin/setfacl
 */
require 'recipe/common.php';
serverList('deploy/servers.yml');
/**
 * Do not use sudo to setup writable folders.
 * You should setup access to setfacl via sudoers file on the server
 */
set('writable_use_sudo', false);
set('repository', '<repo_url>');
set('shared_dirs', ['data', 'app/frontend/runtime', 'app/backend/runtime', 'app/common/runtime', 'app/console/runtime', 'app/backend/web/media', 'app/frontend/web/media']);
set('shared_files', ['.env']);
set('writable_dirs', ['data', 'app/frontend/runtime', 'app/backend/runtime', 'app/common/runtime', 'app/console/runtime', 'app/backend/web/media', 'app/frontend/web/media', 'app/backend/web/assets', 'app/frontend/web/assets']);
/**
 * Migrate database
 */
task('database:migrate', function () {
    run('php {{release_path}}/yii migrate/up --interactive=0');
})->desc('Migrate database');
/**
 * Saving version of the application
 */
task('save_version', function () {
    run('cd {{release_path}} && git rev-parse --short HEAD > .version');
Ejemplo n.º 4
0
<?php

serverList('servers.yml');
require 'recipe/common.php';
require 'symfony.php';
// Carrega lista de servidores
Ejemplo n.º 5
0
<?php

require_once __DIR__ . '/deployer/recipe/yii-configure.php';
require_once __DIR__ . '/deployer/recipe/yii2-app-basic.php';
require_once __DIR__ . '/deployer/recipe/in-place.php';
if (!file_exists(__DIR__ . '/deployer/stage/servers.yml')) {
    die('Please create "' . __DIR__ . '/deployer/stage/servers.yml" before continuing.' . "\n");
}
serverList(__DIR__ . '/deployer/stage/servers.yml');
set('repository', '{{repository}}');
set('default_stage', 'production');
set('keep_releases', 2);
set('writable_use_sudo', false);
// Using sudo in writable commands?
set('shared_files', ['config/db.php']);
task('deploy:configure_composer', function () {
    $stage = env('app.stage');
    if ($stage == 'dev') {
        env('composer_options', 'install --verbose --no-progress --no-interaction');
    }
})->desc('Configure composer');
// uncomment the next two lines to run migrations
//after('deploy:symlink', 'deploy:run_migrations');
//after('inplace:configure', 'inplace:run_migrations');
after('deploy:shared', 'deploy:configure');
before('inplace:vendors', 'deploy:configure_composer');
before('deploy:vendors', 'deploy:configure_composer');
Ejemplo n.º 6
0
/**
 * Set parameters
 */
set('repository', 'git@github.com:oanhnn/slim-skeleton.git');
set('keep_releases', 5);
set('shared_dirs', ['tmp/cache', 'tmp/logs', 'vendor', 'webroot/upload']);
set('shared_files', ['config/app.php', 'composer.lock']);
set('writable_dirs', ['tmp/cache', 'tmp/logs', 'webroot/upload']);
set('writable_use_sudo', false);
// Using sudo in writable commands?
/**
 * Deploy start, prepare deploy directory
 */
task('deploy:start', function () {
    cd('~');
    run("if [ ! -d {{deploy_path}} ]; then mkdir -p {{deploy_path}}; fi");
    cd('{{deploy_path}}');
})->setPrivate();
/**
 * Main task
 */
task('deploy', ['deploy:start', 'deploy:prepare', 'deploy:release', 'deploy:update_code', 'deploy:shared', 'deploy:writable', 'deploy:vendors', 'deploy:symlink', 'cleanup', 'success'])->desc('Deploy your project');
before('deploy:configure', 'deploy:start');
/**
 * Load stage and list server
 */
//foreach (glob(__DIR__ . '/stage/*.php') as $filename) {
//    include $filename;
//}
serverList(__DIR__ . '/stage/servers.yml');
Ejemplo n.º 7
0
<?php

require 'recipe/common.php';
require '../vendor/deployphp/recipes/recipes/configure.php';
set('keep_releases', 5);
set('shared_files', ['src/Monitor/Config.json']);
set('repository', 'https://github.com/phaniso/phpmonitor.git');
task('deploy', ['deploy:prepare', 'deploy:release', 'deploy:update_code', 'deploy:shared', 'deploy:vendors', 'deploy:symlink', 'cleanup'])->desc('Deploy your project');
after('deploy', 'deploy:configure');
after('deploy', 'success');
serverList('config/servers.yml');