Compare commits
2 Commits
089935525b
...
5e685381cb
| Author | SHA1 | Date | |
|---|---|---|---|
| 5e685381cb | |||
| 4b8c91d957 |
@@ -1,5 +1,4 @@
|
|||||||
name: Zabbix APK Builder
|
name: Zabbix APK Builder
|
||||||
run-name: ${{ gitea.actor }} is building Zabbix APK packages 🚀
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# Trigger on pushes to main/test branch
|
# Trigger on pushes to main/test branch
|
||||||
@@ -26,6 +25,8 @@ jobs:
|
|||||||
- name: Check for new Zabbix version
|
- name: Check for new Zabbix version
|
||||||
id: version-check
|
id: version-check
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
# Install jq for JSON parsing
|
# Install jq for JSON parsing
|
||||||
sudo apt-get update && sudo apt-get install -y jq
|
sudo apt-get update && sudo apt-get install -y jq
|
||||||
|
|
||||||
@@ -45,7 +46,7 @@ jobs:
|
|||||||
echo "latest_version=$LATEST_VERSION" >> $GITHUB_OUTPUT
|
echo "latest_version=$LATEST_VERSION" >> $GITHUB_OUTPUT
|
||||||
echo "Latest version: $LATEST_VERSION"
|
echo "Latest version: $LATEST_VERSION"
|
||||||
|
|
||||||
# Determine if we should build (remove workflow_dispatch reference)
|
# Determine if we should build
|
||||||
if [ "$CURRENT_VERSION" != "$LATEST_VERSION" ]; then
|
if [ "$CURRENT_VERSION" != "$LATEST_VERSION" ]; then
|
||||||
echo "should_build=true" >> $GITHUB_OUTPUT
|
echo "should_build=true" >> $GITHUB_OUTPUT
|
||||||
echo "Build required: Version changed"
|
echo "Build required: Version changed"
|
||||||
@@ -63,10 +64,12 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITEA_TOKEN }}
|
token: ${{ secrets.ACCESS_TOKEN }}
|
||||||
|
|
||||||
- name: Update APKBUILD version
|
- name: Update APKBUILD version
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
LATEST_VERSION="${{ needs.check-version.outputs.latest_version }}"
|
LATEST_VERSION="${{ needs.check-version.outputs.latest_version }}"
|
||||||
CURRENT_VERSION="${{ needs.check-version.outputs.current_version }}"
|
CURRENT_VERSION="${{ needs.check-version.outputs.current_version }}"
|
||||||
|
|
||||||
@@ -104,12 +107,16 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Zabbix packages
|
- name: Build Zabbix packages
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
cd zabbix-apk-builder
|
cd zabbix-apk-builder
|
||||||
chmod +x build.sh
|
chmod +x build.sh
|
||||||
./build.sh
|
./build.sh
|
||||||
|
|
||||||
- name: List built packages
|
- name: List built packages
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
echo "Built packages:"
|
echo "Built packages:"
|
||||||
ls -la zabbix-apk-builder/packages/
|
ls -la zabbix-apk-builder/packages/
|
||||||
|
|
||||||
@@ -137,6 +144,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Test deployment in Alpine container
|
- name: Test deployment in Alpine container
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
echo "Testing package installation..."
|
echo "Testing package installation..."
|
||||||
|
|
||||||
# Test agent package
|
# Test agent package
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
name: Gitea Actions Demo
|
|
||||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
|
||||||
on: [push]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
Explore-Gitea-Actions:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
|
|
||||||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
|
||||||
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
|
||||||
- name: Check out repository code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
|
||||||
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
|
|
||||||
- name: List files in the repository
|
|
||||||
run: |
|
|
||||||
ls ${{ gitea.workspace }}
|
|
||||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
|
||||||
@@ -7,9 +7,9 @@ Automated Alpine Linux package builder for Zabbix Agent and Proxy with CI/CD pip
|
|||||||
- 🔄 **Automatic Version Detection**: Monitors Zabbix releases using official Bitbucket API
|
- 🔄 **Automatic Version Detection**: Monitors Zabbix releases using official Bitbucket API
|
||||||
- 🏗️ **Docker-based Building**: Consistent, reproducible builds in isolated environment
|
- 🏗️ **Docker-based Building**: Consistent, reproducible builds in isolated environment
|
||||||
- 🚀 **CI/CD Pipeline**: Full automation from version detection to package deployment
|
- 🚀 **CI/CD Pipeline**: Full automation from version detection to package deployment
|
||||||
- 📦 **Multi-package Support**: Builds agent, proxy, and main packages
|
- 📦 **Multi-package Support**: Builds agent and proxy packages
|
||||||
- 🧪 **Automated Testing**: Tests package installation in Alpine containers
|
- 🧪 **Automated Testing**: Tests package installation in Alpine containers
|
||||||
- 📊 **Gitea Integration**: Publishes packages to your private Gitea repository
|
- 📊 **Gitea Integration**: Publishes packages to Gitea repository
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
@@ -17,11 +17,11 @@ Automated Alpine Linux package builder for Zabbix Agent and Proxy with CI/CD pip
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Clone this repository
|
# Clone this repository
|
||||||
git clone <your-repo-url>
|
git clone https://git.mbuz.uk/mbuz/Zabbix.git
|
||||||
cd zabbix-apk-builder
|
cd zabbix-apk-builder
|
||||||
|
|
||||||
# Make build script executable
|
# Make build script executable
|
||||||
chmod +x build.sh setup-cicd.sh
|
chmod +x build.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Manual Build
|
### 2. Manual Build
|
||||||
@@ -48,19 +48,14 @@ ls -la packages/
|
|||||||
### Built Packages
|
### Built Packages
|
||||||
|
|
||||||
1. **zabbix-agent** - Zabbix Agent only
|
1. **zabbix-agent** - Zabbix Agent only
|
||||||
2. **zabbix-proxy** - Zabbix Proxy (without LDAP)
|
2. **zabbix-proxy** - Zabbix Proxy
|
||||||
3. **zabbix** - Main package with libraries
|
3. **zabbix** - Meta package
|
||||||
|
|
||||||
### Current Version
|
### Current Version
|
||||||
|
|
||||||
- **Zabbix Version**: 7.4.2
|
- **Zabbix Version**: 7.4.2
|
||||||
- **Alpine Base**: 3.18
|
- **Alpine Base**: latest
|
||||||
- **Architecture**: x86_64
|
- **Architecture**: all
|
||||||
|
|
||||||
### Dependencies Removed
|
|
||||||
|
|
||||||
- LDAP support removed from proxy build
|
|
||||||
- Simplified configuration for smaller footprint
|
|
||||||
|
|
||||||
## CI/CD Pipeline
|
## CI/CD Pipeline
|
||||||
|
|
||||||
@@ -68,7 +63,7 @@ ls -la packages/
|
|||||||
|
|
||||||
- **Daily**: Checks for new Zabbix versions at 6 AM UTC
|
- **Daily**: Checks for new Zabbix versions at 6 AM UTC
|
||||||
- **Push**: Builds when code changes in main/test branches
|
- **Push**: Builds when code changes in main/test branches
|
||||||
- **Manual**: Force builds via GitHub Actions
|
- **Manual**: Force builds via Gitea Actions
|
||||||
|
|
||||||
### Version Detection
|
### Version Detection
|
||||||
|
|
||||||
@@ -97,15 +92,17 @@ GITEA_SSH_KEY # SSH private key for Gitea access
|
|||||||
|
|
||||||
```
|
```
|
||||||
.
|
.
|
||||||
├── APKBUILD # Alpine package definition
|
└── zabbix-git
|
||||||
├── build.sh # Build automation script
|
└── zabbix-apk-builder
|
||||||
├── Dockerfile # Build environment
|
├── .gitea/workflows # Workflows for Gitea actions
|
||||||
├── .github/workflows/ # CI/CD pipeline
|
├── .gitignore # Ignore files
|
||||||
├── packages/ # Built packages
|
├── APKBUILD # APKBUILD file for Zabbix
|
||||||
├── zabbix-agent.initd # Agent init script
|
├── Dockerfile # Dockerfile for building packages
|
||||||
├── zabbix-agent.confd # Agent config
|
├── README.md # Project description
|
||||||
├── zabbix-proxy.initd # Proxy init script
|
├── build.sh # Script for manual builds
|
||||||
└── zabbix-proxy.confd # Proxy config
|
├── packages/ # Directory for built packages
|
||||||
|
├── zabbix-agent.* # Agent configuration files
|
||||||
|
└── zabbix-proxy.* # Proxy configuration files
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@@ -191,45 +188,8 @@ curl -s "https://git.zabbix.com/rest/api/1.0/projects/ZBX/repos/zabbix/tags?limi
|
|||||||
sort -V | tail -1
|
sort -V | tail -1
|
||||||
```
|
```
|
||||||
|
|
||||||
### CI/CD Issues
|
|
||||||
|
|
||||||
1. Check GitHub Actions logs
|
|
||||||
2. Verify SSH key permissions
|
|
||||||
3. Test Gitea connectivity
|
|
||||||
4. Validate APKBUILD syntax
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
- **[CI-CD-DOCS.md](CI-CD-DOCS.md)**: Comprehensive CI/CD documentation
|
|
||||||
- **[setup-cicd.sh](setup-cicd.sh)**: Setup script for CI/CD configuration
|
|
||||||
|
|
||||||
## Security
|
|
||||||
|
|
||||||
- Uses SSH keys for Gitea access
|
|
||||||
- Minimal package dependencies
|
|
||||||
- Regular security updates via automated builds
|
|
||||||
- No secrets stored in repository
|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
1. Fork the repository
|
|
||||||
2. Create feature branch
|
|
||||||
3. Test changes in `test` branch
|
|
||||||
4. Submit pull request to `main`
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This project follows the same license as Zabbix (GPL v2).
|
This project follows the same license as Zabbix (AGPLv3).
|
||||||
|
|
||||||
## Support
|
|
||||||
|
|
||||||
For issues:
|
|
||||||
1. Check troubleshooting section
|
|
||||||
2. Review CI/CD logs
|
|
||||||
3. Test manual build process
|
|
||||||
4. Check Zabbix API connectivity
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Built with ❤️ for Alpine Linux and Zabbix monitoring**
|
|
||||||
# Workflow test - Wed Sep 3 19:02:19 CEST 2025
|
|
||||||
|
|||||||
Reference in New Issue
Block a user