2014-09-25 08:45:13 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2014-12-18 18:50:47 +00:00
|
|
|
# Copyright (c) 2014, Facebook, Inc.
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# This source code is licensed under the BSD-style license found in the
|
2015-04-19 02:51:00 +00:00
|
|
|
# LICENSE file in the root directory of this source tree. An additional grant
|
2014-12-18 18:50:47 +00:00
|
|
|
# of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
|
2014-09-25 08:45:13 +00:00
|
|
|
set -e
|
|
|
|
|
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
2014-10-03 17:23:17 +00:00
|
|
|
source $SCRIPT_DIR/lib.sh
|
2014-09-25 08:45:13 +00:00
|
|
|
|
|
|
|
threads THREADS
|
|
|
|
|
|
|
|
cd $SCRIPT_DIR/../
|
|
|
|
|
2014-11-20 00:23:25 +00:00
|
|
|
# Builds dependencies
|
2014-09-25 08:45:13 +00:00
|
|
|
make deps
|
2014-12-08 22:19:34 +00:00
|
|
|
make clean
|
2014-11-20 00:23:25 +00:00
|
|
|
|
2014-11-20 00:33:33 +00:00
|
|
|
# Build osquery
|
2014-09-25 08:45:13 +00:00
|
|
|
make -j$THREADS
|
2014-11-20 00:33:33 +00:00
|
|
|
|
2015-07-08 00:30:29 +00:00
|
|
|
# Build osquery kernel
|
|
|
|
make kernel-build
|
|
|
|
make kernel-load
|
|
|
|
|
2015-04-19 02:51:00 +00:00
|
|
|
# Run code unit and integration tests
|
2014-09-25 08:45:13 +00:00
|
|
|
make test
|
2015-07-08 00:30:29 +00:00
|
|
|
|
|
|
|
make kernel-test
|
|
|
|
|
|
|
|
# Cleanup kernel
|
|
|
|
make kernel-unload || sudo reboot
|
|
|
|
|