TT#82051 Support GitHub actions + workflows using Debian package builds + shellcheck

While at it, provide README file for better visibility
at https://github.com/sipwise/ngcpcfg, now also providing
build status information.

Change-Id: Ia25dd9577205336abfb9169e259f3f2cbdb76b35
changes/97/40197/1
Michael Prokop 6 years ago
parent 9d0a6998e8
commit d5863ed74b

@ -0,0 +1,13 @@
FROM debian:buster
COPY entrypoint.sh /entrypoint.sh
# avoid "debconf: (TERM is not set, so the dialog frontend is not usable.)"
ENV DEBIAN_FRONTEND noninteractive
# disable man-db to speed up builds
RUN echo 'man-db man-db/auto-update boolean false' | debconf-set-selections
RUN apt-get update && apt-get -y install build-essential
ENTRYPOINT ["/entrypoint.sh"]

@ -0,0 +1,6 @@
name: "Build Docker image based on Debian/buster"
description: "Build Docker image based on Debian/buster"
runs:
using: 'docker'
image: 'Dockerfile'

@ -0,0 +1,16 @@
#!/bin/bash
set -eu -o pipefail
echo "*** Starting execution of '$0' ***"
echo "** Installing build dependencies **"
apt-get -y build-dep .
echo "** Building Debian package **"
dpkg-buildpackage
# We're inside /github/workspace/
echo "** Copying Debian package files to workspace **"
cp ../*.deb ../*.buildinfo ../workspace/
echo "*** Finished execution of '$0' ***"

@ -0,0 +1,13 @@
FROM debian:sid
COPY entrypoint.sh /entrypoint.sh
# avoid "debconf: (TERM is not set, so the dialog frontend is not usable.)"
ENV DEBIAN_FRONTEND noninteractive
# disable man-db to speed up builds
RUN echo 'man-db man-db/auto-update boolean false' | debconf-set-selections
RUN apt-get update && apt-get -y install build-essential
ENTRYPOINT ["/entrypoint.sh"]

@ -0,0 +1,6 @@
name: "Build Docker image based on Debian/sid"
description: "Build Docker image based on Debian/sid"
runs:
using: 'docker'
image: 'Dockerfile'

@ -0,0 +1,16 @@
#!/bin/bash
set -eu -o pipefail
echo "*** Starting execution of '$0' ***"
echo "** Installing build dependencies **"
apt-get -y build-dep .
echo "** Building Debian package **"
dpkg-buildpackage
# We're inside /github/workspace/
echo "** Copying Debian package files to workspace **"
cp ../*.deb ../*.buildinfo ../workspace/
echo "*** Finished execution of '$0' ***"

@ -0,0 +1,54 @@
name: Debian Packaging
on:
push:
pull_request:
schedule:
- cron: '0 8 * * *'
jobs:
build-deb-buster:
runs-on: ubuntu-latest
name: Debian pipeline for buster
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Execute Docker debpkg action
uses: ./.github/actions/debpkg-buster
- name: Store Debian package artifacts
uses: actions/upload-artifact@v2
with:
name: Debian binary package files
path: '*.deb'
- name: Store Debian package build info
uses: actions/upload-artifact@v2
with:
name: Debian buildinfo file
path: '*.buildinfo'
build-deb-sid:
runs-on: ubuntu-latest
name: Debian pipeline for sid
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Execute Docker debpkg action
uses: ./.github/actions/debpkg-sid
- name: Store Debian package artifacts
uses: actions/upload-artifact@v2
with:
name: Debian binary package files
path: '*.deb'
- name: Store Debian package build info
uses: actions/upload-artifact@v2
with:
name: Debian buildinfo file
path: '*.buildinfo'

@ -0,0 +1,30 @@
name: Code Testing
on:
push:
pull_request:
schedule:
- cron: '0 8 * * *'
jobs:
shellcheck:
runs-on: ubuntu-latest
name: Run shellcheck
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Display original shellcheck version
run: shellcheck --version
- name: Update shellcheck to latest stable version
run: |
wget -qO- https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz | tar -xJv
sudo cp shellcheck-stable/shellcheck /usr/bin/
- name: Display current shellcheck version
run: shellcheck --version
- name: Shellcheck execution
run: shellcheck scripts/* functions/* etc/ngcp-config/ngcpcfg.cfg sbin/ngcpcfg

@ -0,0 +1,13 @@
# ngcpcfg - central and templated based Configuration Management System for NGCP
![Debian Package CI](https://github.com/sipwise/ngcpcfg/workflows/Debian%20Package%20CI/badge.svg)
![Code Testing](https://github.com/sipwise/ngcpcfg/workflows/Code%20Testing/badge.svg)
ngcp-ngcpcfg is a Configuration Management System providing central
configuration and template based handling of configuration
files, featuring handling of local configuration changes and
updates as well as synchronisation between servers.
NGCP is the Sipwise NGCP (Sipwise Next Generation Communication Platform),
visit [Sipwise.org](https://www.sipwise.org/) for further information.
Loading…
Cancel
Save