cleanup
This commit is contained in:
parent
4e4165958b
commit
e5da6857a4
51
doc/.gitignore
vendored
51
doc/.gitignore
vendored
@ -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
|
@ -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
|
252
doc/Jenkinsfile
vendored
252
doc/Jenkinsfile
vendored
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
@ -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
|
@ -1,3 +1,2 @@
|
||||
#!/bin/bash
|
||||
pip3 install -r requirements.txt
|
||||
pre-commit install
|
||||
|
@ -3,4 +3,3 @@ sphinx==3.0.3
|
||||
sphinx_rtd_theme
|
||||
sphinxjp.themes.revealjs
|
||||
sphinx-intl
|
||||
pre-commit
|
||||
|
@ -1,3 +0,0 @@
|
||||
User-Agent: *
|
||||
Disallow:
|
||||
Sitemap: https://www.wapt.fr/sitemap.xml
|
@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
pre-commit run --all-files
|
||||
make linkcheck
|
@ -1,2 +0,0 @@
|
||||
Contact: security@tranquil.it
|
||||
Telephone: +33(0)240975755
|
Loading…
Reference in New Issue
Block a user