2017 © Pedro PelĂĄez
 

library robo-system-package

Robo tasks related to system package management.

image

falc/robo-system-package

Robo tasks related to system package management.

  • Saturday, April 16, 2016
  • by Falc
  • Repository
  • 1 Watchers
  • 2 Stars
  • 21 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Robo System Package Tasks

License Build Status Coverage Status Quality Score, (*1)

Collection of tasks for interacting with system package managers., (*2)

Requirements

  • Robo ~0.5 (0.5.0 or higher)

Installation

Add the falc/robo-system-package package to your composer.json:, (*3)

composer require falc/robo-system-package

Add the Falc\Robo\Package\loadTasks trait to your RoboFile:, (*4)

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

    // ...
}

Tasks

Install

Installing a single package:, (*5)

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

Installing many packages:, (*6)

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

Compact form:, (*7)

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

It allows to specify packages conditionally:, (*8)

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

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

$install->run();

It is possible to specify a pattern:, (*9)

$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:, (*10)

$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:, (*11)

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

Uninstalling many packages:, (*12)

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

Compact form:, (*13)

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

It is possible to specify a pattern:, (*14)

$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:, (*15)

$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:, (*16)

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

Updating many packages:, (*17)

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

Do not specify any package in order to perform a full update:, (*18)

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

Compact form:, (*19)

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

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

It is possible to specify a pattern:, (*20)

$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:, (*21)

$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., (*22)

Package managers

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

At the moment these are the supported package managers: * apt * dnf * pacman * yum, (*24)

The Versions

16/04 2016

dev-master

9999999-dev

Robo tasks related to system package management.

  Sources   Download

MIT

The Requires

 

The Development Requires

task system packages robo apt dnf pacman yum

15/09 2015

v1.0.0

1.0.0.0

Robo tasks related to system package management.

  Sources   Download

MIT

The Requires

 

The Development Requires

task system packages robo apt dnf pacman yum