Uses ssh + sftp to deploy configurations to Linux servers and can execute simple commands.
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.confThis 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
Linux- or macos-like systems with go or wget & tar installed.
Start the latest repo version directly without leaving stuff in the current working dir:
go run github.com/NobleMajo/DeployIT@latestgo run github.com/NobleMajo/DeployIT@latest -hFor this section go is required, check out the install go guide.
go install github.com/NobleMajo/DeployIT@latestexport 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.gzTo build, you need to install go.
The required go version is in the go.mod file.
For this section go is required, check out the install go guide.
Clone the repo:
git clone https://github.com/NobleMajo/DeployIT.git
cd DeployITBuild the deployit binary from source code:
make build
./deployitDevelopment
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 #WIPThe 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.shContributions to this project are welcome!
Follow the CONTRIBUTING.md for more infos.
This project is provided without warranties.
Licensed under the MIT license.