diploy

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

README

DIPLOY

A utility to manage your linux deployments.

How does it work

  • You start a server using diploy server
  • diploy exposes a http server for instructions [take care of firewall !!]
  • You create a diploy.yml with below format file and run diploy add in the same directory.
  • Now you get endpoits for each configuration you add with the below format.
  • Use these as webhooks with Github... or just manually.
  • Or just use the CLI for manual work.

diploy.yml

name: <Application Name>    // These should be unique across installation
update:                     // Specify command to update
                            // codebase (optional [default `git pull`])
  command: git pull         // Command/Script to run to update
  type: command             // Whether a script (run using /bin/sh) or command
build:                      // To build stuff
  command: echo This is build
  type: command
run:                        // To start the application
  command: echo This is run
  type: command

Installation

  • Use the command curl -s https://raw.githubusercontent.com/crossphoton/diploy/main/scripts/install.sh | /bin/sh (This starts the setup too)
  • Use go get github.com/crossphoton/diploy and build it
  • Clone the repository (or download ZIP)

endpoints

All requests are POST requests.

For now there is no authentication in this. (See TODO)

Start processes

start:

  • update codebase: /start/update/{name}
  • build application: /start/build/{name}
  • run application: /start/run/{name}
Stop processes for a given application

stop: /stop/{name}

Run a sequence of operations

/seq/<a>+<b>+<c>/{name}

Examples:
  • /seq/stop+update+build+run/golang-app
  • /seq/restart/nodejs-app
  • /seq/update+restart/website
CLI Usage
Usage:
  diploy [command]

Available Commands:
  add         add a configuration
  help        Help about any command
  remove      remove a configuaration by name
  server      Start diploy server
  start       start a service with name
  stop        stop a service with name

Flags:
  -h, --help          help for diploy
      --logs string   specify logs location (default "./diploy")

Use "diploy [command] --help" or "diploy help [command]" for more information about a command.

Extra: Use diploy server setup to setup a systemd file.

Caveats
  • Processes started with diploy will also stop if diploy is stopped.
Troubleshooting
Todo

See the dedicated TODO file.

Stuff Used

  • gorm + sqlite
  • gorilla/mux
  • cobra
  • go-yaml

Documentation

Overview

Copyright © 2021 Aditya Agrawal [email protected]

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL