-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
87 lines (82 loc) · 2.38 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
76
77
78
79
80
81
82
83
84
85
86
87
pipeline {
agent any
options {
timestamps()
ansiColor('xterm')
buildDiscarder(
logRotator(
artifactDaysToKeepStr: '9',
artifactNumToKeepStr: '5',
daysToKeepStr: '9',
numToKeepStr: '5'
)
)
}
environment {
workspace = pwd()
M0 = "static mimo"
}
stages {
stage('00') {
steps {
echo "### FETCH RUBY ###"
script {
sh(script:
"""
test -d .rbenv && cd .rbenv ; git pull || git clone https://github.com/rbenv/rbenv.git .rbenv
test -d .rbenv/plugins/ruby-build && cd .rbenv/plugins/ruby-build ; git pull || git clone https://github.com/rbenv/ruby-build.git .rbenv/plugins/ruby-build
""",
returnStdout: true).trim()
}
}
}
stage('01') {
steps {
echo "#### SETUP ENV ###"
script {
sh(script:
"""
echo 'export PATH=\"\$HOME/.rbenv/bin:\$PATH\"' >> .bash_profile
echo 'export PATH=\"\$HOME/.rbenv/plugins/ruby-build/bin:\$PATH\"' >> .bash_profile
echo 'eval \"\$(rbenv init -)\"' >> .bashrc
""", returnStdout: true).trim()
}
}
}
stage('02') {
steps {
echo "### COMPUTE ###"
script {
GOONE = sh(script: "echo FROM COMPUTE: [${env.M0}] XX", returnStdout: true).trim()
GOTWO = getstuff()
}
}
}
stage('03') {
steps {
echo "### USE ###"
script {
sh(script: "echo USE [${GOTWO}]", returnStdout: true).trim()
}
}
}
stage('04') {
steps {
echo "### MERGE ###"
script {
usestuff()
}
}
}
}
}
def getstuff() {
sh(script:
"""
echo \"[${env.workspace} ${GOONE}]\"
""", returnStdout: true).trim()
}
def usestuff() {
mikeyfunc = getstuff()
sh(script: "echo mimi [${mikeyfunc}] mimi", returnStdout: true).trim()
}