Skip to content

Commit

Permalink
Merge pull request #756 from sever-sever/T6674-circ
Browse files Browse the repository at this point in the history
T6674: Add build-scrips for packages without Jenkins
  • Loading branch information
c-po authored Sep 8, 2024
2 parents 7012274 + c9a5a93 commit 917325f
Show file tree
Hide file tree
Showing 117 changed files with 4,852 additions and 0 deletions.
198 changes: 198 additions & 0 deletions .github/workflows/trigger_rebuild_packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
name: Trigger to build package

on:
push:
branches:
- circinus

jobs:
changes:
runs-on: ubuntu-latest

env:
REF: main # Used for curl to trigger build package

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}

- uses: dorny/paths-filter@v3
id: changes
with:
base: ${{ github.ref_name }}
filters: |
aws-gwlbtun:
- 'scripts/package-build/aws-gwlbtun/**'
ddclient:
- 'scripts/package-build/ddclient/**'
dropbear:
- 'scripts/package-build/dropbear/**'
ethtool:
- 'scripts/package-build/ethtool/**'
frr:
- 'scripts/package-build/frr/**'
hostap:
- 'scripts/package-build/hostap/**'
hsflowd:
- 'scripts/package-build/hsflowd/**'
isc-dhcp:
- 'scripts/package-build/isc-dhcp/**'
kea:
- 'scripts/package-build/kea/**'
keepalived:
- 'scripts/package-build/keepalived/**'
linux-kernel:
- 'data/defaults.toml'
- 'scripts/package-build/linux-kernel/**'
ndppd:
- 'scripts/package-build/ndppd/**'
net-snmp:
- 'scripts/package-build/net-snmp/**'
netfilter:
- 'scripts/package-build/netfilter/**'
opennhrp:
- 'scripts/package-build/opennhrp/**'
openvpn-otp:
- 'scripts/package-build/openvpn-otp/**'
owamp:
- 'scripts/package-build/owamp/**'
pam_tacplus:
- 'scripts/package-build/pam_tacplus/**'
pmacct:
- 'scripts/package-build/pmacct/**'
podman:
- 'scripts/package-build/podman/**'
pyhumps:
- 'scripts/package-build/pyhumps/**'
radvd:
- 'scripts/package-build/radvd/**'
strongswan:
- 'scripts/package-build/strongswan/**'
telegraf:
- 'scripts/package-build/telegraf/**'
waagent:
- 'scripts/package-build/waagent/**'
wide-dhcpv6:
- 'scripts/package-build/wide-dhcpv6/**'
- name: Trigger builds for changed packages
run: |
set -eux
function trigger_build() {
PACKAGE_NAME=$1
echo "${PACKAGE_NAME} change detected!"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ secrets.REMOTE_OWNER }}/${{ secrets.REMOTE_REUSE_REPO }}/actions/workflows/build-package.yml/dispatches \
-d '{"ref": "${{ env.REF }}", "inputs":{"package_name":"'"$PACKAGE_NAME"'", "gpg_key_id": "${{ secrets.GPG_KEY_ID }}", "package_branch": "${{ github.ref_name }}"}}'
}
# Trigger builds based on detected changes
if [ "${{ steps.changes.outputs.aws-gwlbtun }}" == "true" ]; then
trigger_build "aws-gwlbtun"
fi
if [ "${{ steps.changes.outputs.ddclient }}" == "true" ]; then
trigger_build "ddclient"
fi
if [ "${{ steps.changes.outputs.dropbear }}" == "true" ]; then
trigger_build "dropbear"
fi
if [ "${{ steps.changes.outputs.ethtool }}" == "true" ]; then
trigger_build "ethtool"
fi
if [ "${{ steps.changes.outputs.frr }}" == "true" ]; then
trigger_build "frr"
fi
if [ "${{ steps.changes.outputs.hostap }}" == "true" ]; then
trigger_build "hostap"
fi
if [ "${{ steps.changes.outputs.hsflowd }}" == "true" ]; then
trigger_build "hsflowd"
fi
if [ "${{ steps.changes.outputs.isc-dhcp }}" == "true" ]; then
trigger_build "isc-dhcp"
fi
if [ "${{ steps.changes.outputs.kea }}" == "true" ]; then
trigger_build "kea"
fi
if [ "${{ steps.changes.outputs.keepalived }}" == "true" ]; then
trigger_build "keepalived"
fi
if [ "${{ steps.changes.outputs.linux-kernel }}" == "true" ]; then
trigger_build "linux-kernel"
fi
if [ "${{ steps.changes.outputs.ndppd }}" == "true" ]; then
trigger_build "ndppd"
fi
if [ "${{ steps.changes.outputs.net-snmp }}" == "true" ]; then
trigger_build "net-snmp"
fi
if [ "${{ steps.changes.outputs.netfilter }}" == "true" ]; then
trigger_build "netfilter"
fi
if [ "${{ steps.changes.outputs.opennhrp }}" == "true" ]; then
trigger_build "opennhrp"
fi
if [ "${{ steps.changes.outputs.openvpn-otp }}" == "true" ]; then
trigger_build "openvpn-otp"
fi
if [ "${{ steps.changes.outputs.owamp }}" == "true" ]; then
trigger_build "owamp"
fi
if [ "${{ steps.changes.outputs.pam_tacplus }}" == "true" ]; then
trigger_build "pam_tacplus"
fi
if [ "${{ steps.changes.outputs.pmacct }}" == "true" ]; then
trigger_build "pmacct"
fi
if [ "${{ steps.changes.outputs.podman }}" == "true" ]; then
trigger_build "podman"
fi
if [ "${{ steps.changes.outputs.pyhumps }}" == "true" ]; then
trigger_build "pyhumps"
fi
if [ "${{ steps.changes.outputs.radvd }}" == "true" ]; then
trigger_build "radvd"
fi
if [ "${{ steps.changes.outputs.strongswan }}" == "true" ]; then
trigger_build "strongswan"
fi
if [ "${{ steps.changes.outputs.telegraf }}" == "true" ]; then
trigger_build "telegraf"
fi
if [ "${{ steps.changes.outputs.waagent }}" == "true" ]; then
trigger_build "waagent"
fi
if [ "${{ steps.changes.outputs.wide-dhcpv6 }}" == "true" ]; then
trigger_build "ethtool"
fi
8 changes: 8 additions & 0 deletions scripts/package-build/aws-gwlbtun/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
aws-gwlbtun*/
*.tar.gz
*.tar.xz
*.deb
*.dsc
*.buildinfo
*.build
*.changes
1 change: 1 addition & 0 deletions scripts/package-build/aws-gwlbtun/build.py
59 changes: 59 additions & 0 deletions scripts/package-build/aws-gwlbtun/package.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[[packages]]
name = "aws-gwlbtun"
commit_id = "f78058a"
scm_url = "https://github.com/aws-samples/aws-gateway-load-balancer-tunnel-handler"


