Skip to content

Commit 3718b74

Browse files
committed
feat!: complete rehaul - implement dynamic node configuration system
BREAKING CHANGE: Transform static node monitoring into flexible ConfigMap-based architecture with hot-reload capabilities and comprehensive management tools. Major changes: - Replace hardcoded nodes (virt1, virt2, virt3) with ConfigMap definitions - Add configuration management CLI (config-manager.sh) - Implement hot-reload configuration without restarts - Enhanced web interface with rich metadata support - New deployment scripts for streamlined setup - Fix semantic versioning pipeline robustness Infrastructure updates: - ConfigMap integration in webserver deployment - Custom nginx configuration for config endpoint - Namespace-aware deployment (sensordash) - Backward compatibility with existing sensor data files This complete rehaul establishes the foundation for a professional, enterprise-ready monitoring solution with full configuration flexibility. Breaking changes require new deployment process using ConfigMap setup.
1 parent a5d9fc9 commit 3718b74

File tree

1 file changed

+31
-10
lines changed

1 file changed

+31
-10
lines changed

.github/workflows/build-dual-containers.yaml

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,34 @@ jobs:
3535
- name: Calculate semantic version
3636
id: version
3737
run: |
38+
set -e # Exit on any error
39+
3840
# Get the latest tag, or start with v0.0.0 if no tags exist
3941
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
4042
echo "Latest tag: $LATEST_TAG"
4143
4244
# Remove 'v' prefix for version calculation
4345
CURRENT_VERSION=${LATEST_TAG#v}
44-
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
46+
47+
# Parse version components with defaults
48+
if [[ "$CURRENT_VERSION" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
49+
MAJOR=${BASH_REMATCH[1]}
50+
MINOR=${BASH_REMATCH[2]}
51+
PATCH=${BASH_REMATCH[3]}
52+
else
53+
echo "Invalid version format: $CURRENT_VERSION, defaulting to 0.0.0"
54+
MAJOR=0
55+
MINOR=0
56+
PATCH=0
57+
fi
58+
59+
echo "Current version: $MAJOR.$MINOR.$PATCH"
4560
4661
# Get commits since last tag
4762
if [ "$LATEST_TAG" = "v0.0.0" ]; then
48-
COMMITS=$(git log --pretty=format:"%s" HEAD)
63+
COMMITS=$(git log --pretty=format:"%s" HEAD 2>/dev/null || echo "")
4964
else
50-
COMMITS=$(git log --pretty=format:"%s" ${LATEST_TAG}..HEAD)
65+
COMMITS=$(git log --pretty=format:"%s" ${LATEST_TAG}..HEAD 2>/dev/null || echo "")
5166
fi
5267
5368
echo "Commits since last tag:"
@@ -56,30 +71,36 @@ jobs:
5671
# Determine version bump based on conventional commits
5772
VERSION_TYPE="patch"
5873
59-
if echo "$COMMITS" | grep -qE "^(feat|feature)(\(.+\))?!:|^[^:]+!:"; then
74+
if echo "$COMMITS" | grep -qE "^(feat|feature)(\(.+\))?!:|^[^:]+!:" 2>/dev/null; then
6075
# Breaking change
6176
VERSION_TYPE="major"
62-
((MAJOR++))
77+
MAJOR=$((MAJOR + 1))
6378
MINOR=0
6479
PATCH=0
65-
elif echo "$COMMITS" | grep -qE "^(feat|feature)(\(.+\))?:"; then
80+
elif echo "$COMMITS" | grep -qE "^(feat|feature)(\(.+\))?:" 2>/dev/null; then
6681
# New feature
6782
VERSION_TYPE="minor"
68-
((MINOR++))
83+
MINOR=$((MINOR + 1))
6984
PATCH=0
70-
elif echo "$COMMITS" | grep -qE "^(fix|bugfix|perf|refactor)(\(.+\))?:"; then
85+
elif echo "$COMMITS" | grep -qE "^(fix|bugfix|perf|refactor)(\(.+\))?:" 2>/dev/null; then
7186
# Bug fix, performance improvement, or refactoring
7287
VERSION_TYPE="patch"
73-
((PATCH++))
88+
PATCH=$((PATCH + 1))
7489
else
7590
# Default to patch for any other changes
7691
VERSION_TYPE="patch"
77-
((PATCH++))
92+
PATCH=$((PATCH + 1))
7893
fi
7994
8095
NEW_VERSION="v${MAJOR}.${MINOR}.${PATCH}"
8196
echo "New version: $NEW_VERSION (${VERSION_TYPE} bump)"
8297
98+
# Validate the new version format
99+
if [[ ! "$NEW_VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
100+
echo "Error: Invalid version format generated: $NEW_VERSION"
101+
exit 1
102+
fi
103+
83104
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
84105
echo "version-type=$VERSION_TYPE" >> $GITHUB_OUTPUT
85106

0 commit comments

Comments
 (0)