From 0fbddbfe75094af0bcc62251ff987accecf5eed6 Mon Sep 17 00:00:00 2001 From: "Ward Nakchbandi (Cosmic Fusion)" <83735213+CosmicFusion@users.noreply.github.com> Date: Fri, 25 Aug 2023 23:09:51 +0300 Subject: [PATCH] --- .github/workflows/external-wipe-clean.yml | 44 +++++++++++++++++++++++ external-mozilla.sh | 4 +++ external-wipe-clean.sh | 13 +++++++ 3 files changed, 61 insertions(+) create mode 100644 .github/workflows/external-wipe-clean.yml create mode 100644 external-wipe-clean.sh diff --git a/.github/workflows/external-wipe-clean.yml b/.github/workflows/external-wipe-clean.yml new file mode 100644 index 0000000..5730d44 --- /dev/null +++ b/.github/workflows/external-wipe-clean.yml @@ -0,0 +1,44 @@ +name: Fucking Destroy the pool (External) + +on: + workflow_dispatch: + +jobs: + build: + runs-on: self-hosted + container: + image: ghcr.io/pikaos-linux/pika-package-container:latest + volumes: + - /proc:/proc + options: --privileged -it + + steps: + - uses: actions/checkout@v3 + + - name: Import GPG key + id: import_gpg + uses: crazy-max/ghaction-import-gpg@v5 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.PASSPHRASE }} + + - name: Install SSH key + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.SSH_KEY }} + name: id_rsa + known_hosts: ${{ secrets.KNOWN_HOSTS }} + if_key_exists: replace + + - name: Sync Repository + run: chmod +x ./external-wipe-clean.sh && ./external-wipe-clean.sh + + - name: Purge cache + uses: jakejarvis/cloudflare-purge-action@master + env: + # Zone is required by both authentication methods + CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }} + + CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} + PURGE_URLS: ${{ vars.PURGE_URLS }} + diff --git a/external-mozilla.sh b/external-mozilla.sh index d2e3508..ee7a75a 100644 --- a/external-mozilla.sh +++ b/external-mozilla.sh @@ -22,6 +22,10 @@ echo 'deb [trusted=yes] https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu apt update -y --allow-unauthenticated PPP=$(../../ppp https://ppa.pika-os.com/dists/lunar/external/binary-amd64/Packages https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/dists/lunar/main/binary-amd64/Packages.xz) +touch /etc/apt/preferences.d/99-external.conf +echo 'Package: *' > /etc/apt/preferences.d/99-external.conf +echo 'Pin: release o=LP-PPA-mozillateam' >> /etc/apt/preferences.d/99-external.conf +echo 'Pin-Priority: 501' >> /etc/apt/preferences.d/99-external.conf if [ ! -z "$PPP" ] then apt download $PPP -y diff --git a/external-wipe-clean.sh b/external-wipe-clean.sh new file mode 100644 index 0000000..f0c22fd --- /dev/null +++ b/external-wipe-clean.sh @@ -0,0 +1,13 @@ +#! /bin/bash +set -e + +### In the Case of a major mishap we wipe the external pool clean and re run all repos +# Pull down existing ppa repo db files etc +mkdir -p ./output/repo +rsync -azP --exclude '*.deb' ferreo@direct.pika-os.com:/srv/www/pikappa/ ./output/repo + +# Remove our All package from the pool +reprepro -C external -V --basedir ./output/repo/ removefilter lunar 'Package (% *)' + +# Push the updated ppa repo to the server +rsync -azP ./output/repo/ ferreo@direct.pika-os.com:/srv/www/pikappa/ \ No newline at end of file