Page MenuHomeDevCentral

Generate Cargo documentation automatically and publish it to
Closed, ResolvedPublic


A Jenkins task should be run when a new commit is pushed to rLF master branch with something like:


cargo doc --no-deps
scp -rp target/doc/*

That will push new crate documentation to

Event Timeline


With this pipeline, documentation is generated at*zip*/

If we decompress the archive, documentation is in the archive/target/doc/ folder.

Next step

One of them:

  • Publish to through Jenkinsfile (requires the node and Ysul to be configured with a relevant ssh key)
  • Publish through Jenkins ssh plugin (solution used on the old CI, probably not compatible with pipelines, credentials were in Jenkins)
  • Trigger a Salt task to fetch the artifact archive and publish it
dereckson updated the task description. (Show Details)

Jenkins job works.

Job is triggered by H16 on commit. The Herald rule has successfully been triggered by 80ee76e8cdcf and successfully triggered the build 16 on Jenkins.

node('rust') {
    stage('Checkout') {
        git ''

    try {
        stage('Build')  {
            sh 'cargo build'

        stage('Doc') {
            sh 'cargo doc || cargo doc --no-deps'
            sh '''
                cd target/doc
                tar czf ../doc.tar.gz *
    } finally {
         archiveArtifacts artifacts: 'target/doc/**', onlyIfSuccessful: true
         archiveArtifacts artifacts: 'target/doc.tar.gz', onlyIfSuccessful: true
         stage('Publish') {
                failOnError: true,
                publishers: [
                        configName: 'ysul-deploy',
                        verbose: true,
                        transfers: [
                                sourceFiles: 'target/doc.tar.gz',
                                removePrefix: 'target/',
                                remoteDirectory: 'workspace',
                                cleanRemote: true,
                                execCommand: 'tar xzvf workspace/doc.tar.gz -C /var/wwwroot/'
dereckson claimed this task.