Skip to content

Commit

Permalink
Add support to CircleCI (lynckia#967)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcague authored Jul 14, 2017
1 parent b39d04d commit f56f7fd
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 15 deletions.
65 changes: 65 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
version: 2.0

jobs:
build:
docker:
- image: buildpack-deps:trusty-curl

working_directory: /tmp/licode

steps:
- checkout

- setup_remote_docker

- run:
name: Install Docker client
command: |
set -x
VER="17.03.0-ce"
curl -L -o /tmp/docker-$VER.tgz https://get.docker.com/builds/Linux/x86_64/docker-$VER.tgz
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
mv /tmp/docker/* /usr/bin
- run:
name: Pull latest docker image
command: |
docker pull lynckia/licode:latest
- run:
name: Build docker image
command: |
echo Building lynckia/licode:develop
docker build --cache-from lynckia/licode:latest -t lynckia/licode:develop .
- run:
name: Lint Erizo
command: |
docker run --rm -ti -w /opt/licode/erizo/build/ --entrypoint /bin/bash lynckia/licode:develop -c "make lint"
- run:
name: Unit Tests Erizo
command: |
docker run --rm -ti -w /opt/licode/erizo/build/ --entrypoint /bin/bash lynckia/licode:develop -c "ctest --verbose"
- run:
name: Lint Javascript
command: |
docker run --rm -ti -w /opt/licode --entrypoint /bin/bash lynckia/licode:develop -c ". ./build/libdeps/nvm/nvm.sh && npm install && npm run lint"
docker run --rm -ti -w /opt/licode --entrypoint /bin/bash lynckia/licode:develop -c ". ./build/libdeps/nvm/nvm.sh && npm install && npm run lintClient"
- run:
name: Unit Tests Javascript
command: |
docker run --rm -ti -w /opt/licode --entrypoint /bin/bash lynckia/licode:develop -c ". ./build/libdeps/nvm/nvm.sh && npm install && cp scripts/licode_default.js licode_config.js && npm run test"
- deploy:
name: Push Licode Docker image
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
SHORT_GIT_HASH="$(echo ${CIRCLE_SHA1} | cut -c -8)"
docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}
echo Tagging to lynckia/licode:${SHORT_GIT_HASH}
docker tag lynckia/licode:develop lynckia/licode:${SHORT_GIT_HASH}
docker push lynckia/licode:develop
fi
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ COPY . /opt/licode
# Clone and install licode
WORKDIR /opt/licode/scripts

RUN ./installUbuntuDeps.sh --cleanup && \
./installErizo.sh && \
RUN ./installUbuntuDeps.sh --cleanup --fast && \
./installErizo.sh -feacs && \
./../nuve/installNuve.sh && \
./installBasicExample.sh

Expand Down
6 changes: 1 addition & 5 deletions erizo/buildProject.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@

set -e

runcmake() {
cmake ../src
echo "Done"
}
BIN_DIR="build"
if [ -d $BIN_DIR ]; then
cd $BIN_DIR
make
make $*
else
echo "Error, build directory does not exist, run generateProject.sh first"
fi
8 changes: 6 additions & 2 deletions scripts/installErizo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ CURRENT_DIR=`pwd`
LIB_DIR=$BUILD_DIR/libdeps
PREFIX_DIR=$LIB_DIR/build/
NVM_CHECK="$PATHNAME"/checkNvm.sh
FAST_MAKE=''


export ERIZO_HOME=$ROOT/erizo
Expand Down Expand Up @@ -51,7 +52,7 @@ install_erizo(){
echo 'Installing erizo...'
cd $ROOT/erizo
./generateProject.sh
./buildProject.sh
./buildProject.sh $FAST_MAKE
check_result $?
cd $CURRENT_DIR
}
Expand Down Expand Up @@ -99,7 +100,7 @@ then
install_erizo_controller
install_spine
else
while getoptsheacst” OPTION
while getoptsheacstf” OPTION
do
case $OPTION in
h)
Expand All @@ -121,6 +122,9 @@ else
t)
execute_tests
;;
f)
FAST_MAKE='-j4'
;;
?)
usage
exit
Expand Down
16 changes: 10 additions & 6 deletions scripts/installUbuntuDeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ NVM_CHECK="$PATHNAME"/checkNvm.sh

LIB_DIR=$BUILD_DIR/libdeps
PREFIX_DIR=$LIB_DIR/build/
FAST_MAKE=''


parse_arguments(){
Expand All @@ -23,6 +24,9 @@ parse_arguments(){
"--cleanup")
CLEANUP=true
;;
"--fast")
FAST_MAKE='-j4'
;;
esac
shift
done
Expand Down Expand Up @@ -99,7 +103,7 @@ install_openssl(){
download_openssl $OPENSSL_VERSION
cd openssl-$OPENSSL_VERSION
./config --prefix=$PREFIX_DIR --openssldir=$PREFIX_DIR -fPIC
make -s V=0
make $FAST_MAKE -s V=0
make install_sw
else
echo "openssl already installed"
Expand All @@ -120,7 +124,7 @@ install_libnice(){
cd libnice-0.1.4
patch -R ./agent/conncheck.c < $PATHNAME/libnice-014.patch0
./configure --prefix=$PREFIX_DIR
make -s V=0
make $FAST_MAKE -s V=0
make install
else
echo "libnice already installed"
Expand All @@ -140,7 +144,7 @@ install_opus(){
tar -zxvf opus-1.1.tar.gz
cd opus-1.1
./configure --prefix=$PREFIX_DIR
make -s V=0
make $FAST_MAKE -s V=0
make install
else
echo "opus already installed"
Expand All @@ -158,7 +162,7 @@ install_mediadeps(){
tar -zxvf v11.1.tar.gz
cd libav-11.1
PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig ./configure --prefix=$PREFIX_DIR --enable-shared --enable-gpl --enable-libvpx --enable-libx264 --enable-libopus
make -s V=0
make $FAST_MAKE -s V=0
make install
else
echo "libav already installed"
Expand All @@ -181,7 +185,7 @@ install_mediadeps_nogpl(){
tar -zxvf v11.1.tar.gz
cd libav-11.1
PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig ./configure --prefix=$PREFIX_DIR --enable-shared --enable-gpl --enable-libvpx --enable-libopus
make -s V=0
make $FAST_MAKE -s V=0
make install
else
echo "libav already installed"
Expand All @@ -200,7 +204,7 @@ install_libsrtp(){
tar -zxvf libsrtp-2.1.0.tar.gz
cd libsrtp-2.1.0
CFLAGS="-fPIC" ./configure --enable-openssl --prefix=$PREFIX_DIR --with-openssl-dir=$PREFIX_DIR
make -s V=0 && make uninstall && make install
make $FAST_MAKE -s V=0 && make uninstall && make install
cd $CURRENT_DIR
else
mkdir -p $LIB_DIR
Expand Down

0 comments on commit f56f7fd

Please sign in to comment.