Added doc deployment
All checks were successful
Gitsokyo/bot-base/pipeline/head This commit looks good
All checks were successful
Gitsokyo/bot-base/pipeline/head This commit looks good
This commit is contained in:
parent
25b004dcd7
commit
13c1b1292b
9
Dockerfile
Normal file
9
Dockerfile
Normal file
@ -0,0 +1,9 @@
|
||||
FROM python:3.8
|
||||
|
||||
RUN apt-get update && apt-get install -y\
|
||||
rsync \
|
||||
openssh-client
|
||||
|
||||
RUN pip install pipenv
|
||||
|
||||
CMD ["/bin/bash"]
|
64
Jenkinsfile
vendored
64
Jenkinsfile
vendored
@ -1,16 +1,27 @@
|
||||
pipeline {
|
||||
agent none
|
||||
agent {
|
||||
dockerfile {
|
||||
args "-u root"
|
||||
}
|
||||
}
|
||||
environment {
|
||||
SPHINXOPTS = '-w sphinx-build.log'
|
||||
DEPLOY_HOST = 'docs@172.17.0.1'
|
||||
DEPLOY_PATH = 'www/bot-base/'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Test') {
|
||||
agent {
|
||||
docker {
|
||||
image 'python:3.8'
|
||||
}
|
||||
}
|
||||
stage('Install Dependencies') {
|
||||
steps {
|
||||
sh "pip install --no-cache-dir -t python pipenv"
|
||||
sh "PYTHONPATH=\$(pwd)/python PIPENV_VENV_IN_PROJECT=true python/bin/pipenv sync --sequential --dev"
|
||||
sh "export PYTHONPATH=\$(pwd)/python && cd src && PIPENV_VENV_IN_PROJECT=true \${PYTHONPATH}/bin/pipenv run pytest -p no:warnings --junit-xml test-reports/results.xml"
|
||||
sh 'pipenv sync --sequential --dev'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Run Tests') {
|
||||
steps {
|
||||
sh '''export PYTHONPATH=$(pwd)/python
|
||||
cd src
|
||||
pipenv run pytest -p no:warnings --junit-xml test-reports/results.xml'''
|
||||
}
|
||||
post {
|
||||
always {
|
||||
@ -18,5 +29,38 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build Documentation') {
|
||||
steps {
|
||||
sh '''export PYTHONPATH=$(pwd)/python
|
||||
cd doc
|
||||
rm -f sphinx-build.log
|
||||
pipenv run make html'''
|
||||
}
|
||||
post {
|
||||
failure {
|
||||
sh 'cat doc/sphinx-build.log'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy Documentation') {
|
||||
steps {
|
||||
sshagent(credentials: ['1cf72f47-b70c-4f90-a958-020956099d19']) {
|
||||
sh '''cd doc
|
||||
rm -f rsync.log
|
||||
ssh -o StrictHostKeyChecking=no -o BatchMode=yes ${DEPLOY_HOST} mkdir -p ${DEPLOY_PATH}${GIT_BRANCH#*/}/
|
||||
rsync -aze 'ssh -o StrictHostKeyChecking=no -o BatchMode=yes' \
|
||||
--log-file=rsync.log \
|
||||
--delete \
|
||||
./build/html/ ${DEPLOY_HOST}:${DEPLOY_PATH}${GIT_BRANCH#*/}/'''
|
||||
}
|
||||
}
|
||||
post {
|
||||
failure {
|
||||
sh 'cat doc/rsync.log'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user