This is an automated email from the ASF dual-hosted git repository.

abesto pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-zipkin-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 8aee5c5  Added Jenkinsfile
8aee5c5 is described below

commit 8aee5c5ec0ac7143d0452bd8d90ab9050c7effb4
Author: Zoltán Nagy <[email protected]>
AuthorDate: Sun Nov 4 13:20:31 2018 +0000

    Added Jenkinsfile
---
 Jenkinsfile | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 99 insertions(+)

diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..4068696
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,99 @@
+pipeline {
+       agent {
+               label 'git-websites'
+       }
+
+       options {
+               buildDiscarder(logRotator(numToKeepStr: '10'))
+               timestamps()
+       }
+
+       triggers {
+               pollSCM('H/15 * * * *')
+       }
+
+       stages {
+               stage('SCM Checkout') {
+                       steps {
+                               deleteDir()
+                               checkout scm
+                       }
+               }
+
+               stage('Check environment') {
+                       steps {
+                               sh 'env'
+                               sh 'pwd'
+                               sh 'ls'
+                               sh 'alias'
+                               sh 'git config --list --local'
+                               sh 'git config --list --global'
+                               sh 'git status'
+                       }
+               }
+
+               stage('Install Jekyll') {
+                       steps {
+                               sh '''
+                               . "${rvm_path}/scripts/rvm"
+                               set -e
+                               gem install bundler
+                               bundle install
+                               '''
+                       }
+               }
+
+               stage('Build site') {
+                       steps {
+                               sh '''
+                               . "${rvm_path}/scripts/rvm"
+                               set -e 
+                               bundle exec jekyll build --verbose
+                               '''
+                               sh 'ls -lR _site'
+                       }
+               }
+
+               stage('Publish') {
+                       steps {
+                               sh '''
+                               set -xeuo pipefail
+
+                               srchash="$(git rev-parse --short HEAD)"
+                               commitmsg="Automatic site generation from 
${srchash}"
+
+                               builddir="$(mktemp -d)"
+                               mv _site "${builddir}/"
+                               ls -lR "${builddir}/_site/"
+
+                               git fetch origin
+                               git reset --hard
+                               git checkout asf-site
+                               git log -3
+                               git status
+
+                               rsync -avrh --delete --exclude=".git" 
"${builddir}/_site/" ./
+                               git status
+                               git diff
+
+                               git add .
+
+                               if [ -z "$(git status --porcelain)" ]; then
+                                       echo 'No changes to commit/push'
+                               else
+                                       git commit -m "$commitmsg"
+                                       git pull --rebase
+                                       git log asf-site -3
+                                       git push origin asf-site
+                               fi
+                               '''
+                       }
+               }
+       }
+
+       post {
+               always {
+                       deleteDir()
+               }
+       }
+}

Reply via email to