parent
6428ed19a9
commit
ae19f8d228
2 changed files with 26 additions and 0 deletions
4
Makefile
4
Makefile
|
@ -32,6 +32,10 @@ all: \
|
|||
compat:
|
||||
./src/compat.sh
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
./src/lint.sh
|
||||
|
||||
.PHONY: preseed
|
||||
preseed:
|
||||
./src/preseed.sh
|
||||
|
|
22
src/lint.sh
Executable file
22
src/lint.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
has-stage () {
|
||||
grep -rnw ./packages/*/Containerfile -e "^FROM.*${1}$" | awk -F"/" '{ print $3 }' | sort
|
||||
}
|
||||
|
||||
check-stages () {
|
||||
all_packages=$(ls -1 ./packages | sort)
|
||||
|
||||
stages="base fetch build install test package"
|
||||
|
||||
for stage in $stages; do
|
||||
missing=$(comm -13 <(has-stage "${stage}") <(ls -1 ./packages | sort))
|
||||
if [ $(printf "${missing}" | wc -l) -gt "0" ]; then
|
||||
echo "${missing}" | xargs printf "%s is missing '${stage}' stage\n"
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
check-stages
|
Loading…
Reference in a new issue