## Build cmd start
build_cmd = '''\
mkdir -p debian
echo 'obj-*-linux-gnu/gwlbtun usr/sbin' > debian/install
# changelog
cat <<EOF > debian/changelog
aws-gwlbtun (1.0-1) unstable; urgency=low
* Initial release
-- Your Name <your.email@example.com> Wed, 29 Aug 2024 09:00:00 +0000
EOF
# control
/bin/bash -c "cat <<EOF > debian/control
Source: aws-gwlbtun
Section: net
Priority: optional
Maintainer: VyOS Package Maintainers <maintainers@vyos.net>
Build-Depends: debhelper-compat (= 13)
Standards-Version: 4.5.1
Homepage: https://github.com/aws-samples/aws-gateway-load-balancer-tunnel-handler
Package: aws-gwlbtun
Architecture: any
Depends: \${shlibs:Depends}, \${misc:Depends}
Description: AWS Gateway Load Balancer Tunnel Handler
This is a simple package that handles tunneling for the AWS Gateway Load Balancer.
EOF
"
# rules
cat <<EOF > debian/rules
#!/usr/bin/make -f
%: dh $@
build:
dh build
binary:
dh binary
clean:
dh clean
EOF
chmod +x debian/rules
debuild -us -uc -b
'''
## Build cmd end
Loading

0 comments on commit 917325f

Please sign in to comment.