|
| 1 | +# Version Management Changes |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +The version tracking system for Docker images has been simplified for local development. This document explains the changes and how to use the new system. |
| 6 | + |
| 7 | +## What Changed |
| 8 | + |
| 9 | +### Before |
| 10 | +- `.local.env` file tracked version numbers for all Docker images |
| 11 | +- Every local build incremented the version number |
| 12 | +- Version numbers were stored and tracked in version control |
| 13 | + |
| 14 | +### After |
| 15 | +- Local builds now always use `:latest` tag |
| 16 | +- No version tracking needed for local development |
| 17 | +- `.local.env` is deprecated for local builds (kept for backward compatibility) |
| 18 | +- `.gcp.env` still tracks versions for GCP deployments |
| 19 | + |
| 20 | +## Benefits |
| 21 | + |
| 22 | +1. **Simplified Development**: No need to track version numbers during local development |
| 23 | +2. **Cleaner Git History**: No more version number updates cluttering commits |
| 24 | +3. **Easier Collaboration**: No conflicts from version number changes |
| 25 | +4. **Consistent with Docker Best Practices**: Using `:latest` for local dev is standard |
| 26 | + |
| 27 | +## Usage |
| 28 | + |
| 29 | +### Building Images Locally |
| 30 | + |
| 31 | +```bash |
| 32 | +# Build a single image (always uses :latest) |
| 33 | +./ops-scripts/base/build-images.sh local --sentrius |
| 34 | + |
| 35 | +# Build all images (always uses :latest) |
| 36 | +./ops-scripts/base/build-images.sh local --all |
| 37 | +``` |
| 38 | + |
| 39 | +### Deploying Locally |
| 40 | + |
| 41 | +```bash |
| 42 | +# Deploy to local Kubernetes (uses :latest tags) |
| 43 | +./ops-scripts/local/deploy-helm.sh |
| 44 | +``` |
| 45 | + |
| 46 | +### Building for GCP |
| 47 | + |
| 48 | +```bash |
| 49 | +# Build for GCP (still uses version tracking from .gcp.env) |
| 50 | +./ops-scripts/base/build-images.sh gcp --sentrius |
| 51 | + |
| 52 | +# Versions are automatically incremented and stored in .gcp.env |
| 53 | +``` |
| 54 | + |
| 55 | +## Migration Guide |
| 56 | + |
| 57 | +If you have existing local deployments: |
| 58 | + |
| 59 | +1. **No action required** - The changes are backward compatible |
| 60 | +2. Existing images with version tags will continue to work |
| 61 | +3. New builds will create `:latest` tags alongside any existing versioned images |
| 62 | +4. Next time you build, the `:latest` tag will be used |
| 63 | + |
| 64 | +## File Reference |
| 65 | + |
| 66 | +- `.env` - Legacy reference file (deprecated) |
| 67 | +- `.local.env` - Local version tracking (deprecated, kept for compatibility) |
| 68 | +- `.gcp.env` - GCP version tracking (still active and required for GCP deployments) |
| 69 | +- `.env.bak`, `.local.env.bak`, `.gcp.env.bak` - Backup files (gitignored) |
| 70 | + |
| 71 | +## Technical Details |
| 72 | + |
| 73 | +### Build Script Changes |
| 74 | + |
| 75 | +The `build-images.sh` script now: |
| 76 | +1. Only loads `.env` file when building for GCP |
| 77 | +2. Sets version to "latest" for local builds before calling `build_image()` |
| 78 | +3. Skips version increment and env file updates for local builds |
| 79 | + |
| 80 | +### Deploy Script Changes |
| 81 | + |
| 82 | +The `deploy-helm.sh` script now: |
| 83 | +1. Sets all version variables to "latest" at startup |
| 84 | +2. Does not source `.local.env` |
| 85 | +3. Passes "latest" to all Helm `--set` commands for image tags |
| 86 | + |
| 87 | +## Troubleshooting |
| 88 | + |
| 89 | +### Images not found |
| 90 | + |
| 91 | +If you get "image not found" errors: |
| 92 | +```bash |
| 93 | +# Rebuild the images |
| 94 | +./ops-scripts/base/build-images.sh local --all |
| 95 | +``` |
| 96 | + |
| 97 | +### Want to use specific versions locally |
| 98 | + |
| 99 | +If you need specific versions for local testing, you can manually override: |
| 100 | +```bash |
| 101 | +# In deploy-helm.sh, temporarily set: |
| 102 | +SENTRIUS_VERSION="1.2.3" |
| 103 | +``` |
| 104 | + |
| 105 | +Or pass it to helm directly: |
| 106 | +```bash |
| 107 | +helm upgrade --install sentrius ./sentrius-chart \ |
| 108 | + --set sentrius.image.tag=1.2.3 \ |
| 109 | + ... |
| 110 | +``` |
0 commit comments