Skip to content

Repository files navigation

▶️ deployit

MIT CI/CD CI/CD

About

Uses ssh + sftp to deploy configurations to Linux servers and can execute simple commands.

Configuration

Configuration

DeployIT is easily configured using environment variables or a .env file in the working directory.

Here is a WireGuard example:

DIT_NODE1=ssh://<user>@<host1>*<priv-key-path>
DIT_NODE1_TASK1=UPLOAD@./node1.wg0.conf@/etc/wireguard/wg0.conf
DIT_NODE1_TASK2=CMD@sudo wg-quick down wg0 || true && sudo wg-quick up wg0
DIT_NODE1_TASK3=DOWNLOAD@/etc/wireguard/wg0.conf@./test.node1.wg0.conf

DIT_NODE2=ssh://<user>@<host2>*<priv-key-path>
DIT_NODE2_TASK1=UPLOAD@./node2.wg0.conf@/etc/wireguard/wg0.conf
DIT_NODE2_TASK2=CMD@sudo wg-quick down wg0 || true && sudo wg-quick up wg0
DIT_NODE2_TASK3=DOWNLOAD@/etc/wireguard/wg0.conf@./test.node2.wg0.conf

This example deploys two local WireGuard configs from ./nodeX.wg0.conf to the selected hosts. It then runs wg-quick down and up on each interface to reload the config. To verify deployment, it downloads each remote config to ./test.node1.wg0.conf and ./test.node2.wg0.conf.

For this example, make sure the user you are using has permissions to access /etc/wireguard on the server. If a password is used, use !your-password instead of *<priv-key-path>.

User Guide

User Guide

Requirements

Linux- or macos-like systems with go or wget & tar installed.

Getting Started

Start the latest repo version directly without leaving stuff in the current working dir:

go run github.com/NobleMajo/DeployIT@latest

Quick help

go run github.com/NobleMajo/DeployIT@latest -h

Install via go

For this section go is required, check out the install go guide.
go install github.com/NobleMajo/DeployIT@latest

Install via wget

export CUSTOM_BIN_DIR="/usr/local/bin" # <- change if needed
export CUSTOM_VERSION="" # <- set latest version here

rm -rf $CUSTOM_BIN_DIR/deployit
wget https://github.com/NobleMajo/DeployIT/releases/download/v$CUSTOM_VERSION/deployit-v$CUSTOM_VERSION-linux-amd64.tar.gz -O /tmp/deployit.tar.gz
tar -xzvf /tmp/deployit.tar.gz -C $CUSTOM_BIN_DIR/ deployit
rm /tmp/deployit.tar.gz

Build

Build requirements

To build, you need to install go. The required go version is in the go.mod file.

Build Instructions

For this section go is required, check out the install go guide.

Clone the repo:

git clone https://github.com/NobleMajo/DeployIT.git
cd DeployIT

Build the deployit binary from source code:

make build
./deployit
Development

Development

For this section go is required, check out the install go guide.

This part is work in progress, I want to use 'AIR' as auto-reload tool:

make dev #WIP

Install go

The required go version for this project is in the go.mod file.

To install and update go, I can recommend the following repo:

git clone git@github.com:udhos/update-golang.git golang-updater
cd golang-updater
sudo ./update-golang.sh

🤝 Contributing

Contributions to this project are welcome!
Follow the CONTRIBUTING.md for more infos.

⚠️ Disclaimer

This project is provided without warranties.

📜 License

Licensed under the MIT license.

CoreUnit.NET Discord Banner

About

ssh+sftp deploys configs to servers and can execute simple commands

Resources

Contributing

Stars

15 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages