pipeline {
    agent { docker { image 'pandoc/latex' } }
    stages {
        stage('generate epub') {
            steps {
                sh 'pandoc --toc --toc-depth=1 --epub-metadata=metadata.yaml --css=book.css -o myebook.epub --css book.css --toc -N -o build/output.epub src/title.txt src/*.md'
            }
        }
        stage('deploy book') {
            steps {
                sh 'cp myebook.epub /var/www/zerp/'
                }
        }
    }
}
