- restoring builder tLDP/LDP#112

This commit is contained in:
ᎠᎡ. Ѕϵrgϵ Ѵictor 2024-01-10 22:26:30 +07:00
parent e93b0b0461
commit a9018dc638
5 changed files with 68 additions and 122 deletions

71
.github/.drone.yml vendored
View File

@ -1,21 +1,70 @@
# (C) Serge Victor 2020, GPLv3 License
---
# (C) Serge Victor 2020-2024, GPLv3 License
#
# https://drone.tldp.org
#
# recently build version of documents is available on permanent storage disk mounted on /LDP
# 1) this file is protected, DO NOT TAMPER without permission from LDP authorised maintainers!
#
# 2) contact us or create an issue before thinking about any changes.
kind: pipeline
type: docker
name: 🗃 LDP Builder
workspace:
path: /builder/src
steps:
- name: Martin's builder
- name: 🗃 Martin's builder - Pull Request only (partial build)
image: tldp/builder:latest
volumes:
- name: LDP
path: /LDP
when:
event:
include:
- pull_request
commands:
- ldptool --dump-cfg
- rm -rf /LDP/BUILD
- rm -rf /LDP/MAIN
- mkdir -p /LDP/BUILD
- mkdir -p /LDP/MAIN
- rsync -av /LDP/WWW/en/ /LDP/MAIN
- ldptool --loglevel info --builddir /LDP/BUILD --configfile .github/builder-pr.ldptool.cfg --pubdir /LDP/MAIN --list
- ldptool --loglevel info --builddir /LDP/BUILD --configfile .github/builder-pr.ldptool.cfg --pubdir /LDP/MAIN --publish
- rsync -av --delete-after /LDP/MAIN/ /LDP/WWW/en
- rm -rf /LDP/PR
- mkdir -p /LDP/PR/BUILD
- rsync -av /LDP/en /LDP/PR
- ldptool --loglevel info --builddir /LDP/PR/BUILD --configfile .github/builder.ldptool.cfg --pubdir /LDP/PR/en --list
- ionice -c 3 chrt --idle 0 ldptool --loglevel info --builddir /LDP/PR/BUILD --configfile .github/builder.ldptool.cfg --pubdir /LDP/PR/en --publish
- git rev-parse HEAD > /LDP/PR/last-commit-id.txt
- date > /LDP/PR/build-date.txt
- name: 🗃 Martin's builder - all revieved commits (full build)
image: tldp/builder:latest
volumes:
- name: LDP
path: /LDP
when:
event:
exclude:
- pull_request
commands:
- ldptool --dump-cfg
- mkdir -p /builder/src/BUILD
- mkdir -p /builder/src/PUBDIR
- ldptool --loglevel info --builddir /builder/src/BUILD --configfile .github/builder.ldptool.cfg --pubdir /builder/src/PUBDIR --list
- ionice -c 3 chrt --idle 0 ldptool --loglevel info --builddir /builder/src/BUILD --configfile .github/builder.ldptool.cfg --pubdir /builder/src/PUBDIR --publish
- rsync -av --delete-after /builder/src/PUBDIR/ /LDP/en
- git rev-parse HEAD > /LDP/last-commit-id.txt
- date > /LDP/build-date.txt
volumes:
- name: LDP
host:
path: /LDP
trigger:
branch:
- master
# the happy end.
---
kind: signature
hmac: 45cf4fbf1b8f52a9096a444fb68ff415d101cab7812358bc0951ac87fadc7587
...

5
.github/README.md vendored
View File

