/Gnomon-Server

Terminal tools that can be used to automatically manage servers

Primary LanguageShellMIT LicenseMIT

Gnomon-Server

Adds the gns command to your terminal. Use this command to create servers containers that will automatically start, update and restart.

Getting Started

Prerequisites

You need to have git installed beacause gns will use git to update its repositories You'll have to install jq because gns is using json

sudo apt-get install jq

It's recommended to use this tool with Docker Compose, so install it if needed

Installing

For now, installation is made from a makefile, but a debian package will be created later.

First, you have to clone the repository

git clone https://github.com/Poulpinou/Gnomon-Server.git

Then go inside the directory and start the installation

cd Gnomon-Server
make install

Then you can delete the repo... It will automatically be cleaned by the debian package, but later...

How to use

gns command

The gns command will do everything you need. The base sythax is :

gns <command> [-options] [--options]

To see every possible commands use :

gns -l

To see how to use a command use :

gns <command> --help

Gnomon Container

The Gnomon Container is a directory that will contain your servers repositories.

You can create a container with this command :

gns create-container

It contains a json configuration file named .gnomonfile that can be modified to change container's behaviour :

  • version : the last compatible version
  • startOnBoot : if true, the container will after server's boot
  • updateOnStart : if true, the container will perform an update before starting
  • repositories : an array of every git repository used by this server

Gnomon Repository

A gnomon repository is a git repository that will contain you project and everything you need to deploy it (ex: a docker-compose.yml file).

To add a repository use this command :

gns add-repository <git-remote>

/!\ Your repository won't appear in your container until you update it!

Repository datas will be added to the .gnomonfile :

  • name : This name is and identifier for the repository. It must be unique in a container
  • updateDate : the last update date
  • git :
    • remote : the provided git remote
    • branch : the tracked branch
  • commands : the commands used to manage server (generated by archetypes)

Start the container

To start a container you can use

gns start                  // => starts container from active directory
gns start <container-path> // => starts container at path
gns start --all            // => starts every container

Starting a container will update it if updateOnStart is enabled, then it will apply the start command from commands (ex: for docker-compose it will use 'docker-compose up -d' by default)

Stop the container

To stop the container, use the stop command. It works like the start command.

Contributing

Feel free to contribute to the project

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details