generated from github/welcome-to-github
-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
103 additions
and
7 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: Run operations on a deb repo (from an Ubuntu latest system) | ||
|
||
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: sudo 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: sudo add-apt-repository ppa:ondrej/php -y | ||
# uses: shivammathur/setup-php@v2 | ||
# with: | ||
# php-version: '8.1' | ||
# coverage: none | ||
|
||
- name: Install PHP modules | ||
run: sudo apt update && sudo 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: | | ||
sudo groupadd repomanager | ||
sudo usermod -a -G repomanager www-data | ||
sudo mkdir -p /home/repo | ||
sudo mkdir -p /var/www/repomanager | ||
sudo mkdir -p /var/lib/repomanager | ||
sudo mkdir -p /var/lib/repomanager/backups | ||
sudo mkdir -p /var/lib/repomanager/logs/main | ||
sudo mkdir -p /var/lib/repomanager/configurations | ||
sudo mkdir -p /var/lib/repomanager/operations/pool/ | ||
sudo mkdir -p /var/lib/repomanager/db | ||
sudo mkdir -p /var/lib/repomanager/.gnupg | ||
sudo cp -r $GITHUB_WORKSPACE/www/* /var/www/repomanager/ | ||
sudo cp $GITHUB_WORKSPACE/www/version /var/lib/repomanager/version.available | ||
- name: Set up repomanager main config | ||
run: | | ||
sudo curl -s -L -o /var/lib/repomanager/db/repomanager.db https://github.com/lbr38/resources/raw/main/ci/repomanager/repomanager.db 2> /dev/null | ||
sudo 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 | ||
sudo ls -l /var/lib/repomanager/configurations/ | ||
sudo ls -l /var/lib/repomanager/db/ | ||
- name: Download jobs | ||
run: | | ||
sudo curl -s -o /var/lib/repomanager/operations/pool/ci-mirror-repo.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/deb/ci-mirror-repo.json 2> /dev/null | ||
sudo curl -s -o /var/lib/repomanager/operations/pool/ci-update-repo.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/deb/ci-update-repo.json 2> /dev/null | ||
sudo curl -s -o /var/lib/repomanager/operations/pool/ci-duplicate-repo.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/deb/ci-duplicate-repo.json 2> /dev/null | ||
sudo curl -s -o /var/lib/repomanager/operations/pool/ci-create-env.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/deb/ci-create-env.json 2> /dev/null | ||
sudo curl -s -o /var/lib/repomanager/operations/pool/ci-delete.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/deb/ci-delete.json 2> /dev/null | ||
sudo curl -s -o /var/lib/repomanager/operations/pool/ci-reconstruct.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/deb/ci-reconstruct.json 2> /dev/null | ||
- name: Set up permissions | ||
run: sudo chown -R www-data:repomanager /var/www/repomanager /var/lib/repomanager /home/repo | ||
|
||
- name: Update database | ||
run: | | ||
sudo -u www-data php /var/www/repomanager/tools/initialize-database.php | ||
sudo -u www-data php /var/www/repomanager/tools/update-database.php | ||
- name: Run job - Mirror repo | ||
#run: sudo -u www-data php /var/www/repomanager/operations/execute.php --id='ci-mirror-repo' || sleep 10; sudo cat /var/lib/repomanager/logs/main/lastlog.log; exit 1 | ||
run: sudo -u www-data php /var/www/repomanager/operations/execute.php --id='ci-mirror-repo' | ||
|
||
- name: Print mirrored repo content | ||
run: sudo ls -l /home/repo/debian/buster/contrib_pprd/pool/contrib/ | ||
|
||
- name: Run job - Update repo | ||
run: sudo -u www-data php /var/www/repomanager/operations/execute.php --id='ci-update-repo' | ||
|
||
- name: Run job - Duplicate repo | ||
run: sudo -u www-data php /var/www/repomanager/operations/execute.php --id='ci-duplicate-repo' | ||
|
||
- name: Print duplicated repo content | ||
run: sudo ls -l /home/repo/debian-copy/buster/contrib_pprd/pool/contrib/ | ||
|
||
- name: Run job - Create repo env | ||
run: sudo -u www-data php /var/www/repomanager/operations/execute.php --id='ci-create-env' | ||
|
||
- name: Run job - Reconstruct repo | ||
run: sudo -u www-data php /var/www/repomanager/operations/execute.php --id='ci-reconstruct' | ||
|
||
- name: Run job - Delete repo | ||
run: sudo -u www-data php /var/www/repomanager/operations/execute.php --id='ci-delete' |
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
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
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