Skip to content

Commit 3c89776

Browse files
SckyzOclaude
andcommitted
docs: add comprehensive documentation for archive_name dict format
- Document both string pattern and dict format in manifest reference - Add real-world examples (NATS Exporter) in adding-exporters guide - Document all available template variables ({upstream_linux_arch}, etc.) - Add detailed use cases for when to use dict format - Update CHANGELOG.md with new feature entry Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent eeaef28 commit 3c89776

File tree

3 files changed

+82
-2
lines changed

3 files changed

+82
-2
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3333
* **Enhanced Cards:** Build dates displayed below "Updated" badges with short date format.
3434
* **Build Status:** Real-time availability tracking with "success", "pending", and "failed" states.
3535

36+
### ✨ Enhanced Features
37+
38+
* **Flexible Archive Naming:** Added dict format support for `archive_name` field to handle per-architecture patterns.
39+
* **String Pattern:** Original template variable format (e.g., `{name}-{clean_version}-{arch}.tar.gz`).
40+
* **Dict Format:** New per-architecture mapping for inconsistent upstream naming.
41+
* **New Variables:** Added `{upstream_linux_arch}` variable for mixed conventions (x86_64, arm64).
42+
* **Schema Validation:** Marshmallow validation ensures correct format usage.
43+
* **Use Case:** Handles upstreams with completely different naming per architecture (e.g., NATS Exporter).
44+
3645
### 🐛 Bug Fixes
3746

3847
* **DEB Template Issues:** Fixed `debian/rules` template to use correct `build_source` field for extra files.

docs/user-guide/adding-exporters.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,43 @@ upstream:
6767
type: github
6868
repo: owner/my_exporter
6969
strategy: latest_release
70-
# Optional: custom archive naming pattern
71-
archive_name: "{name}-{clean_version}-linux-{arch}.tar.gz"
70+
```
71+
72+
#### Custom Archive Naming
73+
74+
If the upstream release artifacts don't follow standard naming conventions, you can define custom patterns:
75+
76+
**Option 1: String Pattern (Most Common)**
77+
```yaml
78+
upstream:
79+
archive_name: "{name}-{clean_version}-linux-{upstream_linux_arch}.tar.gz"
80+
```
81+
82+
Available variables:
83+
- `{name}`, `{version}`, `{clean_version}`: Project identifiers
84+
- `{arch}`: Standard (amd64, arm64)
85+
- `{rpm_arch}`: RPM convention (x86_64, aarch64)
86+
- `{deb_arch}`: DEB convention (amd64, arm64)
87+
- `{upstream_linux_arch}`: Mixed convention (x86_64, arm64)
88+
89+
**Option 2: Dict Format (Per-Architecture Patterns)**
90+
```yaml
91+
upstream:
92+
archive_name:
93+
amd64: "my_exporter-v{clean_version}-x86_64-special.tar.gz"
94+
arm64: "my_exporter-v{clean_version}-arm64-custom.tar.gz"
95+
```
96+
97+
Use the dict format when upstream uses completely different naming per architecture.
98+
99+
**Real-World Example: NATS Exporter**
100+
```yaml
101+
# NATS uses mixed convention: x86_64 for amd64, arm64 for arm64
102+
upstream:
103+
archive_name: "prometheus-nats-exporter-v{clean_version}-linux-{upstream_linux_arch}.tar.gz"
104+
# Resolves to:
105+
# - amd64: prometheus-nats-exporter-v0.19.1-linux-x86_64.tar.gz
106+
# - arm64: prometheus-nats-exporter-v0.19.1-linux-arm64.tar.gz
72107
```
73108

74109
### Build Configuration

docs/user-guide/manifest-reference.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,42 @@ For the full manifest schema with all available options, see the [manifest.refer
5252
- `strategy`: `latest_release` (default) or `pinned`
5353
- `archive_name`: Custom archive name pattern (optional)
5454

55+
#### Archive Name Patterns
56+
57+
The `archive_name` field supports two formats for handling non-standard upstream naming:
58+
59+
**1. String Pattern (Most Common)**
60+
61+
Use template variables for simple patterns:
62+
63+
```yaml
64+
archive_name: "{name}-{clean_version}.linux-{arch}.tar.gz"
65+
```
66+
67+
Available variables:
68+
- `{name}`: Exporter name
69+
- `{version}`: Raw version (e.g., v1.0.0)
70+
- `{clean_version}`: Version without 'v' prefix (e.g., 1.0.0)
71+
- `{arch}`: Standard arch (amd64, arm64)
72+
- `{rpm_arch}`: RPM convention (x86_64, aarch64)
73+
- `{deb_arch}`: DEB convention (amd64, arm64)
74+
- `{upstream_linux_arch}`: Mixed convention (x86_64, arm64)
75+
76+
**2. Dict Format (Per-Architecture Patterns)**
77+
78+
Use when upstream has completely different naming per architecture:
79+
80+
```yaml
81+
archive_name:
82+
amd64: "project-v{clean_version}-x86_64-special.tar.gz"
83+
arm64: "project-v{clean_version}-arm64-custom.tar.gz"
84+
```
85+
86+
This is useful when:
87+
- Upstream uses inconsistent naming across architectures
88+
- Each architecture has a unique file structure
89+
- Standard variables don't provide enough flexibility
90+
5591
### Build
5692

5793
- `method`: `binary_repack` or `source_build`

0 commit comments

Comments
 (0)