-
Notifications
You must be signed in to change notification settings - Fork 317
/
Jenkinsfile
75 lines (72 loc) · 2.08 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
pipeline {
agent any
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'
}
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'
}
}
}
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
'''
}
}
dir ('deploy-xtend-git-repo') {
sshagent(['29d79994-c415-4a38-9ab4-7463971ba682']) { //
sh '''
git push origin master
'''
}
}
}
}
}
}