...
 
Commits (4)
# TODO: change to alpinelinux/docker-cli
image: kdaudt/docker-cli:add-auxilary-scripts
stages:
- build
- upload
build:
stage: build
tags:
- docker-alpine
- x86_64
script:
- docker build -t $CI_PROJECT_NAME:latest .
upload:
stage: upload
before_script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
only:
- master
script:
- docker-push-image $CI_PROJECT_NAME:latest $DOCKER_NAMESPACE/$CI_PROJECT_NAME:latest
FROM alpine:edge
RUN apk add --no-cache abuild atools spdx-licenses-list shellcheck \
&& adduser -D lint
COPY overlay/ /
USER lint
# apkbuild-lint-tools
Docker container with the necessary linting tools for verifying APKBUILD files
\ No newline at end of file
Docker container with the necessary linting tools for verifying APKBUILD files
## Tools
* **[atools](https://gitlab.alpinelinux.org/Leo/atools)** - Contains `apkbuild-lint`
for general codestyle linting
* **[shellcheck](https://www.shellcheck.net/)** - A generic shell script linter,
warning against common issues in shell scripts. Note that by default it's
too strict for APKBUILD files.
* **apkbuild-shellcheck** - A wrapper script to use shellcheck on APKBUILD
files. It uses a shim file that defines variabes normally defined by abuild
and 'uses' them so that shellcheck does not warn about them, while still
warning about other variables. It also disables some checks that are not
applicable for APKBUILDs.
## Auxilary scripts
* **changed-aports** - Returns a list of changed APKBUILD files in a certain
branch, give a base branch: `changed-aports <basebranch>`.
#!/bin/sh
shellcheck -s ash \
-e SC2016 \
-e SC2086 \
-e SC2169 \
-e SC2155 \
-e SC2100 \
-e SC2209 \
-e SC2030 \
-e SC2031 \
-e SC1090 \
-xa /usr/share/abuild/APKBUILD_SHIM
#!/bin/sh
basebranch=$1
if ! git rev-parse --verify --quiet $basebranch >/dev/null; then
# The base branch does not eixst, probably due to a shallow clone
git fetch origin refs/heads/$basebranch:refs/heads/$basebranch
fi
git diff --diff-filter=ACMR --name-only $baebranch...HEAD -- "*/APKBUILD"
#!/bin/sh
set -e
arch=
builddir=
checkdepends=
depends=
depends_dev=
install=
install_if=
ldpath=
license=
makedepends=
md5sums=
options=
pkgdesc=
pkgdir=$PWD/pkg
pkgname=
pkgrel=
pkgver=
pkggroups=
pkgusers=
provides=
replaces=
sha256sums=
sha512sums=
sonameprefix=
source=
srcdir=$PWD/src
startdir=
subpackages=
subpkgdir=
subpkgname=
url=
. ./APKBUILD
: "$arch"
: "$builddir"
: "$checkdepends"
: "$depends"
: "$depends_dev"
: "$install"
: "$install_if"
: "$ldpath"
: "$license"
: "$makedepends"
: "$md5sums"
: "$options"
: "$pkgdesc"
: "$pkgdir"
: "$pkgname"
: "$pkgrel"
: "$pkgver"
: "$pkggroups"
: "$pkgusers"
: "$provides"
: "$replaces"
: "$sha256sums"
: "$sha512sums"
: "$sonameprefix"
: "$source"
: "$srcdir"
: "$startdir"
: "$subpackages"
: "$subpkgdir"
: "$subpkgname"
: "$url"