make-deploy/README.md

72 lines
1.7 KiB
Markdown
Raw Normal View History

2022-09-20 16:44:01 +00:00
# make-deploy
A simple Makefile based deployment system.
2023-05-10 08:59:48 +00:00
make-deploy was initially hosted at https://git.dnix.de/an/make-deploy. Since it has become heavily used at chefkoch.de for system deployments, and lots of code is committed there, we moved the repo to https://git.chefkoch.net/pub/make-deploy. A mirror still exists at https://git.dnix.de/mirror/make-deploy.
2023-05-10 08:58:25 +00:00
make-deploy is licensed under the terms of the MIT-License. See [LICENSE](LICENSE) for info.
2022-09-20 16:44:01 +00:00
## Installation
Clone make-deploy as a submodule into your repository:
2022-11-09 12:49:52 +00:00
$ git submodule add https://git.chefkoch.net/pub/make-deploy
2022-09-20 16:44:01 +00:00
Create a symlink to the Makefile:
$ ln -s make-deploy/Makefile .
Create `config.mk` (for common config options) and `secrets.mk` (for sensitive information, should be git-crypted) in your project.
Example `config.mk`:
DEPLOY_NAME = my-project
DEPLOY_PATH = /srv
DEPLOY_TYPE = compose
DEPLOY_HOSTS = server01.example.com server02.example.com
DOCKER_IMAGE = dr.example.com/my-project:latest
DOCKER_LOGIN = 1
DOCKER_REGISTRY = dr.example.com
SSH_USER = ci
Example `secrets.mk`:
DOCKER_USER = root
DOCKER_PASS = secret1234
## Usage
### Start the deployment process
make deploy
### Create docker contexts for the target hosts
make create-docker-contexts
2022-09-29 08:25:43 +00:00
### Update make-deploy submodule in your project
make self-update
### Available options for DEPLOY_TYPE
2022-11-09 12:49:52 +00:00
copy, compose, swarm, k8s (TBD), helm, cron (TBD)
2022-09-29 08:25:43 +00:00
#### copy
Just copy the repo to the remote location(s). Put additional logic into pre- and post-deploy.sh.
#### compose
Docker Compose deployment.
##### swarm
Docker Swarm deployment.
##### k8s, helm, cron
To be implemented.