CI: allow to use customized Docker image

Necessary to handle cases where setup scripts were changed
during push or pull request.
This commit is contained in:
Leonid Pliushch 2020-01-23 22:09:22 +02:00
parent 149220d89d
commit 9e97a520e4
1 changed files with 6 additions and 0 deletions

View File

@ -41,6 +41,12 @@ jobs:
echo "Processing pull request #$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH"): ${BASE_COMMIT}..HEAD"
CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r "${BASE_COMMIT}" "HEAD")
fi
if grep -qP '^scripts/(Dockerfile|setup-ubuntu\.sh)$' <<< "$CHANGED_FILES"; then
echo "Detected changes for environment setup scripts. Building custom Docker image now."
cd ./scripts
docker build -t termux/package-builder:latest .
cd ..
fi
PACKAGE_NAMES=$(sed -nE 's@^packages/([^/]*)/([^/]*)(/.*)?$@\1@p' <<< "$CHANGED_FILES" | sort | uniq)
for pkg in $PACKAGE_NAMES; do
if [ ! -d "./packages/${pkg}" ]; then