diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,60 @@ +stage('Doc') { + parallel rust: { + node('rust') { + git 'https://devcentral.nasqueron.org/source/docker-registry-api.git' + + sh ''' + cargo build + cargo doc || cargo doc --no-deps + cd target/doc + tar czf ../doc.tar.gz * + ''' + + archiveArtifacts artifacts: 'target/doc-rust.tar.gz', onlyIfSuccessful: true + } + }, + swagger: { + node('node') { + git 'https://devcentral.nasqueron.org/source/docker-registry-api.git' + + sh ''' + mkdir -p target + cd target + + spectacle -d ../nasqueron-api-docker-registry.spec.yaml --logo-file + cd public + + mkdir -p images + cd images + wget https://assets.nasqueron.org/logos/logo-main-133px.png + cd .. + gsed -i "s/75px/131px/g" stylesheets/*.css + + tar czf ../doc-openapi.tar.gz * + ''' + } + } +} + +stage('Publish') { + steps { + sshPublisher( + failOnError: true, + publishers: [ + sshPublisherDesc( + configName: 'ysul-deploy', + verbose: true, + transfers: [ + sshTransfer( + sourceFiles: 'target/*.tar.gz', + removePrefix: 'target/', + remoteDirectory: 'workspace', + cleanRemote: true, + execCommand: 'deploy-docker-registry-api-doc' + ) + ] + ) + ] + ) + } +} \ No newline at end of file