chore: build changes

This commit is contained in:
nyyu 2023-12-26 09:46:12 +01:00
parent 5b72d3742c
commit ffc713920a
2 changed files with 6 additions and 5 deletions

View File

@ -1,6 +1,6 @@
steps:
build:
image: archlinux:base-devel
image: archlinux/archlinux:base-devel
pull: true
volumes:
- /mnt/archlinux/nyyu:/repo
@ -13,7 +13,6 @@ steps:
- "echo 'build ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers"
- mkdir /build
- chown -R build:build . /build
- env
- sudo -u build --preserve-env=PGP_KEY,PGP_PWD,PGP_ID sh -c 'mkdir ~/.gnupg && echo -e "default-cache-ttl 3600\nallow-preset-passphrase" > ~/.gnupg/gpg-agent.conf && echo "$PGP_KEY" | gpg --import --no-tty --batch --yes && echo "$PGP_PWD" | /usr/lib/gnupg/gpg-preset-passphrase --preset $PGP_ID'
- sudo -u build --preserve-env=CI_REPO_CLONE_URL,CI_COMMIT_BRANCH,CI_PREV_COMMIT_SHA,GIT_PASSWORD sh -c './build.sh'
secrets: [pgp_id, pgp_key, pgp_pwd, git_password]

View File

@ -86,9 +86,11 @@ while read -r p; do
cd ..
done <aur.txt
echo "Finding removed packages from ${CI_PREV_COMMIT_SHA}"
del=$(git --no-pager diff ${CI_PREV_COMMIT_SHA}..HEAD aur.txt | tail -n +4 | grep -E '^-' | cut -c2-)
del+=$(git --no-pager diff --name-status ${CI_PREV_COMMIT_SHA}..HEAD | grep -Po 'D\s+(\K.*)(?=/PKGBUILD)')
LAST_COMMIT=$(git --no-pager log --oneline | grep -v 'CI SKIP' | cut -d' ' -f1 | sed -n '2p')
LAST_COMMIT=${CI_PREV_COMMIT_SHA:-$LAST_COMMIT}
echo "Finding removed packages from ${LAST_COMMIT}"
del=$(git --no-pager diff ${LAST_COMMIT}..HEAD aur.txt | tail -n +4 | grep -E '^-' | cut -c2-)
del+=$(git --no-pager diff --name-status ${LAST_COMMIT}..HEAD | grep -Po 'D\s+(\K.*)(?=/PKGBUILD)')
if [[ -n "${del}" ]]; then
# shellcheck disable=SC2086
echo "Removing packages ${del}"