forked from equinor/nex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
82 lines (74 loc) · 2.76 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
#!/usr/bin/env groovy
pipeline {
agent none
stages {
stage('build') {
agent { label 'si-build' }
steps {
sh """
rm -rf libecl
PYTHON_VERSION=2.7.13 GCC_VERSION="4.9.4" source /prog/sdpsoft/env.sh
root_dir=\$PWD
virtualenv venv
source venv/bin/activate
pip install --upgrade -r requirements.txt
git clone https://github.com/Statoil/libecl.git
mkdir libecl/build
pushd libecl/build
pip install --upgrade -r ../requirements.txt
/project/res/x86_64_RH_6/bin/cmake \
-DBUILD_SHARED_LIBS=ON \
-DENABLE_PYTHON=ON \
-DINSTALL_ERT_LEGACY=ON \
-DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-3/root/usr/bin/g++ \
-DCMAKE_INSTALL_PREFIX=\$root_dir/ecl_install \
..
make install -j3
popd
mkdir nex_install
mkdir build
pushd build
/project/res/x86_64_RH_6/bin/cmake \
-Decl_DIR=\$root_dir/ecl_install/share/cmake/ecl \
-DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-3/root/usr/bin/g++ \
..
make
popd
deactivate
"""
stash name: 'nex-build', includes: 'build/'
stash name: 'ecl', includes: 'ecl_install/'
stash name: 'venv', includes: 'venv/'
}
post {
always {
deleteDir()
}
}
}
stage('test'){
agent { label 'si-build' }
steps {
unstash 'ecl'
unstash 'nex-build'
unstash 'venv'
sh """
PYTHON_VERSION=2.7.13 GCC_VERSION="4.9.4" source /prog/sdpsoft/env.sh
root_dir=\$PWD
export LD_LIBRARY_PATH="\$root_dir/ecl_install/lib:\$LD_LIBRARY_PATH"
export PYTHONPATH="\$root_dir/ecl_install/lib/python2.7/site-packages/:\$PYTHONPATH"
source venv/bin/activate
python -c "import ecl; print ecl.__file__"
pushd build
make CTEST_OUTPUT_ON_FAILURE=1 test
deactivate
"""
}
post {
always {
deleteDir()
}
}
}
}
}