You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zipkin.apache.org by ab...@apache.org on 2019/04/21 21:02:39 UTC
[incubator-zipkin-website] 15/16: Added Jenkinsfile
This is an automated email from the ASF dual-hosted git repository.
abesto pushed a commit to branch sync-from-githubio
in repository https://gitbox.apache.org/repos/asf/incubator-zipkin-website.git
commit d20b51d3617df8a23724e140fe781c109d6b0081
Author: Zoltán Nagy <ab...@apache.org>
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()
+ }
+ }
+}