Skip to content

Commit

Permalink
vscode based container build project
Browse files Browse the repository at this point in the history
  • Loading branch information
kingster committed Jun 21, 2019
1 parent f2b22d2 commit 3b73e43
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 6 deletions.
28 changes: 28 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

FROM debian:9



# Install git, process tools
RUN apt-get update && apt-get -y install git procps wget

# Install C++ tools
RUN apt-get -y install build-essential cmake cppcheck valgrind pkg-config lsb-release

# Install Freeswitch dev
RUN echo "deb [trusted=yes] http://files.freeswitch.org/repo/deb/freeswitch-1.8/ stretch main" > /etc/apt/sources.list.d/freeswitch.list
RUN wget -O - https://files.freeswitch.org/repo/deb/freeswitch-1.8/fsstretch-archive-keyring.asc | apt-key add -

RUN apt-get update && apt-get -y install libfreeswitch-dev librdkafka-dev libz-dev libssl-dev

# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y
# && rm -rf /var/lib/apt/lists/*

# Set the default shell to bash instead of sh
ENV SHELL /bin/bash
21 changes: 21 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
{
"name": "C++",
"dockerFile": "Dockerfile",
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt", "seccomp=unconfined"
],

// "appPort": [],

"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},

//"postCreateCommand": "make",

"extensions": [
"ms-vscode.cpptools"
]
}
16 changes: 16 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Make",
"command": "make",
},
{
"label": "Release",
"type": "shell",
"command": "make release"
}
]
}
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ install: $(MODNAME)
install -d $(DESTDIR)/usr/lib/freeswitch/mod
install $(MODNAME) $(DESTDIR)/usr/lib/freeswitch/mod
install -d $(DESTDIR)/etc/freeswitch/autoload_configs
install event_kafka.conf.xml $(DESTDIR)/etc/freeswitch/autoload_configs/
install event_kafka.conf.xml $(DESTDIR)/etc/freeswitch/autoload_configs/

.PHONY: release
release: $(MODNAME)
distribution/make-deb.sh
4 changes: 1 addition & 3 deletions distribution/make-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ set -ex
BUILD_ROOT=$(mktemp -d)
VERSION=$(date +%s)

pushd /fs/mod_event_kafka
make
make install
popd

cp -r debian/* $BUILD_ROOT/
cp -r distribution/debian/* $BUILD_ROOT/

mkdir -p $BUILD_ROOT/usr/local/lib/
mkdir -p $BUILD_ROOT/usr/lib/freeswitch/mod
Expand Down
2 changes: 1 addition & 1 deletion event_kafka.conf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<settings>
<param name="bootstrap-servers" value="localhost:9092"/>
<param name="topic-prefix" value="topic_name"/>
<param name="buffer-size" value="256" />
<param name="buffer-size" value="16" />
</settings>
</configuration>
2 changes: 1 addition & 1 deletion mod_event_kafka.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ namespace mod_event_kafka {
//*****************************//
// GLOBALS //
//*****************************//
std::auto_ptr<KafkaModule> module;
std::unique_ptr<KafkaModule> module;


//*****************************//
Expand Down

0 comments on commit 3b73e43

Please sign in to comment.