diff --git a/.drone.yml b/.drone.yml index 17506dc..4b1de2b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,7 +12,8 @@ steps: # - apt update -y # not needed with custom image # - apt install build-essential patchelf -y # not needed with custom image # - pip install nuitka # not needed with custom image - - python -m nuitka --onefile run.py --include-data-dir=./resources=resources --output-filename="ProxmoxDeploy${DRONE_TAG##v}" + # - python -m nuitka --onefile run.py --include-data-dir=./resources=resources --output-filename="ProxmoxDeploy${DRONE_TAG##v}" # not needed with new system with repo + - python -m nuitka --onefile run.py --output-filename="ProxmoxDeploy${DRONE_TAG##v}" - name: gitea_release image: plugins/gitea-release settings: diff --git a/README.md b/README.md index 3a9e333..4b8efa4 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,70 @@ Proxmox Deploy is a little script to manage my HomeLab with JSON file. As my homelab was growing I realised that it was harder and harder to keep everything in sync and up to date. So I decided to create a script to manage my Proxmox homelab. -# How to use it -Have a look at the resources folder to see how to use it. +# How it works +The concept is simple, you have a Git repository with a the following structure: +``` +. +├── config.json +├── lxc +│ ├── +│ │ ├── config.json +│ │ ├── +│ │ └── +│ └── +│ ├── ... +│── qemu +│ ├── +│ │ ├── config.json +│ │ ├── +│ │ └── +│ └── +│ ├── ... +│── scripts +│ ├── +│ └── ... +``` +*See below for more information about the structure and differents files* + +PDJ (Proxmox Deploy JSON) is a program that will read that repository files and execute the necessary commands to create/update your LXC/VM. +Now ideally you have some sort of Git actions like Drone/GitHub(/Gitea) Actions to run PDJ automatically when you push a change, which will result in your homelab being updated almost instantly. + +If you don't, no big deal, you'll just have to manually clone and update your repo, then start PDJ *(you could use a crontab with regular intervals)* + +# Usage +## Download +Download the pre-compiled binaries from the release page or build it yourself. + +## Build it yourself +```bash +# Build on Debian +git clone +cd ProxmoxDeploy +apt update && apt install -y build-essential patchelf +pip install nuitka +pip install -r requirements.txt +python -m nuitka --onefile run.py --output-filename="ProxmoxDeploy" +``` +*Also see the ``Dockerfile`` and ``.drone.yml`` for more information.* + +## Run it +```bash +# Run it +./ProxmoxDeploy --repo /path/to/repo +``` # Documentation - ## Configuration +### General +Before configuring your LXC and VM, you must decide how you'll run this program. +As it requires SSH for some actions, you have two options: +- Run it directly on the Proxmox VE host **(recommended)** *(refered as `local`)* + - No configuration needed + - You can use Git(ea)/Drone actions to run it automatically as soon as a change is pushed. +- Run it on another machine and connect via SSH + - You'll need to setup passwordless SSH connection between your machine and the Proxmox VE host. + ### Proxmox VE The Proxmox VE configuration is located in the `config.json` file. ```json