This commit is contained in:
Ward Nakchbandi (Cosmic Fusion) 2023-08-25 23:09:51 +03:00 committed by GitHub
parent 685378ffd6
commit 0fbddbfe75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 61 additions and 0 deletions

View File

@ -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 }}

View File

@ -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

13
external-wipe-clean.sh Normal file
View File

@ -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/