mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-07 08:15:50 +02:00
jenkinsfile: prepare steps
Change-Id: If54b46f1f1c7629a728a97d0803d986d3d5cecd9
This commit is contained in:
parent
31494c68da
commit
5083e2a75f
1 changed files with 79 additions and 57 deletions
136
extras/ci/client-qt-gnulinux/Jenkinsfile
vendored
136
extras/ci/client-qt-gnulinux/Jenkinsfile
vendored
|
@ -53,73 +53,95 @@ pipeline {
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('SCM Checkout') {
|
stage('SCM Checkout') {
|
||||||
deleteDir()
|
steps {
|
||||||
// Checkout jami-project to obtain daemon/LRC/client-qt repositories
|
script {
|
||||||
sh """
|
deleteDir()
|
||||||
|
// Checkout jami-project to obtain daemon/LRC/client-qt repositories
|
||||||
|
sh """
|
||||||
|
|
||||||
git clone --depth=1 --branch=master https://${JAMI_GERRIT_URL}/jami-project
|
git clone --depth=1 --branch=master https://${JAMI_GERRIT_URL}/jami-project
|
||||||
cd jami-project
|
cd jami-project
|
||||||
# git submodule update --init daemon lrc client-qt
|
# git submodule update --init daemon lrc client-qt
|
||||||
git submodule update --init daemon client-qt
|
git submodule update --init daemon client-qt
|
||||||
git submodule foreach 'git checkout master'
|
git submodule foreach 'git checkout master'
|
||||||
|
|
||||||
cd client-qt
|
cd client-qt
|
||||||
git fetch "https://${JAMI_GERRIT_URL}/jami-client-qt" ${GERRIT_REFSPEC}
|
git fetch "https://${JAMI_GERRIT_URL}/jami-client-qt" ${GERRIT_REFSPEC}
|
||||||
git checkout FETCH_HEAD
|
git checkout FETCH_HEAD
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
cd ..
|
cd ..
|
||||||
"""
|
"""
|
||||||
topDir = pwd() + '/jami-project'
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dir (topDir) {
|
stage('Building Docker Image') {
|
||||||
stage('Building Docker Image') {
|
steps {
|
||||||
docker.build('client-validation', "-f client-qt/extras/build/docker/Dockerfile.client-qt-gnulinux --no-cache .")
|
dir (pwd() + '/jami-project') {
|
||||||
}
|
script {
|
||||||
|
docker.build('client-validation', "-f client-qt/extras/build/docker/Dockerfile.client-qt-gnulinux --no-cache .")
|
||||||
def jenkinsUID = sh(returnStdout: true, script: 'id -u jenkins').replaceAll("\n", '').trim()
|
|
||||||
def jenkinsGID = sh(returnStdout: true, script: 'id -g jenkins').replaceAll("\n", '').trim()
|
|
||||||
def jenkinsUser = jenkinsUID+':'+jenkinsGID
|
|
||||||
def cpuCount = sh returnStdout: true, script: 'nproc || echo -n 4'
|
|
||||||
|
|
||||||
docker.image('client-validation').withRun('-t -u '+jenkinsUser+' -v '+pwd()+':/foo:rw -w /foo -e BATCH_MODE=1', '/bin/bash') {
|
|
||||||
container -> code:{
|
|
||||||
def base_cmd = 'docker exec -t '+container.id+" sh -c '"
|
|
||||||
def exec_cmd = { cmd -> sh base_cmd+cmd+"'" }
|
|
||||||
|
|
||||||
def dockerTopDir = '/foo'
|
|
||||||
def daemonDir = dockerTopDir + '/daemon'
|
|
||||||
def clientDir = dockerTopDir + '/client-qt'
|
|
||||||
def installDir = dockerTopDir + '/install'
|
|
||||||
|
|
||||||
stage('Build Client') {
|
|
||||||
ansiColor('css') {
|
|
||||||
exec_cmd("""
|
|
||||||
cd ${clientDir}
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake .. -DCMAKE_INSTALL_PREFIX=${installDir}/client-qt \
|
|
||||||
-DLIBJAMI_INCLUDE_DIR=${daemonDir}/src/jami \
|
|
||||||
-DLIBJAMI_XML_INTERFACES_DIR=${daemonDir}/bin/dbus \
|
|
||||||
-DCMAKE_PREFIX_PATH=/usr/lib/libqt-jami \
|
|
||||||
-DENABLE_TESTS=True
|
|
||||||
make -j${cpuCount}
|
|
||||||
make install
|
|
||||||
""")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stage('Run Tests') {
|
stage('Build project') {
|
||||||
ansiColor('css') {
|
steps {
|
||||||
exec_cmd("""
|
script {
|
||||||
cd ${clientDir}
|
def jenkinsUID = sh(returnStdout: true, script: 'id -u jenkins').replaceAll("\n", '').trim()
|
||||||
cd tests/qml
|
def jenkinsGID = sh(returnStdout: true, script: 'id -g jenkins').replaceAll("\n", '').trim()
|
||||||
../../../build/tests/qml_tests
|
def jenkinsUser = jenkinsUID+':'+jenkinsGID
|
||||||
""")
|
def cpuCount = sh returnStdout: true, script: 'nproc || echo -n 4'
|
||||||
|
|
||||||
|
docker.image('client-validation').withRun('-t -u '+jenkinsUser+' -v '+pwd()+':/foo:rw -w /foo -e BATCH_MODE=1', '/bin/bash') {
|
||||||
|
container -> code:{
|
||||||
|
def base_cmd = 'docker exec -t '+container.id+" sh -c '"
|
||||||
|
def exec_cmd = { cmd -> sh base_cmd+cmd+"'" }
|
||||||
|
|
||||||
|
def dockerTopDir = '/foo'
|
||||||
|
def daemonDir = dockerTopDir + '/daemon'
|
||||||
|
def clientDir = dockerTopDir + '/client-qt'
|
||||||
|
def installDir = dockerTopDir + '/install'
|
||||||
|
|
||||||
|
stage('Build Client') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
ansiColor('css') {
|
||||||
|
exec_cmd("""
|
||||||
|
cd ${clientDir}
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake .. -DCMAKE_INSTALL_PREFIX=${installDir}/client-qt \
|
||||||
|
-DLIBJAMI_INCLUDE_DIR=${daemonDir}/src/jami \
|
||||||
|
-DLIBJAMI_XML_INTERFACES_DIR=${daemonDir}/bin/dbus \
|
||||||
|
-DCMAKE_PREFIX_PATH=/usr/lib/libqt-jami \
|
||||||
|
-DENABLE_TESTS=True
|
||||||
|
make -j${cpuCount}
|
||||||
|
make install
|
||||||
|
""")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Run Tests') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
ansiColor('css') {
|
||||||
|
exec_cmd("""
|
||||||
|
cd ${clientDir}
|
||||||
|
cd tests/qml
|
||||||
|
../../../build/tests/qml_tests
|
||||||
|
""")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue