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 5dd27f4
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 2 deletions.
80 changes: 80 additions & 0 deletions Jenkinsfile
@@ -0,0 +1,80 @@
pipeline {
agent any

triggers {
pollSCM('H/2 * * * *')
}

stages {
stage ('Checkout') {
steps {
sshagent(['29d79994-c415-4a38-9ab4-7463971ba682']) { //
sh '''
rm -rf deploy-xtext-git-repo
rm -rf deploy-xtend-git-repo
git clone -b master ssh://genie.xtext@git.eclipse.org:29418/www.eclipse.org/Xtext deploy-xtext-git-repo
git clone -b master ssh://genie.xtext@git.eclipse.org:29418/www.eclipse.org/xtend deploy-xtend-git-repo
'''
}
}
}
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/xtend-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()
}
}
}
}
}
5 changes: 4 additions & 1 deletion xtend-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
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 5dd27f4

Please sign in to comment.