chore: build changes
This commit is contained in:
parent
5b72d3742c
commit
ffc713920a
@ -1,6 +1,6 @@
|
|||||||
steps:
|
steps:
|
||||||
build:
|
build:
|
||||||
image: archlinux:base-devel
|
image: archlinux/archlinux:base-devel
|
||||||
pull: true
|
pull: true
|
||||||
volumes:
|
volumes:
|
||||||
- /mnt/archlinux/nyyu:/repo
|
- /mnt/archlinux/nyyu:/repo
|
||||||
@ -13,7 +13,6 @@ steps:
|
|||||||
- "echo 'build ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers"
|
- "echo 'build ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers"
|
||||||
- mkdir /build
|
- mkdir /build
|
||||||
- chown -R build:build . /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=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'
|
- 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]
|
secrets: [pgp_id, pgp_key, pgp_pwd, git_password]
|
||||||
|
8
build.sh
8
build.sh
@ -86,9 +86,11 @@ while read -r p; do
|
|||||||
cd ..
|
cd ..
|
||||||
done <aur.txt
|
done <aur.txt
|
||||||
|
|
||||||
echo "Finding removed packages from ${CI_PREV_COMMIT_SHA}"
|
LAST_COMMIT=$(git --no-pager log --oneline | grep -v 'CI SKIP' | cut -d' ' -f1 | sed -n '2p')
|
||||||
del=$(git --no-pager diff ${CI_PREV_COMMIT_SHA}..HEAD aur.txt | tail -n +4 | grep -E '^-' | cut -c2-)
|
LAST_COMMIT=${CI_PREV_COMMIT_SHA:-$LAST_COMMIT}
|
||||||
del+=$(git --no-pager diff --name-status ${CI_PREV_COMMIT_SHA}..HEAD | grep -Po 'D\s+(\K.*)(?=/PKGBUILD)')
|
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
|
if [[ -n "${del}" ]]; then
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
echo "Removing packages ${del}"
|
echo "Removing packages ${del}"
|
||||||
|
Loading…
Reference in New Issue
Block a user