承接 falc/robo-system-package 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

falc/robo-system-package

最新稳定版本:v1.0.0

Composer 安装命令:

composer require falc/robo-system-package

包简介

Robo tasks related to system package management.

README 文档

README

License Build Status Coverage Status Quality Score

Collection of tasks for interacting with system package managers.

Requirements

  • Robo ~0.5 (0.5.0 or higher)

Installation

Add the falc/robo-system-package package to your composer.json:

composer require falc/robo-system-package

Add the Falc\Robo\Package\loadTasks trait to your RoboFile:

class RoboFile extends \Robo\Tasks
{
    use Falc\Robo\Package\loadTasks;

    // ...
}

Tasks

Install

Installing a single package:

$this->taskPackageInstall()
    ->packageManager('yum')
    ->package('package1')
    ->run();

Installing many packages:

$this->taskPackageInstall()
    ->packageManager('yum')
    ->packages(['package1', 'package2'])
    ->run();

Compact form:

$this->taskPackageInstall('yum', ['package1', 'package2'])->run();

It allows to specify packages conditionally:

$install = $this->taskPackageInstall('yum', ['package1']);

if ($requiresPackage2) {
    $install->package('package2');
}

$install->run();

It is possible to specify a pattern:

$this->taskPackageInstall()
    ->packageManager('yum')
    ->package('package1-*') // Installs all packages starting with "package1-"
    ->run();

You can combine it with taskSshExec() to install packages in a remote server:

$installTask = $this->taskPackageInstall()
    ->packageManager('yum')
    ->packages(['package1', 'package2']);

$this->taskSshExec('remote.example.com')
    ->remoteDir('/home/user')
    ->printed(false) // Do not display output
    ->exec($installTask)
    ->run();

Uninstall

Uninstalling a single package:

$this->taskPackageUninstall()
    ->packageManager('yum')
    ->package('package1')
    ->run();

Uninstalling many packages:

$this->taskPackageUninstall()
    ->packageManager('yum')
    ->packages(['package1', 'package2'])
    ->run();

Compact form:

$this->taskPackageUninstall('yum', ['package1', 'package2'])->run();

It is possible to specify a pattern:

$this->taskPackageUninstall()
    ->packageManager('yum')
    ->package('package1-*') // Uninstalls all packages starting with "package1-"
    ->run();

You can combine it with taskSshExec() to uninstall packages from a remote server:

$uninstallTask = $this->taskPackageUninstall()
    ->packageManager('yum')
    ->packages(['package1', 'package2']);

$this->taskSshExec('remote.example.com')
    ->remoteDir('/home/user')
    ->printed(false) // Do not display output
    ->exec($uninstallTask)
    ->run();

Update

Updating a single package:

$this->taskPackageUpdate()
    ->packageManager('yum')
    ->package('package1')
    ->run();

Updating many packages:

$this->taskPackageUpdate()
    ->packageManager('yum')
    ->packages(['package1', 'package2'])
    ->run();

Do not specify any package in order to perform a full update:

$this->taskPackageUpdate()
    ->packageManager('yum')
    ->run();

Compact form:

// Update some packages
$this->taskPackageUpdate('yum', ['package1', 'package2'])->run();

// Update everything
$this->taskPackageUpdate('yum')->run();

It is possible to specify a pattern:

$this->taskPackageUpdate()
    ->packageManager('yum')
    ->package('package1-*') // Updates all packages starting with "package1-"
    ->run();

You can combine it with taskSshExec() to update packages in a remote server:

$updateTask = $this->taskPackageUpdate()
    ->packageManager('yum')
    ->packages(['package1', 'package2']);

$this->taskSshExec('remote.example.com')
    ->remoteDir('/home/user')
    ->printed(false) // Do not display output
    ->exec($updateTask)
    ->run();

Methods

All the tasks implement these methods:

  • packageManager($packageManager): Sets the package manager to use.
  • package(): Adds a package to the package list.
  • packages(): Adds packages to the package list.
  • verbose(): Enables the verbose mode.

Package managers

Every task requires to set a package manager either in the constructor or using the packageManager($packageManager) method.

At the moment these are the supported package managers:

统计信息

  • 总下载量: 33
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-20