Dployer
is a C-based deployment tool designed to manage and deploy repositories with Docker. The project is structured for easy configuration and flexibility, supporting both macOS and Linux environments.
Ensure that you have the following installed:
- CMake (version 3.15 or higher)
- SQLite3
- JSON-C library
- Docker
- Git
-
Clone the repository:
git clone https://github.com/mrfansi/dployer.git cd dployer
-
Build using CMake:
mkdir build cd build cmake .. make
-
Install the binary and configuration files to
{HOME}/.config/dployer
:make install
By default, Dployer
uses configuration files located in {HOME}/.config/dployer/config
. The directory should contain subdirectories like laravel
and static-php
that hold the necessary Docker configuration files.
Example structure:
~/.config/dployer/
├── config/
│ ├── laravel/
│ │ └── Dockerfile
│ └── static-php/
│ └── Dockerfile
└── repositories/
After building and installing, you can run Dployer
from the terminal:
~/.config/dployer/dployer
This will launch an interactive mini terminal where you can run various commands to manage your repositories.
new
- Create a new repository entry.list
- List all repositories.update
- Update all repositories.update <ID>
- Update a specific repository by ID.switch <ID> <BRANCH_OR_TAG>
- Switch to a specific branch or tag for a repository.deploy
- Deploy all repositories.deploy <ID>
- Deploy a specific repository by ID.exit
,quit
- Exit the mini terminal.help
- Show the help message.
- src/: Source code files.
main.c
: The main entry point.logger.c
/logger.h
: Handles logging.database.c
/database.h
: Manages database interactions.repo.c
/repo.h
: Handles repository management.deploy.c
/deploy.h
: Manages deployment processes.docker.c
/docker.h
: Docker-related operations.utils.c
/utils.h
: Utility functions.
To add new features:
- Create or modify source files in the
src/
directory. - Include the appropriate headers in your new files.
- Update
CMakeLists.txt
to include new source files.
To rebuild the project after making changes:
cd build
make
Then, run the dployer
binary as usual:
~/.config/dployer/dployer
This project is licensed under the MIT License - see the LICENSE file for details.