diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000000..2e8dbddd4de --- /dev/null +++ b/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() + } + } + } + } +} \ No newline at end of file diff --git a/xtend-website/Gemfile b/xtend-website/Gemfile index d66536c5a55..ccede6fa578 100644 --- a/xtend-website/Gemfile +++ b/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? diff --git a/xtext-website/Gemfile b/xtext-website/Gemfile index d66536c5a55..a33833c893b 100644 --- a/xtext-website/Gemfile +++ b/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