feat: first build of ProxLB
Some checks failed
Build / Build on AlmaLinux 8 (pull_request) Failing after 35s

- version 1.0.2
- setup gitea actions workflows
This commit is contained in:
Ben Vincent 2024-09-01 01:02:34 +10:00
parent 5b47fd7869
commit 104345fa17
5 changed files with 182 additions and 0 deletions

35
.drone.yml Normal file
View File

@ -0,0 +1,35 @@
kind: pipeline
type: docker
name: almalinux8
trigger:
event:
include:
- push
- pull_request
steps:
- name: build
image: git.query.consul/unkin/almalinux8:latest
commands:
# Install the required packages using custom repositories
- dnf install -y rpm cmake git make python3-yaml
# Run the `make` command
- make package
- name: upload
image: git.query.consul/unkin/almalinux8:latest
environment:
GITEA_PASSWORD:
from_secret: gitea_password
commands:
- >
for rpm in /drone/src/packages/*.rpm; do
curl --user droneci:$GITEA_PASSWORD --upload-file $rpm https://git.query.consul/api/packages/unkin/rpm/almalinux/el8/upload
done
when:
branch:
- master
event:
- push

View File

@ -0,0 +1,30 @@
name: Build
on:
pull_request:
jobs:
build:
name: Build on AlmaLinux 8
runs-on: almalinux-8
container:
image: git.query.consul/unkin/almalinux8:latest
steps:
- name: Install nodejs:20
run: |
dnf module enable -y nodejs:20
dnf install -y nodejs
- name: Checkout code
uses: actions/checkout@v3
- name: Install required packages
run: |
dnf install -y rpm cmake git make python3-yaml
- name: Build project
run: make build
- name: Find built packages
run: |
find /workspace | grep -E \.rpm$

View File

@ -0,0 +1,36 @@
name: Deploy
on:
push:
branches:
- master
jobs:
build:
name: Build on AlmaLinux 8
runs-on: almalinux-8
container:
image: git.query.consul/unkin/almalinux8:latest
steps:
- name: Install nodejs:20
run: |
dnf module enable -y nodejs:20
dnf install -y nodejs
- name: Checkout code
uses: actions/checkout@v3
- name: Install required packages
run: |
dnf install -y rpm cmake git make python3-yaml
- name: Build project
run: make build
- name: Upload RPMs
env:
DRONECI_PASSWORD: ${{ secrets.DRONECI_PASSWORD }}
run: |
for rpm in /workspace/src/rpmbuild/RPMS/*/*.rpm; do
curl --user droneci:${{ secrets.DRONECI_PASSWORD }} --upload-file $rpm https://git.query.consul/api/packages/unkin/rpm/almalinux/el8/upload
done

39
Makefile Normal file
View File

@ -0,0 +1,39 @@
# Makefile for building and packaging ProxLB as an RPM
VERSION=1.0.2
REPO_URL=https://github.com/gyptazy/ProxLB.git
BUILD_DIR=/workspace/build
PACKAGE_DIR=workspace/packages
REPO_DIR=/workspace/ProxLB
.PHONY: all clean download prepare build package
# Default target
all: download prepare build package
# Clone the repository if not already cloned
download:
@if [ ! -d "$(REPO_DIR)" ]; then \
echo "Cloning repository..."; \
git clone $(REPO_URL); \
fi
# Prepare directories
prepare: download
mkdir -p $(PACKAGE_DIR)
mkdir -p $(BUILD_DIR)
cd $(REPO_DIR) && git checkout v$(VERSION)
# Build the project
build: prepare
cd $(BUILD_DIR) && cmake ../$(REPO_DIR)/packaging
# Package the project
package: build
cd $(BUILD_DIR) && cpack -G RPM .
cp $(BUILD_DIR)/*.rpm $(PACKAGE_DIR)
# Clean up build and package directories
clean:
rm -rf $(BUILD_DIR) $(PACKAGE_DIR)
rm -rf $(REPO_DIR)

View File

@ -0,0 +1,42 @@
# ProxLB: RPM Packaging
## Overview
This project provides a Makefile and script to build an RPM package for the ProxLB software. The Makefile automates the process of cloning the ProxLB repository, configuring the build environment with CMake, compiling the source code, and packaging the application into an RPM. This makes it easy to deploy ProxLB in environments that use RPM-based package management.
## Features
- **Automated Build and Packaging**: Uses a Makefile to streamline the process of cloning the repository, creating build directories, compiling the source code, and generating an RPM package.
- **Easy Deployment**: The generated RPM package can be easily installed on any system that supports RPM, simplifying the deployment process for ProxLB.
- **Customisable**: The Makefile can be modified to adjust build configurations, target different versions, or alter the packaging process as needed.
## Requirements
- **Git**: To clone the ProxLB repository.
- **CMake**: For configuring the build system.
- **CPack**: To create the RPM package.
## Installation
1. **Clone the Repository**: Download this repository to your local machine.
```bash
git clone https://git.query.consul/unkin/rpmbuild-proxlb.git
cd rpmbuild-proxlb
```
2. **Prepare the Environment**: Ensure all dependencies (Git, CMake, CPack and RPM) are installed on your system.
3. **Build and Package**: Run the Makefile to build and package ProxLB.
```bash
make package
```
4. **Clean Up**: Optionally, run `make clean` to remove all generated files and directories.
## Contributing
Contributions are welcome! Please fork this repository, make your changes, and submit a pull request.
## Acknowledgments
This project is maintained by the community. Thanks to all contributors!