Deploys a specific tagged image on the machine
- Install the application
go install github.com/MuktadirHassan/deployer - Run
deployer -flag --options
- Versioned deployment
- Rollback to a specific version
- Zero downtime deployment
- -v, --version: Version of the image to deploy
- -r, --rollback: Rollback to a specific version
- -h, --help: Help
- -l, --list: List all the versions available (Not implemented yet)
- -c, --config: Path to the configuration file
- -i, --image: Name of the image to deploy
.env file with necessary environment variables deployer.yaml file with necessary configurations
name: Project Name
projects:
- name: Project 1
env_path: .env
configs:
- name: Config 1
content: |
key: value
- name: Project 2
env_path: .env
docker swarm init
docker stack deploy -c docker-compose.yml <stack_name>version: '3.7'
services:
<service_name>:
image: <image_name>
ports:
- "8080:8080"
environment:
- key=value
networks:
- <network_name>
deploy:
replicas: 1
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
update_config:
parallelism: 2
delay: 10s
placement:
constraints:
- node.role == worker
resources:
limits:
cpus: '0.50'
memory: 50M
reservations:
cpus: '0.25'
memory: 20M`
networks:
<network_name>:
driver: overlay