From e5da6857a43eed2157bfb17c2e7eec1e8986e165 Mon Sep 17 00:00:00 2001 From: Denis Cardon Date: Mon, 23 Nov 2020 20:26:43 +0100 Subject: [PATCH] cleanup --- doc/.gitignore | 51 -------- doc/.pre-commit-config.yaml | 33 ----- doc/Jenkinsfile | 252 ------------------------------------ doc/check_translation.py | 21 --- doc/install_requirements.sh | 1 - doc/requirements.txt | 1 - doc/robots.txt | 3 - doc/run_checks.sh | 3 - doc/security.txt | 2 - 9 files changed, 367 deletions(-) delete mode 100644 doc/.gitignore delete mode 100644 doc/.pre-commit-config.yaml delete mode 100644 doc/Jenkinsfile delete mode 100644 doc/check_translation.py delete mode 100644 doc/robots.txt delete mode 100644 doc/run_checks.sh delete mode 100644 doc/security.txt diff --git a/doc/.gitignore b/doc/.gitignore deleted file mode 100644 index 9a05f09..0000000 --- a/doc/.gitignore +++ /dev/null @@ -1,51 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.cache -nosetests.xml -coverage.xml - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -build/ -docs/_build/ -source/.doctrees/ -source/_build/ -source/.vscode/ -.doctrees/ -source/locale/**/*.tmp -.vscode\settings.json diff --git a/doc/.pre-commit-config.yaml b/doc/.pre-commit-config.yaml deleted file mode 100644 index fddfc70..0000000 --- a/doc/.pre-commit-config.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# See https://pre-commit.com for more information -# See https://pre-commit.com/hooks.html for more hooks -repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.5.0 - hooks: - - id: trailing-whitespace - - id: end-of-file-fixer -- repo: https://github.com/openstack-dev/bashate - rev: 2.0.0 - hooks: - - id: bashate - entry: bashate --error . --verbose --ignore=E006,E040 -- repo: https://github.com/Lucas-C/pre-commit-hooks-bandit - rev: v1.0.4 - hooks: - - id: python-bandit-vulnerability-check - args: [-l, --recursive] - files: .py$ -- repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.5.1 - hooks: - - id: rst-backticks -- repo: local - hooks: - - id: sphinx-build - name: sphinx build - entry: python3.5 -m sphinx.cmd.build - args: [-a, -E, source, build] - language: system - files: ^source/ - types: [file] - pass_filenames: false diff --git a/doc/Jenkinsfile b/doc/Jenkinsfile deleted file mode 100644 index ba316b2..0000000 --- a/doc/Jenkinsfile +++ /dev/null @@ -1,252 +0,0 @@ -pipeline { - agent { label 'debian-buster' } - options { - timestamps() - disableConcurrentBuilds() - buildDiscarder(logRotator(numToKeepStr: '10')) - } - - stages { - stage('Clean before launch'){ - steps{ - sh ''' - echo "clean" - make clean - rm -Rf ./build/ - ''' - } - } - stage('Setup RestructuredText'){ - steps { - sh ''' - echo "Installing requirements" - pip3 install -U pip setuptools - pip3 install -r requirements.txt --upgrade - ''' - } - } - stage('Gettext'){ - steps{ - sh ''' - echo "gettext and update po" - make gettext - sphinx-intl update -p build/locale/ -l fr - make clean - ''' - } - } - stage('Make HTML'){ - steps{ - sh ''' - make htmlen - make -e SPHINXOPTS="-D language='fr'" htmlfr - ''' - } - } - stage('Make EPUB'){ - steps{ - sh ''' - make epub_en - make -e SPHINXOPTS="-D language='fr'" epub_fr - ''' - } - } - stage('Make LatexPDF'){ - steps{ - sh ''' - echo "make latexpdf EN" - make latexpdf_en || true - - echo "make latexpdf FR" - make -e SPHINXOPTS="-D language='fr'" latexpdf_fr || true - ''' - } - } - stage('Copy static files'){ - steps{ - sh ''' - cp ./robots.txt build/en/doc - cp ./robots.txt build/fr/doc - mkdir ./build/en/doc/.well-known - mkdir ./build/fr/doc/.well-known - cp security.txt ./build/en/doc/.well-known - cp security.txt ./build/en/doc/.well-known - ''' - } - } - stage('Publish over SSH'){ - steps{ - sshPublisher alwaysPublishFromMaster: true, - publishers: [sshPublisherDesc(configName: 'root@doc.ad.tranquil.it', - transfers: [sshTransfer(excludes: '', - execCommand: '', execTimeout: 120000, - flatten: false, - makeEmptyDirs: false, - noDefaultExcludes: false, - patternSeparator: '[, ]+', - remoteDirectory: '/var/www/doc/wapt/en/doc/', - remoteDirectorySDF: false, - removePrefix: 'build/en/doc/', - sourceFiles: 'build/en/doc/**'), - sshTransfer(excludes: '', - execCommand: '', execTimeout: 120000, - flatten: false, - makeEmptyDirs: false, - noDefaultExcludes: false, - patternSeparator: '[, ]+', - remoteDirectory: '/var/www/doc/wapt/fr/doc/', - remoteDirectorySDF: false, - removePrefix: 'build/fr/doc/', - sourceFiles: 'build/fr/doc/**'), - sshTransfer(excludes: '', - execCommand: '', execTimeout: 120000, - flatten: false, - makeEmptyDirs: false, - noDefaultExcludes: false, - patternSeparator: '[, ]+', - remoteDirectory: '/var/www/doc/wapt/fr/doc/', - remoteDirectorySDF: false, - removePrefix: 'build/fr/epub/', - sourceFiles: 'build/fr/epub/*.epub'), - sshTransfer(excludes: '', - execCommand: '', execTimeout: 120000, - flatten: false, - makeEmptyDirs: false, - noDefaultExcludes: false, - patternSeparator: '[, ]+', - remoteDirectory: '/var/www/doc/wapt/en/doc/', - remoteDirectorySDF: false, - removePrefix: 'build/en/epub/', - sourceFiles: 'build/en/epub/*.epub'), - sshTransfer(excludes: '', - execCommand: '', execTimeout: 120000, - flatten: false, - makeEmptyDirs: false, - noDefaultExcludes: false, - patternSeparator: '[, ]+', - remoteDirectory: '/var/www/doc/wapt/fr/doc/', - remoteDirectorySDF: false, - removePrefix: 'build/fr/latex/', - sourceFiles: 'build/fr/latex/WAPT.pdf'), - sshTransfer(excludes: '', - execCommand: '', execTimeout: 120000, - flatten: false, - makeEmptyDirs: false, - noDefaultExcludes: false, - patternSeparator: '[, ]+', - remoteDirectory: '/var/www/doc/wapt/en/doc/', - remoteDirectorySDF: false, - removePrefix: 'build/en/latex/', - sourceFiles: 'build/en/latex/WAPT.pdf') - ], - usePromotionTimestamp: false, - useWorkspaceInPromotion: false, - verbose: false)] - } - } - stage('Clean release prod'){ - when { - allOf { - branch 'master' - tag "release-*" - } - } - steps { - echo 'Cleanup prod' - sshPublisher alwaysPublishFromMaster: true, - publishers: [sshPublisherDesc(configName: 'root@wapt.fr', - transfers: [sshTransfer(execCommand: 'rm -rf /var/www/wapt.fr/fr/doc-1.8/*'), - sshTransfer(execCommand: 'rm -rf /var/www/wapt.fr/en/doc-1.8/*')], - usePromotionTimestamp: false, - useWorkspaceInPromotion: false, - verbose: false)] - } - } - stage('Publish release prod'){ - when { - allOf { - branch 'master' - tag "release-*" - } - } - steps { - echo 'Publishing to doc.wapt.fr' - sshPublisher alwaysPublishFromMaster: true, - publishers: [sshPublisherDesc(configName: 'root@wapt.fr', - transfers: [sshTransfer(excludes: '', - execCommand: '', execTimeout: 120000, - flatten: false, - makeEmptyDirs: false, - noDefaultExcludes: false, - patternSeparator: '[, ]+', - remoteDirectory: '/var/www/wapt.fr/en/doc-1.8/', - remoteDirectorySDF: false, - removePrefix: 'build/en/doc/', - sourceFiles: 'build/en/doc/**'), - sshTransfer(excludes: '', - execCommand: '', execTimeout: 120000, - flatten: false, - makeEmptyDirs: false, - noDefaultExcludes: false, - patternSeparator: '[, ]+', - remoteDirectory: '/var/www/wapt.fr/fr/doc-1.8/', - remoteDirectorySDF: false, - removePrefix: 'build/fr/doc/', - sourceFiles: 'build/fr/doc/**'), - sshTransfer(excludes: '', - execCommand: '', execTimeout: 120000, - flatten: false, - makeEmptyDirs: false, - noDefaultExcludes: false, - patternSeparator: '[, ]+', - remoteDirectory: '/var/www/wapt.fr/en/doc-1.8/', - remoteDirectorySDF: false, - removePrefix: 'build/en/latex/', - sourceFiles: 'build/en/latex/WAPT.pdf'), - sshTransfer(excludes: '', - execCommand: '', execTimeout: 120000, - flatten: false, - makeEmptyDirs: false, - noDefaultExcludes: false, - patternSeparator: '[, ]+', - remoteDirectory: '/var/www/wapt.fr/fr/doc-1.8/', - remoteDirectorySDF: false, - removePrefix: 'build/fr/latex/', - sourceFiles: 'build/fr/latex/WAPT.pdf') - ], - usePromotionTimestamp: false, - useWorkspaceInPromotion: false, - verbose: false)] - } - } - } - - post { - success { - rocketSend message: "Successful Build - ${env.JOB_NAME} ${env.BUILD_NUMBER} - ${env.BUILD_TIMESTAMP} (<${env.BUILD_URL}|Open>)", - channel: 'documentation', - rawMessage: true - } - - failure { - rocketSend message: "Build Failed - ${env.JOB_NAME} ${env.BUILD_NUMBER} - ${env.BUILD_TIMESTAMP} (<${env.BUILD_URL}|Open>)", - channel: 'documentation', - rawMessage: true - } - - unstable { - rocketSend message: "Unstable Build - ${env.JOB_NAME} ${env.BUILD_NUMBER} - ${env.BUILD_TIMESTAMP} (<${env.BUILD_URL}|Open>)", - channel: 'documentation', - rawMessage: true - } - - aborted { - rocketSend message: "Build Aborted - ${env.JOB_NAME} ${env.BUILD_NUMBER} - ${env.BUILD_TIMESTAMP} (<${env.BUILD_URL}|Open>)", - channel: 'documentation', - rawMessage: true - } - always { - cleanWs() - } - } - } diff --git a/doc/check_translation.py b/doc/check_translation.py deleted file mode 100644 index 4f701d8..0000000 --- a/doc/check_translation.py +++ /dev/null @@ -1,21 +0,0 @@ -import fnmatch -import os - -matches = [] -for root, dirnames, filenames in os.walk('source/locale/fr/LC_MESSAGES/'): - for filename in fnmatch.filter(filenames, '*.po'): - filename = os.path.join(root, filename) - matches.append(os.path.join(root, filename)) - data = open(filename,'r').readlines() - val = 0 - linenumber = 1 - for line in data: - if line.startswith('msgstr ""'): - val = 1 - continue - if line.strip()=='' and val==1: - print( "empty translation line %s in %s" % (linenumber,filename)) - val = 0 - if line.startswith('#, fuzzy'): - print ("fuzzy line %s in %s " % (linenumber,filename)) - linenumber = linenumber + 1 diff --git a/doc/install_requirements.sh b/doc/install_requirements.sh index 6259862..c80c166 100644 --- a/doc/install_requirements.sh +++ b/doc/install_requirements.sh @@ -1,3 +1,2 @@ #!/bin/bash pip3 install -r requirements.txt -pre-commit install diff --git a/doc/requirements.txt b/doc/requirements.txt index 4795a23..dc84c8f 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -3,4 +3,3 @@ sphinx==3.0.3 sphinx_rtd_theme sphinxjp.themes.revealjs sphinx-intl -pre-commit diff --git a/doc/robots.txt b/doc/robots.txt deleted file mode 100644 index d8dd88f..0000000 --- a/doc/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -User-Agent: * -Disallow: -Sitemap: https://www.wapt.fr/sitemap.xml diff --git a/doc/run_checks.sh b/doc/run_checks.sh deleted file mode 100644 index 07fac21..0000000 --- a/doc/run_checks.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -pre-commit run --all-files -make linkcheck diff --git a/doc/security.txt b/doc/security.txt deleted file mode 100644 index c5a28ca..0000000 --- a/doc/security.txt +++ /dev/null @@ -1,2 +0,0 @@ -Contact: security@tranquil.it -Telephone: +33(0)240975755