-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev_codes_version
More file actions
154 lines (137 loc) · 4.19 KB
/
dev_codes_version
File metadata and controls
154 lines (137 loc) · 4.19 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
job('Moodle-dev-codes-version') {
parameters {
stringParam('COMMITMSG', 'Commit de test', 'Message pour commit.')
stringParam('BRANCH', 'UQAM_DEV_TEMP', 'Nom de la branche a creer.')
}
wrappers {
credentialsBinding {
usernamePassword('BB_USER', 'BB_PASS', 'uqamena-BB')
}
}
multiscm {
def baseBB = "https://bitbucket.org/uqam/"
git {
remote {
url(baseBB + "local_uqamlib.git")
credentials('uqamena-BB')
branch('UQAM_30_MM-608')
}
extensions {
cloneOptions {
shallow()
}
cleanAfterCheckout()
relativeTargetDirectory('local/uqamlib')
}
}
git {
remote {
url(baseBB + "local_codestests.git")
credentials('uqamena-BB')
branch('UQAM_30_MM-566')
}
extensions {
cloneOptions {
shallow()
}
cleanAfterCheckout()
relativeTargetDirectory('local/codestests')
}
}
git {
remote {
url(baseBB + "local_codesexternes.git")
credentials('uqamena-BB')
branch('UQAM_30_MM-566')
}
extensions {
cloneOptions {
shallow()
}
cleanAfterCheckout()
relativeTargetDirectory('local/codesexternes')
}
}
git {
remote {
url(baseBB + "local_uqinfosperso.git")
credentials('uqamena-BB')
branch('UQAM_30_MM-608-SHIB')
}
extensions {
cloneOptions {
shallow()
}
cleanAfterCheckout()
relativeTargetDirectory('local/uqinfosperso')
}
}
git {
remote {
url(baseBB + "local_resetext.git")
credentials('uqamena-BB')
branch('UQAM_30_MM-575')
}
extensions {
cloneOptions {
shallow()
}
cleanAfterCheckout()
relativeTargetDirectory('local/resetext')
}
}
}
steps {
shell('''
# Commencer clean
if [ -d \$WORKSPACE/moodle ]
then
rm -rf \$WORKSPACE/moodle
fi
# Verifier si la branche existe
CLONE_BRANCH=${BRANCH}
FIRST=`git ls-remote --heads https://\$BB_USER:\$BB_PASS@bitbucket.org/uqam/moodle.git ${BRANCH} | wc -l `
# Si la branche n'existe pas encore prendre autre
if [ "${FIRST}" -eq 0 ]
then
CLONE_BRANCH='UQAM_30_INT'
fi
git clone --depth 1 --branch ${CLONE_BRANCH} --single-branch git@bitbucket.org:uqam/moodle.git \$WORKSPACE/moodle
# uqamlib
rm -rf \$WORKSPACE/local/uqamlib.git;
rm -rf \$WORKSPACE/moodle/local/uqamlib
cp -r \$WORKSPACE/local/uqamlib \$WORKSPACE/moodle/local/uqamlib
rm -rf \$WORKSPACE/local/uqamlib
# codestests
rm -rf \$WORKSPACE/local/codestests.git
rm -rf \$WORKSPACE/moodle/local/codestests
cp -r \$WORKSPACE/local/codestests \$WORKSPACE/moodle/local/codestests
rm -rf \$WORKSPACE/local/codestests
# codesexternes
rm -rf \$WORKSPACE/local/codesexternes.git
rm -rf \$WORKSPACE/moodle/local/codesexternes
cp -r \$WORKSPACE/local/codesexternes \$WORKSPACE/moodle/local/codesexternes
rm -rf \$WORKSPACE/local/codesexternes
# uqinfosperso
rm -rf \$WORKSPACE/local/uqinfosperso.git
rm -rf \$WORKSPACE/moodle/local/uqinfosperso
cp -r \$WORKSPACE/local/uqinfosperso \$WORKSPACE/moodle/local/uqinfosperso
rm -rf \$WORKSPACE/local/uqinfosperso
# resetext
rm -rf \$WORKSPACE/local/resetext.git
rm -rf \$WORKSPACE/moodle/local/resetext
cp -r \$WORKSPACE/local/resetext \$WORKSPACE/moodle/local/resetext
rm -rf \$WORKSPACE/local/resetext
# Committer
cd \$WORKSPACE/moodle
git add local/uqamlib local/codestests local/codesexternes local/resetext local/uqinfosperso
git commit -m "${COMMITMSG}"
git remote add bb https://\$BB_USER:\$BB_PASS@bitbucket.org/uqam/moodle.git
if [ "${CLONE_BRANCH}" != "${BRANCH}" ]
then
git checkout -b ${BRANCH}
fi
git push bb ${BRANCH}:${BRANCH}
''')
}
}