Commit | Line | Data |
---|---|---|
9c41f7e2 JR |
1 | #!/bin/sh -ex |
2 | # | |
3 | # Copyright (C) 2016 - Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com> | |
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU General Public License as published by | |
7 | # the Free Software Foundation, either version 3 of the License, or | |
8 | # (at your option) any later version. | |
9 | # | |
10 | # This program is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | # GNU General Public License for more details. | |
14 | # | |
15 | # You should have received a copy of the GNU General Public License | |
16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
17 | ||
18 | PYTHON_2_ENV=$WORKSPACE"/.python2_venv" | |
19 | PYTHON_3_ENV=$WORKSPACE"/.python3_venv" | |
20 | ||
21 | virtualenv -p python2 $PYTHON_2_ENV | |
22 | virtualenv -p python3 $PYTHON_3_ENV | |
23 | ||
24 | # Prepare python 3 env | |
25 | . $PYTHON_3_ENV/bin/activate | |
26 | pip install gitpython | |
27 | pip install pyyaml | |
28 | ||
29 | # Run the kernel seed generator | |
30 | python $WORKSPACE/automation/kernel-seed.py --kernel-path $WORKSPACE/kernel --kernel-cutoff 2.6.36 > $WORKSPACE/jobs/inc/kernel-versions.yaml.inc | |
31 | ||
32 | deactivate | |
33 | ||
34 | # Prepare JJB python 2 environment | |
35 | . $PYTHON_2_ENV/bin/activate | |
36 | pip install git+git://github.com/mjeanson/jenkins-job-builder | |
37 | ||
38 | cp $WORKSPACE/etc/jenkins_jobs.ini-sample $WORKSPACE/etc/jenkins_jobs.ini | |
39 | ||
40 | # Prepare configuration file | |
41 | set +x | |
42 | sed -i -e "s/user=jenkins/user=$JJB_JENKINS_USER/g" $WORKSPACE/etc/jenkins_jobs.ini | |
43 | sed -i -e "s/password=1234567890abcdef1234567890abcdef/password=$JJB_JENKINS_TOKEN/g" $WORKSPACE/etc/jenkins_jobs.ini | |
44 | set -x | |
45 | ||
46 | jenkins-jobs --conf $WORKSPACE/etc/jenkins_jobs.ini delete --path $WORKSPACE/jobs/lttng-modules.yaml:$WORKSPACE/jobs/kernel.yaml \*rc\*_build | |
47 | jenkins-jobs --conf $WORKSPACE/etc/jenkins_jobs.ini update $WORKSPACE/jobs/lttng-modules.yaml:$WORKSPACE/jobs/kernel.yaml | |
48 | ||
49 | deactivate | |
50 | # EOF |