Giter Club home page Giter Club logo

dccd's Introduction

dccd

Shellcheck

Bash tool for Docker Compose that does Continous Deployment (DCCD)

Overview

I run a small Kubernetes cluster at home where I use Renovate for dependency management and Flux for continuous deployment. Flux has spoiled me, but I've found nothing like it for my small Docker Compose setup (the stuff that isn't on K8s yet).

DCCD is a bash script that is meant to run via crontab. It checks the specified repo and branch for changes, compares the commits on the remote and local repos, and if necessary, updates the local repo and redeploys your Docker Compose applications.

Requirements

You'll obviously need to have git and docker compose installed.

Docker Compose files will need to be named docker-compose.yml, docker-compose.yaml, compose.yml or compose.yaml.

The script will redeploy all Docker Compose files if it finds the remote repo has changed (not just the individual files that have changed). Git is the source of truth.

Usage

The script is meant to run via crontab. The example below runs every 30th minute (i.e., XX:00 and XX:30).

*/30 * * * * /path/to/dccd.sh -b master -d /path/to/git_repo -l /tmp/dccd.txt -p -x ignore_this_directory

Usage examples are below.

    Usage: ./dccd.sh [OPTIONS]

    Options:
      -b <name>       Specify the remote branch to track (default: main)
      -d <path>       Specify the base directory of the git repository (required)
      -h              Show this help message
      -l <path>       Specify the path to the log file (default: /tmp/dccd.log)
      -p              Specify if you want to prune docker images (default: don't prune)
      -x <path>       Exclude directories matching the specified pattern (relative to the base directory)
      
    Example: /path/to/dccd.sh -b master -d /path/to/git_repo -l /tmp/dccd.txt -p -x ignore_this_directory

Alternatives

  • What about Portainer? Portainer Business Edition does gitops, but I'm trying to remove my dependency on Portainer.
  • What about Watchtower? Watchtower only works if the image tag is latest, and it checks for updates against a container image repo directly (e.g., DockerHub), not against Docker Compose files in a git repo.
  • What about Harbormaster? This comes close, but Harbormaster needs a specific configuration and the directory structure of the Docker Compose files has to be setup a specific way.

dccd's People

Contributors

chrishas35 avatar loganmarchione avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

chrishas35

dccd's Issues

podman-compose?

I´m running podman compose instead of Docker Compose. Is it possible to use this script with podman + podman compose?

Renovate Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/main.yml
  • actions/checkout v4

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.