Small and easy server for web-hooks to deploy software on push from gitlab/github/hg and so on

Deployment mini-service

This mini web-server is made to deploy your code without yaml-files headache.

If you just need to update your code somewhere after commit - use this tool. You can just define simple shell-commands to be done after git http-hook is requested. This mini-service is so simple and secure, it is only about 100 lines long, that you can check security by yourself. Daemon is using only standard library with no external dependencies. It was built using the latest stable go 1.6 release, can do auto-reload of config files and serve you in your small CI/CD deployment tasks.

Just define command in config and place a web-hook in your git to roll out your code changes in production.

Quick start:

Install latest version:

Systemd linux installer:

curl -s -o- https://raw.githubusercontent.com/ramzes642/mini-deployer/main/install.sh | sudo bash

Now only x86, amd64, arm, arm64 systemd linuxes are supported

Modify config (/etc/micro-deployer.json)

Add inside "commands" key a new "micro" hook and a secret:

{
  // ...
  "commands": {
    "micro": "cd /var/www/micro && git pull"
  },
  "gitlab_token": "123456",
  "github_secret": "123456"
  // ...
}

Add a GitHub webhook:

Add a Gitlab webhook:

  • Go to Settings -> Webhooks
  • Enter URL: http://my.server:7654/micro
  • Enter Secret token: 123456
  • Put the checkbox on trigger: Push events
  • Click "Add webhook"

That's it! You are done, you may click test - to check that your command works as expected.

You can use either gitlab_token as a secret token or ip whitelist.

Binary manual install

Download prebuilt binary archive Extract files from archive, copy files as follows and enable autorun:

  cp config.sample.json /etc/mini-deployer.json
  cp deployer.service /etc/systemd/system/mini-deployer.service
  cp mini-deployer /usr/bin/mini-deployer
  
  # Enable autostart systemd service
  systemctl enable mini-deployer.service
  systemctl start mini-deployer.service

Make sure that's installation is ok in journalctl -fu deployer or in log file Edit config /etc/mini-deployer.json as you need

Configuration sample:

{
  "cert": "/etc/ssl/site.crt",
  "key": "/etc/ssl/site.key",
  "commands": {
    "micro": "cd /var/www/micro && git pull"
  },
  "whitelist": [
    "127.0.0.1",
    "::1/128",
    "172.17.0.1/24"
  ],
  "log": "",
  "disable_autoreload": false,
  "gitlab_token": "",
  "github_secret": "",
  "timeout": 120
}
  • cert/key - path to crt & key pem files to enable https
  • commands - paths doing deploing jobs
  • whitelist - list of ip/subnets to allow access
  • log - path to logfile (if you leave it empty, as described in service file - logs will be in syslog)
  • disable_autoreload - disable autoreload feature (use curl localhost:7654/reload to do it manually)
  • gitlab_token - Instead of using whitelist ips you may bypass it using gitlab_token config flag equal to "Secret token" from gitlab webhook configuration
  • github_secret - Or use GitHub secret
  • timeout - how many seconds to wait until process kill (default 10 seconds)

Binary run flags:

Usage of ./deployer:
  -config string
        config file location (default "config.json")
  -listen string
        addr port (default ":7654")

Config manual reload

curl http://localhost:7654/reload

Works on same machine only if 127.0.0.1 is whitelisted in config (default)

Uninstall:

sudo systemctl disable mini-deployer ; sudo rm /usr/bin/mini-deployer /etc/mini-deployer.json /etc/systemd/system/mini-deployer.service
Similar Resources

Automatically deploy from GitHub to Replit, lightning fast ⚡️

repl.deploy Automatically deploy from GitHub to Replit, lightning fast ⚡️ repl.deploy is split into A GitHub app, which listens for code changes and s

Dec 22, 2022

Go-github-actions - `go-github-actions` is a package for developing GitHub Actions

go-github-actions go-github-actions is a package for developing GitHub Actions.

Feb 6, 2022

LazyXds enables Istio only push needed xDS to sidecars to reduce resource consumption and speed up xDS configuration propagation.

LazyXds enables Istio only push needed xDS to sidecars to reduce resource consumption and speed up xDS configuration propagation.

