GithubHelp home page GithubHelp logo

ministryofjustice / worm Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 0.0 17.2 MB

PHP tool for managing WordPress sites on CloudPlatform k8s clusters

License: MIT License

PHP 99.01% Shell 0.95% Makefile 0.04%
php wordpress hale

worm's Introduction

Wordpress Online Resource Manager (WORM)

WORM cli interface

Apply linting and code sniffer

WORM is a command line tool that helps manage databases and media assets generated by WordPress between different environments on CloudPlatform.

It is based off the Laravel-Zero framework.

Environments

WORM targets the following environments, Local, Demo, Dev, Staging & Prod.

Features

  • Download database or media assets from any environment.
  • Upload database or media assets from any environment.
  • Check WordPress sites installed on multisite and their blog ids.
  • Display secrets worm status --secrets
  • Display list of sites on multisite cluster worm listSites
  • Setup AWS Profiles for s3, rds and ecr list for current namespace worm setup:createProfiles
  • Migrate - worm migrate <source> <target> will move the database and s3 assets from one environment to another. Todo: currently only works with staging, dev, demo migrating to local.

Required

Installation

Step 1: Download the WORM repository to your local machine, either via SSH - git clone [email protected]:ministryofjustice/worm.git or GH - gh repo clone ministryofjustice/worm.

Step 2: cd into this repository's root directory on your local machine and run the following commands.

Step 3: Run composer install. This will install WORM and create the required vendor folder.

Step 4: Run make install. This will install WORM globally on your machine. It will compile the WORM app into a binary and system link it so that it is available in any directory you want to run worm. You will be prompted to enter your Mac OS password so the system links can be established. You will also need to have AWS, kubectl, cloud-platform and php installed on your command line.

If successfull, you should be able to run worm in your terminal window and see it load the worm command options.

Step 5: Run worm create:profiles. This creates a standard and unique set of aws profiles in your computer's root directory in the .aws folder. Make sure to run this in each kubernetes namespace. To change namespace you need to be authenticated to the CloudPlatform already and have the program kubens installed. Then you can run kubens <namespace> to swap around to your desired namespace.

Quick guide

Make sure you are in the hale-platform repo root on your local machine and you are in the correct namespace ie kubens hale-platform-dev.

Database download

worm db:export [environment] or a specific site db worm db:export --blogID[=BLOGID]

Database upload

worm db:import <target env> <path of sql> or upload to specific site add --blogID[=BLOGID]

Download s3 media locally

worm s3:download <s3 bucket> <aws profile name>

Upload s3 media to cloud environment

worm s3:upload <bucket> <profile>

Migrate command examples:

Migrate entire multisite from staging to demo: worm migrate staging demo

Migrate single site from staging to demo worm migrate staging demo --blogID=2 (Every site has its own blogID)

Move an entire ms migration from staging to local worm migrate staging local

Move a single site from staging to demo but change the domain to its production URL. This would move CCRC to demo with the domain ccrc.gov.uk: worm migrate staging demo --blogID=5 --keepProdDomain=true

To change it back you would run: worm migrate staging demo --blogID=5 --keepProdDomain=false

License

Open-source software licensed under the MIT license.

worm's People

Contributors

brown-a2 avatar roblowemoj avatar malcolmvonmoj avatar dependabot[bot] avatar

Stargazers

 avatar  avatar Kyle Hodgetts πŸ‡¬πŸ‡§πŸ‡ΊπŸ‡¦ avatar  avatar

Watchers

Gareth.m.Davies avatar Paul Wyborn avatar Rohan Salunkhe avatar  avatar

worm's Issues

User access removed, access is now via a team

Hi there

The user brown-a2 had Direct Member access to this repository and access via a team.

Access is now only via a team.

You may have less access it is dependant upon the teams access to the repo.

If you have any questions, please post in #ask-operations-engineering on Slack.

This issue can be closed.

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.