patch #127
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run rpm and deb operations | |
on: | |
push: | |
branches: [ devel ] | |
pull_request: | |
push: | |
branches: [ stable ] | |
jobs: | |
run-operations: | |
runs-on: ubuntu-latest | |
container: | |
image: debian:11 | |
options: --user root | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install dependencies packages | |
run: apt-get update && apt-get install -y findutils iputils-ping git gnupg2 rpm librpmsign9 createrepo-c reprepro apt-utils curl ca-certificates apt-transport-https dnsutils xz-utils | |
- name: Setup PHP | |
run: | | |
curl -fsSL https://packages.sury.org/php/apt.gpg| gpg --dearmor -o /etc/apt/trusted.gpg.d/sury-keyring.gpg | |
echo "deb https://packages.sury.org/php/ bullseye main" | tee /etc/apt/sources.list.d/sury-php.list | |
- name: Install PHP modules | |
run: apt-get update && apt-get install -y php8.1-fpm php8.1-cli php8.1-sqlite3 php8.1-xml php8.1-curl sqlite3 | |
- name: Print PHP version | |
run: php --version | |
- name: Set up repomanager files & directories | |
run: | | |
groupadd repomanager | |
usermod -a -G repomanager www-data | |
mkdir -p /home/repo | |
mkdir -p /var/www/repomanager | |
mkdir -p /var/lib/repomanager | |
mkdir -p /var/lib/repomanager/backups | |
mkdir -p /var/lib/repomanager/logs/main | |
mkdir -p /var/lib/repomanager/configurations | |
mkdir -p /var/lib/repomanager/operations/pool/ | |
mkdir -p /var/lib/repomanager/db | |
mkdir -p /var/lib/repomanager/.gnupg | |
cp -r $GITHUB_WORKSPACE/www/* /var/www/repomanager/ | |
cp $GITHUB_WORKSPACE/www/version /var/lib/repomanager/version.available | |
- name: Set up repomanager main config | |
run: | | |
curl -s -L -o /var/lib/repomanager/db/repomanager.db https://github.com/lbr38/resources/raw/main/ci/repomanager/repomanager.db 2> /dev/null | |
curl -s -L -o /var/lib/repomanager/db/repomanager-hosts.db https://github.com/lbr38/resources/raw/main/ci/repomanager/repomanager-hosts.db 2> /dev/null | |
ls -l /var/lib/repomanager/configurations/ | |
ls -l /var/lib/repomanager/db/ | |
- name: Retrieve jobs | |
run: | | |
curl -s -o /var/lib/repomanager/operations/pool/ci-deb-mirror-repo.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/deb/ci-mirror-repo.json 2> /dev/null | |
curl -s -o /var/lib/repomanager/operations/pool/ci-deb-update-repo.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/deb/ci-update-repo.json 2> /dev/null | |
curl -s -o /var/lib/repomanager/operations/pool/ci-deb-duplicate-repo.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/deb/ci-duplicate-repo.json 2> /dev/null | |
curl -s -o /var/lib/repomanager/operations/pool/ci-deb-create-env.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/deb/ci-create-env.json 2> /dev/null | |
curl -s -o /var/lib/repomanager/operations/pool/ci-deb-delete.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/deb/ci-delete.json 2> /dev/null | |
curl -s -o /var/lib/repomanager/operations/pool/ci-deb-reconstruct.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/deb/ci-reconstruct.json 2> /dev/null | |
curl -s -o /var/lib/repomanager/operations/pool/ci-rpm-mirror-repo.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/rpm/ci-mirror-repo.json 2> /dev/null | |
curl -s -o /var/lib/repomanager/operations/pool/ci-rpm-update-repo.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/rpm/ci-update-repo.json 2> /dev/null | |
curl -s -o /var/lib/repomanager/operations/pool/ci-rpm-duplicate-repo.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/rpm/ci-duplicate-repo.json 2> /dev/null | |
curl -s -o /var/lib/repomanager/operations/pool/ci-rpm-create-env.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/rpm/ci-create-env.json 2> /dev/null | |
curl -s -o /var/lib/repomanager/operations/pool/ci-rpm-delete.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/rpm/ci-delete.json 2> /dev/null | |
curl -s -o /var/lib/repomanager/operations/pool/ci-rpm-reconstruct.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/rpm/ci-reconstruct.json 2> /dev/null | |
- name: Set up permissions | |
run: chown -R www-data:repomanager /var/www/repomanager /var/lib/repomanager /home/repo | |
- name: Update database | |
run: | | |
/bin/su -s /bin/bash -c "php /var/www/repomanager/tools/initialize-database.php" www-data | |
/bin/su -s /bin/bash -c "php /var/www/repomanager/tools/update-database.php" www-data | |
# deb | |
- name: Run job - Mirror deb repo | |
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/operations/execute.php --id='ci-deb-mirror-repo'" www-data | |
- name: Print mirrored deb repo content | |
run: ls -l /home/repo/debian/buster/contrib_pprd/pool/contrib/ | |
- name: Run job - Update deb repo | |
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/operations/execute.php --id='ci-deb-update-repo'" www-data | |
- name: Run job - Duplicate deb repo | |
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/operations/execute.php --id='ci-deb-duplicate-repo'" www-data | |
- name: Print duplicated deb repo content | |
run: ls -l /home/repo/debian-copy/buster/contrib_pprd/pool/contrib/ | |
- name: Run job - Create deb repo env | |
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/operations/execute.php --id='ci-deb-create-env'" www-data | |
- name: Run job - Reconstruct deb repo | |
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/operations/execute.php --id='ci-deb-reconstruct'" www-data | |
- name: Run job - Delete deb repo | |
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/operations/execute.php --id='ci-deb-delete'" www-data | |
# rpm | |
- name: Run job - Mirror rpm repo | |
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/operations/execute.php --id='ci-rpm-mirror-repo'" www-data | |
- name: Print mirrored rpm repo content | |
run: ls -l /home/repo/nginx_pprd/ | |
- name: Run job - Update rpm repo | |
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/operations/execute.php --id='ci-rpm-update-repo'" www-data | |
- name: Run job - Duplicate rpm repo | |
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/operations/execute.php --id='ci-rpm-duplicate-repo'" www-data | |
- name: Print duplicated rpm repo content | |
run: | | |
ls -l /home/repo/ | |
ls -l /home/repo/nginx-copy_pprd/ | |
- name: Run job - Create rpm repo env | |
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/operations/execute.php --id='ci-rpm-create-env'" www-data | |
- name: Run job - Reconstruct rpm repo | |
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/operations/execute.php --id='ci-rpm-reconstruct'" www-data | |
- name: Run job - Delete rpm repo | |
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/operations/execute.php --id='ci-rpm-delete'" www-data |