@ -1,7 +1,4 @@
Builder | State
:--- | ---:
Documentation | [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FtLDP%2FLDP%2Fbadge%3Fref%3Dmaster&style=flat)](https://actions-badge.atrox.dev/tLDP/LDP/goto?ref=master)
Pull Requests | [![Build Status](https://drone.tldp.org/api/badges/tLDP/LDP/status.svg)](https://drone.tldp.org/tLDP/LDP)
Documentation | [![Build Status](https://drone.tldp.org/api/badges/tLDP/LDP/status.svg)](https://drone.tldp.org/tLDP/LDP)
---

View File

@ -1,8 +0,0 @@
[ldptool]
sourcedir = /drone/src/LDP/faq/linuxdoc/,
/drone/src/LDP/guide/linuxdoc/,
/drone/src/LDP/howto/linuxdoc/,
/drone/src/LDP/howto/docbook/,
/drone/src/LDP/guide/docbook/,
/drone/src/LDP/ref/docbook/,
/drone/src/LDP/faq/docbook/

View File

@ -1,8 +1,8 @@
[ldptool]
sourcedir = /home/runner/work/LDP/LDP/LDP/faq/linuxdoc/,
/home/runner/work/LDP/LDP/LDP/guide/linuxdoc/,
/home/runner/work/LDP/LDP/LDP/howto/linuxdoc/,
/home/runner/work/LDP/LDP/LDP/howto/docbook/,
/home/runner/work/LDP/LDP/LDP/guide/docbook/,
/home/runner/work/LDP/LDP/LDP/ref/docbook/,
/home/runner/work/LDP/LDP/LDP/faq/docbook/
sourcedir = /builder/src/LDP/faq/linuxdoc/,
/builder/src/LDP/guide/linuxdoc/,
/builder/src/LDP/howto/linuxdoc/,
/builder/src/LDP/howto/docbook/,
/builder/src/LDP/guide/docbook/,
/builder/src/LDP/ref/docbook/,
/builder/src/LDP/faq/docbook/

View File

@ -1,92 +0,0 @@
name: LDP Master Builder
on: [push]
env:
LDPHOST1: 152.19.134.151
LDPHOST2: 152.19.134.152
LDPPORT: 722
LDPUSER: builder
jobs:
documents-build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: 🔝 Building System Preparation
run: |
sudo apt update
sudo apt -y install texlive-font-utils linuxdoc-tools-text linuxdoc-tools-latex docbook-dsssl docbook-xsl docbook-utils htmldoc htmldoc-common docbook-xsl html2text docbook5-xml docbook-xsl-ns jing asciidoc libxml2-utils python3-stdeb fakeroot python3-all python3-networkx python3-nose fop ldp-docbook-xsl ldp-docbook-dsssl docbook opensp dh-python
shell: bash
- name: ↪️ Restoring Martin's LDP Python Scripts from Cache
id: pythontldp
uses: actions/cache@v1
with:
path: ~/work/python-tldp/deb_dist
key: ${{ runner.os }}-pythontldp
- name: 🧱 Compiling Martin's LDP Python Scripts if not Found in Cache
if: steps.pythontldp.outputs.cache-hit != 'true'
run: |
cd ~/work
git clone https://github.com/tLDP/python-tldp
cd python-tldp && rm -rf debian
python3 setup.py --command-packages=stdeb.command bdist_deb
shell: bash
- name: 🔃 Installation of Martin's LDP Python Scripts
run: |
cd ~/work
sudo dpkg -i python-tldp/deb_dist/python3-tldp_*_all.deb
ldptool --dump-cfg
shell: bash
- name: 🔀 Restoring SSH Key to Manage Documentation Repository
run: |
mkdir -p /home/runner/.ssh
chmod 700 /home/runner/.ssh
echo "$SSH_KEY" > /home/runner/.ssh/ldpkey
chmod 400 /home/runner/.ssh/ldpkey
ssh-keyscan -p $LDPPORT -H $LDPHOST1 >> /home/runner/.ssh/known_hosts
chmod 400 /home/runner/.ssh/known_hosts
#ssh-keyscan -p $LDPPORT -H $LDPHOST2 >> /home/runner/.ssh/known_hosts
ssh -vv -p $LDPPORT -i /home/runner/.ssh/ldpkey $LDPUSER@$LDPHOST1 ls
#ssh -vv -p $LDPPORT -i /home/runner/.ssh/ldpkey $LDPUSER@$LDPHOST2 ls
shell: bash
env:
SSH_KEY: ${{secrets.IBIBLIO_WWW_SSHKEY}}
- name: ↪️ Restoring Recent Production (Master Branch) LDP Docs from Cache if Available
id: ldpdocsmain
uses: actions/cache@v1
with:
path: ~/work/MAIN
key: ${{ runner.os }}-ldpdocsmain
- name: 🔀 Restoring Most Current Production (Master Branch) LDP Docs from LDP WWW Server
run: |
mkdir -p ~/work/MAIN
rsync --stats -rvclz --delete-before -e "ssh -p $LDPPORT -i /home/runner/.ssh/ldpkey" $LDPUSER@$LDPHOST1:/home/builder/en/ ~/work/MAIN
shell: bash
- name: 🧱 LDP Documents Processing via Martins scripts
run: |
ls -alR ~
cd ~/work
mkdir -p BUILD
ldptool --loglevel info --builddir BUILD --configfile LDP/LDP/.github/builder.ldptool.cfg --pubdir MAIN --list
ldptool --loglevel info --builddir BUILD --configfile LDP/LDP/.github/builder.ldptool.cfg --pubdir MAIN --publish
shell: bash
- name: 🔀 Built Documents Transfer for Master Main Documents WWW Front Servers @ Ibiblio
run: |
rsync --stats -rvclz --delete-before -e "ssh -p $LDPPORT -i /home/runner/.ssh/ldpkey" ~/work/MAIN/ $LDPUSER@$LDPHOST1:/home/builder/en
#rsync --stats -rvclz --delete-before -e "ssh -p $LDPPORT -i /home/runner/.ssh/ldpkey" ~/work/MAIN/ $LDPUSER@$LDPHOST2:/home/builder/en
shell: bash
# happy end.
# ©️ Serge Victor 2020