Commit Graph

9 Commits

Author SHA1 Message Date
64c360f391 fix: Simplify sed patterns for values.yaml tag updates
Some checks failed
Helm Chart Release / release-chart (push) Successful in 13s
Update Docker Images and Helm Chart / update (push) Failing after 16s
The complex sed range-based patterns were failing to properly match and
replace Docker image tags in values.yaml. Replace with simpler, more
reliable patterns that directly match the full tag format.

Changes:
- WordPress: Match tag pattern ending with -php[0-9.]*-fpm-alpine
- Nginx: Match tag pattern ending with -alpine-perl
- Simpler single-line patterns reduce complexity and improve reliability

The new patterns:
- WordPress: s|tag: "[0-9.]*-php[0-9.]*-fpm-alpine"|tag: "NEW_VERSION"|
- Nginx: s|tag: "[0-9.]*-alpine-perl"|tag: "NEW_VERSION"|

These patterns are:
1. More specific - only match the intended tag lines
2. Simpler - single sed command per image (no range selection)
3. More reliable - less dependent on surrounding YAML structure
4. Easier to understand and maintain

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-02-12 09:40:20 +09:00
71278b4036 refactor: Use shared variables for Docker version management
Some checks failed
Helm Chart Release / release-chart (push) Successful in 12s
Update Docker Images and Helm Chart / update (push) Failing after 16s
Refactor the workflow to use shared variables ($GITHUB_OUTPUT) for version
information, improving code maintainability and reducing redundancy.

Changes:
- Add version_base output to Fetch WordPress step (e.g., "6.9.1")
- Add version_base output to Fetch Nginx step (e.g., "1.29.5")
- Update values.yaml step to use shared variables
  - Reference steps.wordpress.outputs.version_base instead of parsing
  - Reference steps.wordpress.outputs.version (full tag) and steps.nginx.outputs.version
- Update Increment chart version step
  - Use steps.wordpress.outputs.version_base directly for Chart.yaml version
  - Eliminate redundant parsing of values.yaml

Benefits:
1. Single source of truth: Version extracted once in fetch steps
2. Reduced code complexity: Eliminate multiple sed/grep operations
3. Better maintainability: Changes to version format only need updating fetch steps
4. Clearer logic: Each step has clear responsibility
5. Improved reliability: Less error-prone than multiple parsing operations

Version flow:
1. Fetch WordPress → outputs: version, version_base
2. Fetch Nginx → outputs: version, version_base
3. Update values.yaml → uses version (full tag)
4. Increment chart version → uses version_base

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-02-12 09:34:07 +09:00
0a1f08aa79 fix: Improve values.yaml update mechanism with sed instead of awk
Some checks failed
Helm Chart Release / release-chart (push) Successful in 13s
Update Docker Images and Helm Chart / update (push) Failing after 16s
Replace complex awk-based parsing with simpler sed-based approach for updating
Docker image tags in values.yaml. The previous awk logic had issues detecting
changes properly.

Changes:
- Use sed for both WordPress and Nginx tag replacements (more reliable)
- Simplify version extraction using sed and cut commands
- Fix backfile creation to avoid overwriting during edits
- Add debug output showing current and new versions
- Improve error handling in diff command (redirect stderr)

The sed approach:
1. Matches the image section (wordpress: or nginx:)
2. Performs substitution until the next top-level key
3. Directly replaces the entire tag value with quotes

This ensures:
- Correct YAML structure preservation
- Reliable change detection
- Accurate version comparison for Chart.yaml update decision

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-02-12 09:22:47 +09:00
d970cfa84a fix: Improve release process with proper error handling and retry logic
All checks were successful
Helm Chart Release / release-chart (push) Successful in 12s
Update Docker Images and Helm Chart / update (push) Successful in 15s
Enhance the release tag creation and Helm package push procedures:

Create Helm package improvements:
- Add retry logic for git push (up to 3 attempts)
- Rebase on failure to resolve conflicts
- Fail with exit 1 if push ultimately fails (was silently ignored)
- Log success message

Create release tag improvements:
- Check if tag already exists before creating (avoid duplicate creation)
- Add retry logic for tag push (up to 3 attempts)
- Fail with exit 1 if push ultimately fails (prevents silent failures)
- Suppress error output during retry to keep logs clean
- Better logging of tag creation and push success

