You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This directory contains git hooks used in the AirStack repository.
4
+
5
+
## Available Hooks
6
+
7
+
### Docker Versioning Hook
8
+
9
+
The `update-docker-image-tag.pre-commit` hook automatically updates the `DOCKER_IMAGE_TAG` in the `.env` file with the current git commit hash whenever Docker-related files (Dockerfile or docker-compose.yaml) are modified. It also adds a comment above the variable indicating that the value is auto-generated from the git commit hash.
10
+
11
+
This ensures that Docker images are always tagged with the exact commit they were built from, eliminating version conflicts between parallel branches.
12
+
13
+
### Installation
14
+
15
+
To install the hooks:
16
+
17
+
1. Copy the hook to your local .git/hooks directory:
1. When you commit changes, the hook checks if any Dockerfile or docker-compose.yaml files are being committed
30
+
2. If Docker-related files are detected, it updates the DOCKER_IMAGE_TAG in the .env file with the current git commit hash and adds a comment above the variable
31
+
3. The modified .env file is automatically added to the commit
32
+
33
+
This approach eliminates version conflicts between parallel branches by ensuring Docker images are tagged with the exact commit they were built from.
This directory contains a git hook that automatically updates the Docker image tag with the current git commit hash.
4
+
5
+
## Hook: update-docker-image-tag.pre-commit
6
+
7
+
This pre-commit hook automatically updates the `DOCKER_IMAGE_TAG` in the `.env` file with the current git commit hash whenever Docker-related files (Dockerfile or docker-compose.yaml) are modified.
8
+
9
+
### Features
10
+
11
+
- Automatically updates `DOCKER_IMAGE_TAG` with the git commit hash
12
+
- Adds a comment above the variable indicating it's auto-generated
13
+
- Only triggers when Docker-related files are modified
14
+
- Automatically stages the modified .env file for commit
15
+
16
+
### Installation
17
+
18
+
To install the hook:
19
+
20
+
1. Copy the hook to your local .git/hooks directory:
0 commit comments