Sign inSign up

sourceboat/docker-compose-githooks

By sourceboat

•Updated over 2 years ago

Easily manage Git Hooks in a Docker Compose setup.

Image
1

9.1K

sourceboat/docker-compose-githooks repository overview

⁠docker-compose-githooks

Docker Build Status Release Docker Pulls Image Size MicroBadger Layers

Easily manage and version control Git Hooks⁠ in a Docker Compose⁠ setup.

⁠Usage

Add a new service to your .docker-compose.yml file:

version: '3.7'
services:
  
  // ...
  
  githooks:
    image: sourceboat/docker-compose-githooks:latest
    volumes:
      - ./.git:/tmp/.git
      - ./.githooks:/tmp/.githooks

Now you can manage and version control your Git Hooks in the .githooks directory of your repository. Everytime you run docker-compose up the githooks service will create symlinks in .git/hooks to all files found in the .githooks directory.

For example you can create a .githooks/pre-commit file to run your linters inside your running containers:

#!/bin/sh
echo 'running pre-commit hook...'
docker-compose exec -T app yarn lint

⁠Changelog

Check releases⁠ for all notable changes.

⁠Credits

⁠License

The MIT License (MIT). Please see License File⁠ for more information.

Tag summary

Content type

Image

Digest

Size

754.7 kB

Last updated

almost 5 years ago

docker pull sourceboat/docker-compose-githooks