feat: add libwebsockets and Jenkinsfile
Some checks failed
gitea-sync/mosquito_build/pipeline/head There was a failure building this commit
Some checks failed
gitea-sync/mosquito_build/pipeline/head There was a failure building this commit
This commit is contained in:
parent
8b180da9fb
commit
19fca4d301
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +1,6 @@
|
|||||||
[submodule "mosquitto"]
|
[submodule "mosquitto"]
|
||||||
path = mosquitto
|
path = mosquitto
|
||||||
url = https://github.com/eclipse/mosquitto.git
|
url = https://github.com/eclipse/mosquitto.git
|
||||||
|
[submodule "libwebsockets"]
|
||||||
|
path = libwebsockets
|
||||||
|
url = https://github.com/dmikushin/libwebsockets.git
|
||||||
|
103
Jenkinsfile
vendored
Normal file
103
Jenkinsfile
vendored
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
def build_moquitto()
|
||||||
|
{
|
||||||
|
sh '''
|
||||||
|
set -e
|
||||||
|
DESTDIR="$WORKSPACE/build/$arch/"
|
||||||
|
[ -d "$DESTDIR" ] && rm -rf "$DESTDIR" || true
|
||||||
|
mkdir -p "$DESTDIR"
|
||||||
|
|
||||||
|
# build libwebsocket first
|
||||||
|
cd $WORKSPACE
|
||||||
|
[ -d libwebsockets/build/ ] && rm -rf libwebsockets/build/ || true
|
||||||
|
mkdir -p libwebsockets/build/
|
||||||
|
cd libwebsockets/build/
|
||||||
|
cmake -DLWS_WITH_EXTERNAL_POLL=ON -DLWS_WITH_STATIC=1 -DLWS_WITH_SHARED=0 ..
|
||||||
|
make
|
||||||
|
|
||||||
|
# now build moquitto
|
||||||
|
cd $WORKSPACE/mosquitto
|
||||||
|
make reallyclean || true
|
||||||
|
make WITH_WEBSOCKETS=yes \
|
||||||
|
WITH_CJSON=no \
|
||||||
|
WITH_SHARED_LIBRARIES=no \
|
||||||
|
WITH_SYSTEMD=no \
|
||||||
|
WITH_DOCS=no \
|
||||||
|
CFLAGS="-I $WORKSPACE/libwebsockets/build/include/" \
|
||||||
|
LDFLAGS="-L $WORKSPACE/libwebsockets/build/lib"
|
||||||
|
|
||||||
|
# install neccessary file
|
||||||
|
mkdir -p "$DESTDIR/opt/www/bin/"
|
||||||
|
mkdir -p "$DESTDIR/opt/www/config/"
|
||||||
|
cp ./src/mosquitto $DESTDIR/opt/www/bin/
|
||||||
|
cp ./apps/mosquitto_passwd/mosquitto_passwd $DESTDIR/opt/www/bin/
|
||||||
|
cp ./mosquitto.conf $DESTDIR/opt/www/config/
|
||||||
|
'''
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
pipeline{
|
||||||
|
agent { node{ label'master' }}
|
||||||
|
options {
|
||||||
|
buildDiscarder(logRotator(numToKeepStr: "1"))
|
||||||
|
// Enable timestamps in build log console
|
||||||
|
timestamps()
|
||||||
|
// Maximum time to run the whole pipeline before canceling it
|
||||||
|
timeout(time: 3, unit: 'HOURS')
|
||||||
|
// Use Jenkins ANSI Color Plugin for log console
|
||||||
|
ansiColor('xterm')
|
||||||
|
// Limit build concurrency to 1 per branch
|
||||||
|
disableConcurrentBuilds()
|
||||||
|
}
|
||||||
|
stages
|
||||||
|
{
|
||||||
|
stage('Build AMD64') {
|
||||||
|
agent {
|
||||||
|
docker {
|
||||||
|
image 'xsangle/ci-tools:bionic-amd64'
|
||||||
|
reuseNode true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
script{
|
||||||
|
env.arch = "amd64"
|
||||||
|
}
|
||||||
|
build_moquitto()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Build ARM64') {
|
||||||
|
agent {
|
||||||
|
docker {
|
||||||
|
image 'xsangle/ci-tools:bionic-arm64'
|
||||||
|
reuseNode true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
script{
|
||||||
|
env.arch = "arm64"
|
||||||
|
}
|
||||||
|
build_moquitto()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Build ARM') {
|
||||||
|
agent {
|
||||||
|
docker {
|
||||||
|
image 'xsangle/ci-tools:bionic-arm'
|
||||||
|
reuseNode true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
script{
|
||||||
|
env.arch = "arm"
|
||||||
|
}
|
||||||
|
build_moquitto()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Archive') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
archiveArtifacts artifacts: 'build/', fingerprint: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
libwebsockets
Submodule
1
libwebsockets
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 7e1033671787300277e880d46d64a7ad27f4a09e
|
Loading…
Reference in New Issue
Block a user