wsman

Build Status

Introduction

Tool for managing a simple multi-site PHP web hosting environment. Meant to be used on a stack built with cfn-simple-webhost.

Installation

Download the tarball and unpack it to a directory. You can also build it like this:

shards install
crystal build --release -o wsman src/cli.cr

Static build

You might want to statically build it in some cases, for example when you're building it on Arch, but shipping it to Ubuntu bionic, which has older shared libraries:

With podman:

# Build container
podman build --tag=wsman-build .
# Install dependencies
podman run --rm -it -v $PWD:/app -w /app wsman-build shards install
# Build static binary
podman run --rm -it -v $PWD:/app -w /app wsman-build crystal build --static --release -o wsman src/cli.cr
# Run ameba - static code analysis
podman run --rm -it -v $PWD:/app -w /app wsman-build bin/ameba

or with docker:

# Build container
docker build --tag=wsman-build .
# Install dependencies
docker run -u $(id -u):$(id -g) --rm -it -v $PWD:/app -w /app wsman-build shards install
# Build static binary
docker run -u $(id -u):$(id -g) --rm -it -v $PWD:/app -w /app wsman-build crystal build --static --release -o wsman src/cli.cr
# Run ameba - static code analysis
docker run -u $(id -u):$(id -g) --rm -it -v $PWD:/app -w /app wsman-build bin/ameba

Usage

wsman [tool] [command] [arguments]

Tools

site

wsman site setup \<sitename\>

Generate site configurations for the given site.

options

|Name|Definition| |---|---| |--skip-solr|Optional- Skip Solr core install, even if it's configured. (default:false)|

wsman site setup_all

Generate site configurations.

wsman site setup_solr \<sitename\>

Generate site's solr configurations for the given site.

ci

wsman ci zipinstall -s \<sitename\> -z \<archive\>

Installs a zipped site artifact to the webroot.

options

|Name|Definition| |---|---| |-f, --force|Optional- Overwrite target directory. (default:false)| |-s SITE, --site=SITE|Required - Main hostname of the site. This is also used as the directory name.| |-z ZIP, --zip ZIP|Required - Path to the archive.|

wsman ci cleanup -s \<sitename\>

Cleans up a site from the server.

wsman ci cleanup_solr -s \<sitename\>

Cleans up a site's solr core from the server.

options

|Name|Definition| |---|---| |-s SITE, --site=SITE |Required- Main hostname of the site. This is also used as the directory name.|

What does it do?

The tool iterates over all directories in web_root_dir (/srv/www by default) and performs the following:

TODO