LazyXds LazyXds enables Istio only push needed xDS to sidecars to reduce resource consumption and speed up xDS configuration propagation. Problems to

Dec 28, 2022

K8s-network-config-operator - Kubernetes network config operator to push network config to switches

Kubernetes Network operator Will add more to the readme later :D Operations The

May 16, 2022

Add, remove, and manage different versions of web-distributed software binaries. No elevated permissions required!

Add, remove, and manage different versions of web-distributed software binaries. No elevated permissions required!

A cross-platform package manager for the web! Add, remove, and manage different versions of web-distributed software binaries. No elevated permissions

Nov 21, 2022

The tool for manage gitlab terraform backend

The tool for backup and restore gitlab terraform states Build how to: git clone https://github.com/CRASH-Tech/gitlab-terraform-manager.git cd gitlab-t

Oct 3, 2021

Terraform Provider for the GitLab Repository Files API

Terraform Provider GitLab Repository Files API Requirements Terraform = 0.13.x Go = 1.15 Building The Provider Clone the repository Enter the reposi

Jun 14, 2022

Deploy, manage, and secure applications and resources across multiple clusters using CloudFormation and Shipa

CloudFormation provider Deploy, secure, and manage applications across multiple clusters using CloudFormation and Shipa. Development environment setup

Feb 12, 2022

moreHandlers is a library which makes possible the use of multiple handlers for the MCBE server software

moreHandlers moreHandlers is a library which makes possible the use of multiple handlers for the MCBE server software https://github.com/df-mc/dragonf

Aug 4, 2022
🤖 Prune old images on GitHub (ghcr.io) and GitLab (registry.gitlab.com) container registry
🤖 Prune old images on GitHub (ghcr.io) and GitLab (registry.gitlab.com) container registry

✨ Prune container images in a CLI way ✨ Prune old images on GitHub (ghcr.io) and GitLab (registry.gitlab.com) Container Registry Getting Started | Des

Dec 15, 2022
Huawei-push-authorizator - Huawei Push Kit authorizator in time

huawei-push-authorizator Huawei Push Kit authorizator in time Why? To send push

Jan 3, 2022
Natural-deploy - A natural and simple way to deploy workloads or anything on other machines.

Natural Deploy Its Go way of doing Ansibles: Motivation: Have you ever felt when using ansible or any declarative type of program that is used for dep

Jan 3, 2022
A simple Go app and GitHub workflow that shows how to use GitHub Actions to test, build and deploy a Go app to Docker Hub

go-pipeline-demo A repository containing a simple Go app and GitHub workflow that shows how to use GitHub Actions to test, build and deploy a Go app t

Nov 17, 2021
Small tool to pull/push several projects in one go

gitTool Small tool to push and pull several projects in one go. Written in Go 1.17 by Roy Dybing Contact: location name/handle github: rDybing linked

Dec 28, 2021
A Go based deployment tool that allows the users to deploy the web application on the server using SSH information and pem file.

A Go based deployment tool that allows the users to deploy the web application on the server using SSH information and pem file. This application is intend for non tecnhincal users they can just open the GUI and given the server details just deploy.

Oct 16, 2021
(WIP) Extremely simple unixway GitHub webhook listener for push event

(WIP) puffy Puffy is an extremely simple unixway GitHub webhook listener and handler for push events Todo Add payload signature validation (WIP) Depen

Oct 15, 2022
Jan 4, 2022
🏯 Monitor your (gitlab/github) CI/CD pipelines via command line interface with fortress
🏯 Monitor your (gitlab/github) CI/CD pipelines via command line interface with fortress

__ _ / _| | | | |_ ___ _ __| |_ _ __ ___ ___ ___ | _/ _ \| '__| __| '__/ _ \/ __/ _

Mar 31, 2022
Nomad is an easy-to-use, flexible, and performant workload orchestrator that can deploy a mix of microservice, batch, containerized, and non-containerized applications
Nomad is an easy-to-use, flexible, and performant workload orchestrator that can deploy a mix of microservice, batch, containerized, and non-containerized applications

Nomad is an easy-to-use, flexible, and performant workload orchestrator that can deploy a mix of microservice, batch, containerized, and non-containerized applications. Nomad is easy to operate and scale and has native Consul and Vault integrations.

Jan 5, 2023