Code Monkey home page Code Monkey logo

rcaap-rex-wp_cli-module's Introduction

Rex wp_cli module

A Rex wrapper module for WP_CLI (Wordpress Command Line Interface)

Usage

Include it in your project meta.yaml

Require:
    Rex::Module::CMS::WP_CLI:
        git: https://github.com/fccn/rcaap-rex-wp_cli-module.git
        branch: main

please do a rexify --resolve-deps after adding it

Directly from CLI

You can execute it directly from the command line (please mind to firstly include use Rex::Module::CMS::WP_CLI; in your Rexfile):

rex -H $host Module:CMS:WP_CLI:setup

From your project

You can use it without parameters - it will use configured CMDB settings

 use Rex::Module::CMS::WP_CLI;
 use Rex::Module::CMS::WP_CLI::Core;
    
 task "prepare", sub {
    my $WP_CONF = get (cmdb "wp_config");
    Rex::Module::CMS::WP_CLI::setup();
    # Set default base_dir
    set wp_cli => base_dir => "/var/www/website.com";

    Rex::CMS::WP_CLI::Core::install({conf => $WP_CONF);
 };

Or, you can use it as a library in your project

 use Rex::Module::CMS::WP_CLI;
 use Rex::Module::CMS::WP_CLI::Core;
    
 task "prepare", sub {
    Rex::Module::CMS::WP_CLI::setup();
    # Set default base_dir
    set wp_cli => base_dir => "/var/www/website.com";

    Rex::CMS::WP_CLI::Core::install({conf => {
            'WP_HOME' => 'http://www.acessolivre.pt',
            'WP_SITEURL' => 'http://www.website.com',
            'DB_NAME' => 'db_name'}, params => '--allow-root'});
 };

Using with Docker Compose

In order to use this module with a WP_CLI container, you need to configure your CMDB file and add an entry like:

Rex::Module::CMS::WP_CLI::command: 'docker-compose -f /[DIR]/[docker-compose.yml] --project-directory /[DIR]  run --rm [wpcli]'

Having: [DIR] as the directory where you have your working directory and or docker-compose.yml [wpcli] as your container name

rcaap-rex-wp_cli-module's People

Contributors

paulo-graca avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.