Skip to content

Commit 3b73e43

Browse files
committed
vscode based container build project
1 parent f2b22d2 commit 3b73e43

File tree

7 files changed

+73
-6
lines changed

7 files changed

+73
-6
lines changed

.devcontainer/Dockerfile

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#-------------------------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
4+
#-------------------------------------------------------------------------------------------------------------
5+
6+
FROM debian:9
7+
8+
9+
10+
# Install git, process tools
11+
RUN apt-get update && apt-get -y install git procps wget
12+
13+
# Install C++ tools
14+
RUN apt-get -y install build-essential cmake cppcheck valgrind pkg-config lsb-release
15+
16+
# Install Freeswitch dev
17+
RUN echo "deb [trusted=yes] http://files.freeswitch.org/repo/deb/freeswitch-1.8/ stretch main" > /etc/apt/sources.list.d/freeswitch.list
18+
RUN wget -O - https://files.freeswitch.org/repo/deb/freeswitch-1.8/fsstretch-archive-keyring.asc | apt-key add -
19+
20+
RUN apt-get update && apt-get -y install libfreeswitch-dev librdkafka-dev libz-dev libssl-dev
21+
22+
# Clean up
23+
RUN apt-get autoremove -y \
24+
&& apt-get clean -y
25+
# && rm -rf /var/lib/apt/lists/*
26+
27+
# Set the default shell to bash instead of sh
28+
ENV SHELL /bin/bash

.devcontainer/devcontainer.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
2+
{
3+
"name": "C++",
4+
"dockerFile": "Dockerfile",
5+
"runArgs": [
6+
"--cap-add=SYS_PTRACE",
7+
"--security-opt", "seccomp=unconfined"
8+
],
9+
10+
// "appPort": [],
11+
12+
"settings": {
13+
"terminal.integrated.shell.linux": "/bin/bash"
14+
},
15+
16+
//"postCreateCommand": "make",
17+
18+
"extensions": [
19+
"ms-vscode.cpptools"
20+
]
21+
}

.vscode/tasks.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "Make",
8+
"command": "make",
9+
},
10+
{
11+
"label": "Release",
12+
"type": "shell",
13+
"command": "make release"
14+
}
15+
]
16+
}

Makefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,8 @@ install: $(MODNAME)
2626
install -d $(DESTDIR)/usr/lib/freeswitch/mod
2727
install $(MODNAME) $(DESTDIR)/usr/lib/freeswitch/mod
2828
install -d $(DESTDIR)/etc/freeswitch/autoload_configs
29-
install event_kafka.conf.xml $(DESTDIR)/etc/freeswitch/autoload_configs/
29+
install event_kafka.conf.xml $(DESTDIR)/etc/freeswitch/autoload_configs/
30+
31+
.PHONY: release
32+
release: $(MODNAME)
33+
distribution/make-deb.sh

distribution/make-deb.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ set -ex
44
BUILD_ROOT=$(mktemp -d)
55
VERSION=$(date +%s)
66

7-
pushd /fs/mod_event_kafka
87
make
98
make install
10-
popd
119

12-
cp -r debian/* $BUILD_ROOT/
10+
cp -r distribution/debian/* $BUILD_ROOT/
1311

1412
mkdir -p $BUILD_ROOT/usr/local/lib/
1513
mkdir -p $BUILD_ROOT/usr/lib/freeswitch/mod

event_kafka.conf.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<settings>
33
<param name="bootstrap-servers" value="localhost:9092"/>
44
<param name="topic-prefix" value="topic_name"/>
5-
<param name="buffer-size" value="256" />
5+
<param name="buffer-size" value="16" />
66
</settings>
77
</configuration>

mod_event_kafka.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ namespace mod_event_kafka {
261261
//*****************************//
262262
// GLOBALS //
263263
//*****************************//
264-
std::auto_ptr<KafkaModule> module;
264+
std::unique_ptr<KafkaModule> module;
265265

266266

267267
//*****************************//

0 commit comments

Comments
 (0)