From 66a278b97ca0745c4dd75a25043b57ba93e4d69a Mon Sep 17 00:00:00 2001 From: alice-meta-packages <> Date: Mon, 9 Sep 2024 20:30:22 -0300 Subject: [PATCH] Initial commit --- .gitea/workflows/deploy.yml | 38 +++++++++++++++++++++++++++++++++++++ DEBIAN/control | 8 ++++++++ DEBIAN/postinst | 3 +++ 3 files changed, 49 insertions(+) create mode 100644 .gitea/workflows/deploy.yml create mode 100644 DEBIAN/control create mode 100755 DEBIAN/postinst diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..5a579d7 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,38 @@ +name: Deploy Package +run-name: ${{ gitea.actor }} is deploying +on: [push] + +jobs: + Explore-Gitea-Actions: + runs-on: ubuntu-latest + steps: + - name: Deploy to alice + run: | + echo "${{ secrets.SCP_KEY_ALICE }}" > /tmp/ssh_private_key + chmod 600 /tmp/ssh_private_key + ssh -o "StrictHostKeyChecking no" -i /tmp/ssh_private_key act_runner@alice.ufsj.edu.br -p ${{ secrets.SSH_PORT_ALICE }} << 'EOF' + cd /tmp + + echo "Removing old clones..." + rm -rf ./${{ github.event.repository.name }} + + echo "Cloning the repo..." + git clone --depth=1 https://git.alice.ufsj.edu.br/${{ gitea.repository }} + + echo "Removing .git dir..." + rm -rf ./${{ github.event.repository.name }}/.git ./${{ github.event.repository.name }}/.gitea + ls -la ./${{ github.event.repository.name }} + + echo "Building package..." + dpkg-deb --build ${{ github.event.repository.name }} + + echo "Moving package to ppa..." + mv ${{ github.event.repository.name }}.deb /var/www/html/debian/pool/main + cd /var/www/html/debian + + echo "Creating Packages file..." + dpkg-scanpackages pool/ > dists/stable/main/binary-amd64/Packages + + echo "Creating Relase file..." + apt-ftparchive -c /var/www/html/debian/apt-ftparchive.conf release /var/www/html/debian/dists/stable > /var/www/html/debian/dists/stable/Release + EOF diff --git a/DEBIAN/control b/DEBIAN/control new file mode 100644 index 0000000..70cc77a --- /dev/null +++ b/DEBIAN/control @@ -0,0 +1,8 @@ +Package: NOME DO PACOTE +Version: 1.0 +Section: admin +Priority: optional +Architecture: amd64 +Depends: DEPENDENCIAS +Maintainer: SEU NOME +Description: META-PACOTE EXEMPLO diff --git a/DEBIAN/postinst b/DEBIAN/postinst new file mode 100755 index 0000000..8a532bb --- /dev/null +++ b/DEBIAN/postinst @@ -0,0 +1,3 @@ +#!/bin/sh + +# Script executado pós instalação