Skip to content

Commit

Permalink
[#1246] Adapt website deploy to move to Gerrit
Browse files Browse the repository at this point in the history
- Configure build in Jenkinsfile
- Configure Javascript runtime in Gemfile

Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
  • Loading branch information
Karsten Thoms committed Aug 28, 2018
1 parent 194f3af commit 639f16f
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 1 deletion.
79 changes: 79 additions & 0 deletions Jenkinsfile
@@ -0,0 +1,79 @@
pipeline {
agent any

triggers {
pollSCM '*/2 * * * *'
}

stages {
stage ('Checkout') {
steps {
checkout scm
dir ('deploy-xtext-git-repo') {
git credentialsId: '29d79994-c415-4a38-9ab4-7463971ba682', url: 'ssh://genie.xtext@git.eclipse.org:29418/www.eclipse.org/Xtext', branch: 'master', poll: false
}
dir ('deploy-xtend-git-repo') {
git credentialsId: '29d79994-c415-4a38-9ab4-7463971ba682', url: 'ssh://genie.xtext@git.eclipse.org:29418/www.eclipse.org/xtend', branch: 'master', poll: false
}
}
}
stage('Generate site') {
steps {
echo 'Building..'
dir ('git-repo/xtext-website') {
sh '''
# generate things in _site
~/.rvm/gems/ruby-2.2.0/wrappers/jekyll build
'''
}
dir ('git-repo/xtend-website') {
sh '''
# generate things in _site
~/.rvm/gems/ruby-2.2.0/wrappers/jekyll build
'''
}
}
}
stage('Commit changes') {
steps {
dir ('deploy-xtext-git-repo') {
sh '''
cp -r $WORKSPACE/git-repo/xtext-website/_site/* .
git diff
git add --all :/ && git commit -m "Generated from commit: https://github.com/eclipse/xtext/commit/$GIT_COMMIT"
git status
'''
}
dir ('deploy-xtend-git-repo') {
sh '''
cp -r $WORKSPACE/git-repo/xtext-website/_site/* .
git diff
git add --all :/ && git commit -m "Generated from commit: https://github.com/eclipse/xtext/commit/$GIT_COMMIT"
git status
'''
}
}
}
stage('Deploy') {
steps {
echo 'Deploying....'
dir ('deploy-xtext-git-repo') {
sshagent(['29d79994-c415-4a38-9ab4-7463971ba682']) { //
sh '''
git push origin master
'''
}
deleteDir()
}
dir ('deploy-xtend-git-repo') {
sshagent(['29d79994-c415-4a38-9ab4-7463971ba682']) { //
sh '''
git push origin master
'''
}
deleteDir()
}
}
}
}
}
3 changes: 3 additions & 0 deletions xtend-website/Gemfile
@@ -1,5 +1,8 @@
source 'https://rubygems.org'

gem 'therubyracer'
gem 'execjs'

group :jekyll_plugins do
gem 'jekyll-markdown-block'
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
Expand Down
5 changes: 4 additions & 1 deletion xtext-website/Gemfile
@@ -1,6 +1,9 @@
source 'https://rubygems.org'

gem 'therubyracer'
gem 'execjs'

group :jekyll_plugins do
gem 'jekyll-markdown-block'
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
end

0 comments on commit 639f16f

Please sign in to comment.