Skip to content

Commit

Permalink
Enable continuous integration with Travis CI (#175)
Browse files Browse the repository at this point in the history
* Add travis ci script and build.sh

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Switched to dune 1.11.4

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Fixed typo in travis script

* Updated sdk-ocaml git submodule dependency

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Updated api-ocaml git submodule

* Added other opam deps in travis and removed bubblewrap

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Enable opam env after install in ci script

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Fixed opam env eval in ci script

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Load opam in bashrc in ci script

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Reload opam environment when building

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Temporary reinstall dune in ci script

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Trying to fix building with opamenv in ci

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Removed useless line in ci script

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Removed useless line and improved build line

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Moved installing other opam dependencies in build.sh

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Updated BUILD.md documentation

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Typo in BUILD.md documentation

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>
  • Loading branch information
gabrielepmattia committed Feb 6, 2020
1 parent eacf26b commit b09c130
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 61 deletions.
21 changes: 19 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
language: c
os: linux
language: cpp
services:
- docker
before_install:
- docker pull debian:10-slim
- docker run -it -d --name build debian:10-slim bash
- docker exec build apt update
# install deps
- docker exec build apt install git wget jq libev-dev libssl-dev python3 python3-dev python3-pip m4 pkg-config rsync unzip cmake -y
- docker exec build pip3 install pyangbind
# install opam
- docker exec build wget -O opam https://github.com/ocaml/opam/releases/download/2.0.6/opam-2.0.6-x86_64-linux
- docker exec build install ./opam /usr/local/bin/opam
- docker exec build opam init --disable-sandboxing
# clone repo at specific ref
- docker exec build git clone https://github.com/$TRAVIS_REPO_SLUG fog05
- docker exec build bash -c "cd fog05 && git checkout $TRAVIS_BRANCH"
script:
- echo "Nothing to do"
- docker exec build bash -c "eval \$(opam env) && cd fog05 && ./build.sh"
62 changes: 5 additions & 57 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@ $ opam switch
```

Then you need to install some required libraries from opam

```
opam install atdgen ocp-ocamlres conf-libev
```

And other requirements not present in opam:
Then you need to install some required libraries from opam and others that need to be built locally:

- apero-core (https://github.com/atolab/apero-core)
- apero-net (https://github.com/atolab/apero-net)
Expand All @@ -45,56 +39,10 @@ And other requirements not present in opam:
- yaks-common (https://github.com/atolab/zenoh)
- yaks-ocaml (https://github.com/atolab/yaks-ocaml)

To install these you can execute the following commands:

```bash
mkdir fos_build
cd fos_build
git clone https://github.com/atolab/apero-core
cd apero-core
git checkout 0.4.6
opam install . --working-dir -y
cd ..
git clone https://github.com/atolab/apero-net
cd apero-net
git checkout 0.4.6
opam install . --working-dir -y
cd ..
git clone https://github.com/atolab/apero-time
cd apero-time
git checkout 0.4.6
opam install . --working-dir -y
cd ..
git clone https://github.com/atolab/zenoh
cd zenoh
git checkout 0.3.0
opam install . --working-dir -y
cd ..
git clone https://github.com/atolab/yaks-common
cd yaks-common
git checkout 0.3.0
opam install . --working-dir -y
cd ..
git clone https://github.com/atolab/yaks-ocaml
cd yaks-ocaml
git checkout 0.3.0
opam install . --working-dir -y
cd ..
git clone http://github.com/atolab/zenoh-c
cd zenoh-c
git checkout 0.3.0
make
sudo make install
cd ..
git clone http://github.com/atolab/zenoh-python
cd zenoh-python
git checkout 0.3.0
sudo python3 setup.py install
cd ..
git clone http://github.com/atolab/yaks-python
cd yaks-python
git checkout 0.3.0
sudo make install
To install all of these you have to execute the [build.sh](build.sh) script:

```
$ ./build.sh
```

### Eclipse fog05 Agent
Expand Down
2 changes: 1 addition & 1 deletion api/api-ocaml
64 changes: 64 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/bash

VER_APERO="0.4.6"
VER_ZENOH="0.3.0"
VER_YAKS="0.3.0"

echo "[BUILD] Installing opam dependencies"
opam install dune.1.11.4 atdgen.2.0.0 conf-libev ocp-ocamlres -y

echo "[BUILD] Building and installing dependencies"
# install dependencies
mkdir fos_build
cd fos_build
git clone https://github.com/atolab/apero-core
cd apero-core
git checkout $VER_APERO
opam install . --working-dir -y
cd ..
git clone https://github.com/atolab/apero-net
cd apero-net
git checkout $VER_APERO
opam install . --working-dir -y
cd ..
git clone https://github.com/atolab/apero-time
cd apero-time
git checkout $VER_APERO
opam install . --working-dir -y
cd ..
git clone https://github.com/atolab/zenoh
cd zenoh
git checkout $VER_ZENOH
opam install . --working-dir -y
cd ..
git clone https://github.com/atolab/yaks-common
cd yaks-common
git checkout $VER_YAKS
opam install . --working-dir -y
cd ..
git clone https://github.com/atolab/yaks-ocaml
cd yaks-ocaml
git checkout $VER_YAKS
opam install . --working-dir -y
cd ..
git clone http://github.com/atolab/zenoh-c
cd zenoh-c
git checkout $VER_ZENOH
make
make install
cd ..
git clone http://github.com/atolab/zenoh-python
cd zenoh-python
git checkout $VER_ZENOH
python3 setup.py install
cd ..
git clone http://github.com/atolab/yaks-python
cd yaks-python
git checkout $VER_YAKS
make install

echo "[BUILD] Building Fog05"
# build fog05
cd ../..
git submodule update --init --recursive
make
2 changes: 1 addition & 1 deletion sdk/sdk-ocaml

0 comments on commit b09c130

Please sign in to comment.