...
 
Commits (2)
# TODO: change to alpinelinux/docker-cli
image: kdaudt/docker-cli:add-auxilary-scripts
image: alpinelinux/docker-cli:latest
stages:
- build
- upload
......
FROM alpine:edge
RUN apk add --no-cache abuild atools spdx-licenses-list shellcheck \
RUN apk add --no-cache abuild atools spdx-licenses-list shellcheck git \
&& adduser -D lint
COPY overlay/ /
......
......@@ -14,3 +14,8 @@ Docker container with the necessary linting tools for verifying APKBUILD files
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
if [ $# -lt 1 ]; then
echo "Usage: $0 <basebranch>"
exit 1
fi
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
echo "Fatal: not inside a git repository"
exit 2
fi
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 --no-pager diff --diff-filter=ACMR --name-only $basebranch...HEAD -- "*/APKBUILD" | xargs -n1 dirname
#!/bin/sh
BLUE="\e[34m"
MAGENTA="\e[35m"
RESET="\e[0m"
while read PKG; do
printf "$BLUE==>$RESET Linting $PKG\n"
(
cd "$PKG"
repo=$(basename $(dirname $PKG));
if [ "$repo" = "main" ]; then
export SKIP_AL1=1
export SKIP_AL13=1
fi
abuild sanitycheck
apkbuild-shellcheck
apkbuild-lint APKBUILD
)
echo
done