These changes ensure that:
1. Failed releases don't go unnoticed (exit 1 instead of ignoring)
2. Transient network issues are handled gracefully (retry mechanism)
3. Duplicate tags are avoided
4. Release artifacts are reliably pushed to remote

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-02-12 08:19:59 +09:00
20081bdda9 fix: Update both version and appVersion in Chart.yaml during WordPress updates
All checks were successful
Helm Chart Release / release-chart (push) Successful in 12s
Update Docker Images and Helm Chart / update (push) Successful in 16s
When WordPress version changes, both Chart.yaml fields should be updated to match:
- version: WordPress version (e.g., 6.9.4)
- appVersion: WordPress version (e.g., 6.9.4)

Previously only 'version' was updated while 'appVersion' remained stale.

Changes:
- Extract current appVersion before update
- Update appVersion with sed command (in addition to version)
- Log both version and appVersion changes

This ensures Chart.yaml always reflects the actual WordPress version deployed.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-02-12 08:18:06 +09:00
512c80ab53 fix: Do not carry over suffix when WordPress version updates
All checks were successful
Helm Chart Release / release-chart (push) Successful in 15s
Update Docker Images and Helm Chart / update (push) Successful in 19s
When WordPress version changes (e.g., 6.9.3 → 6.9.4), Chart.yaml should use
the new WordPress version WITHOUT any suffix.

Suffix (-a, -b, etc.) is only used for multiple releases within the SAME
WordPress version when non-WordPress changes occur.

Changes:
- Simplify Increment chart version step to directly use new WordPress version
- Remove complex suffix handling logic (only needed for non-WordPress updates)
- Extract WordPress version from values.yaml and apply as Chart version

Examples:
- 6.9.3-a + WordPress update → 6.9.4 (no suffix)
- 6.9.4 + Nginx update → 6.9.4-a (suffix added for non-WordPress changes)
- 6.9.4-a + Nginx update → 6.9.4-b (suffix incremented)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-02-10 19:31:01 +09:00
7959242e1a fix: Fix workflow to update Chart.yaml only when WordPress version changes
All checks were successful
Helm Chart Release / release-chart (push) Successful in 13s
Update Docker Images and Helm Chart / update (push) Successful in 17s
Refactor the image-update-and-release workflow to correctly handle Chart.yaml updates:

Changes:
- Add chart_version_update_needed flag in Update values.yaml step
  - Compares WordPress version before/after update
  - Only sets flag=true if WordPress version actually changed
- Modify Increment chart version step to run only when chart_version_update_needed=true
  - Implement proper suffix handling for versions like 6.9.3-a, 6.9.3-b, etc
  - Support upgrading base version without suffix to add -a suffix
- Update Commit and push changes step
  - Always add values.yaml
  - Only add Chart.yaml if WordPress version was updated
- Update Create Helm package and Create release tag steps
  - Only run if Chart.yaml was updated (chart_version_update_needed=true)
- Update Summary step to show whether Chart.yaml was updated

This prevents Chart.yaml from being updated when only Nginx or other images change,
avoiding version number regression issues (e.g., 6.9.3 -> 6.9.4 when only Nginx updated).

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-02-10 19:28:38 +09:00
81a9b35689 fix: Handle image version updates gracefully when no changes detected
All checks were successful
Helm Chart Release / release-chart (push) Successful in 12s
Update Docker Images and Helm Chart / update (push) Successful in 20s
Changed the 'Update values.yaml' step to skip error exit when no version updates
are available. Instead of failing with exit 1, the workflow now logs an INFO
message and continues execution, allowing the workflow to complete successfully
when versions are already up to date.

- Changed ERROR message to INFO message
- Replaced exit 1 with conditional logic
- Added else clause to log when changes are detected

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-02-10 14:00:52 +09:00
db31200572 .gitea/workflows/image-update-and-release.yaml を更新
Some checks failed
Helm Chart Release / release-chart (push) Successful in 11s
Update Docker Images and Helm Chart / update (push) Failing after 16s
2026-02-10 04:52:59 +00:00