From 26bbe7e7c5cf3355e539c634ad44419df5d36038 Mon Sep 17 00:00:00 2001 From: Jongwhan Lee Date: Fri, 11 Oct 2019 22:26:33 +0800 Subject: [PATCH 1/5] Problem:(CRO-483) There is no dedicated ci builder Solution: add drone.io config add prepare.sh --- .drone.yml | 24 ++++++++++++++++++++++++ install_kcov.sh | 15 +++++++++++++++ install_zeromq.sh | 20 ++++++++++++++++++++ prepare.sh | 23 +++++++++++++++++++++++ 4 files changed, 82 insertions(+) create mode 100644 .drone.yml create mode 100755 install_kcov.sh create mode 100755 install_zeromq.sh create mode 100755 prepare.sh diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 000000000..55fb12a0a --- /dev/null +++ b/.drone.yml @@ -0,0 +1,24 @@ +kind: pipeline +name: default + +steps: +- name: test + image: ubuntu:trusty + commands: + - ./prepare.sh + - export PATH=/root/.cargo/bin:$PATH + - export RUST_BACKTRACE=1 + - export RUSTFLAGS=-Ctarget-feature=+aes,+ssse3 + - export PATH=$HOME/.local/bin:$PATH + - export LD_LIBRARY_PATH=$HOME/lib + - export LIBRARY_PATH=$HOME/lib + - export PATH=$HOME/.cargo/bin:$PATH + - export PKG_CONFIG_PATH=$HOME/lib/pkgconfig + - echo $HOME + - pwd + - ./install_zeromq.sh + - ./install_kcov.sh + - cargo build + - cargo test + + diff --git a/install_kcov.sh b/install_kcov.sh new file mode 100755 index 000000000..967f6cc8e --- /dev/null +++ b/install_kcov.sh @@ -0,0 +1,15 @@ +#!/bin/bash +FILE=/usr/local/bin/kcov +if [ ! -f "$FILE" ]; then + echo "$FILE does not exist" + wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz + tar xzf master.tar.gz + cd kcov-master + mkdir build + cd build + cmake .. + make + sudo make install + cd ../.. + rm -rf kcov-master +fi diff --git a/install_zeromq.sh b/install_zeromq.sh new file mode 100755 index 000000000..9e9b3640c --- /dev/null +++ b/install_zeromq.sh @@ -0,0 +1,20 @@ +#!/bin/bash +FILE=/home/travis/lib/libzmq.so +if [ ! -f "$FILE" ]; then + echo "$FILE does not exist" + wget https://github.com/jedisct1/libsodium/releases/download/1.0.16/libsodium-1.0.16.tar.gz + tar xvfz libsodium-1.0.16.tar.gz + cd libsodium-1.0.16 + ./configure --prefix=$HOME + make + make install + cd .. + + wget https://github.com/zeromq/libzmq/releases/download/v4.2.5/zeromq-4.2.5.tar.gz + tar xvfz zeromq-4.2.5.tar.gz + cd zeromq-4.2.5 + ./configure --prefix=$HOME --with-libsodium + make + make install + cd .. +fi diff --git a/prepare.sh b/prepare.sh new file mode 100755 index 000000000..0993e062e --- /dev/null +++ b/prepare.sh @@ -0,0 +1,23 @@ +#!/bin/bash +cat /etc/issue +sed -i 's/archive.ubuntu.com/ftp.daum.net/g' /etc/apt/sources.list +rm -rf /var/lib/apt/lists/* +apt update +apt install wget curl -y +apt install python3 libssl-dev libcurl4-openssl-dev libelf-dev libdw-dev gcc binutils-dev libc6-dev -y +apt install pkg-config -y + +apt install build-essential -y + +wget http://www.cmake.org/files/v3.2/cmake-3.2.2.tar.gz +tar xf cmake-3.2.2.tar.gz +cd cmake-3.2.2 +./configure +make +make install +cd .. + + +curl https://sh.rustup.rs -sSf | sh -s -- -y +cmake --version +echo "prepare OK" From c1c03c62299f135f6e10d06f78e2549d78f81fcd Mon Sep 17 00:00:00 2001 From: Jongwhan Lee Date: Tue, 15 Oct 2019 14:11:02 +0800 Subject: [PATCH 2/5] use local docker image use prebuilt docker image tidy up make path simple display $HOME tidy up --- .drone.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.drone.yml b/.drone.yml index 55fb12a0a..c678ddff0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,22 +3,15 @@ name: default steps: - name: test - image: ubuntu:trusty + image: chain + pull: never commands: - - ./prepare.sh - - export PATH=/root/.cargo/bin:$PATH - export RUST_BACKTRACE=1 - export RUSTFLAGS=-Ctarget-feature=+aes,+ssse3 - - export PATH=$HOME/.local/bin:$PATH - export LD_LIBRARY_PATH=$HOME/lib - export LIBRARY_PATH=$HOME/lib - - export PATH=$HOME/.cargo/bin:$PATH + - export PATH=$HOME/.cargo/bin:$HOME/.local/bin:$PATH - export PKG_CONFIG_PATH=$HOME/lib/pkgconfig - - echo $HOME - - pwd - - ./install_zeromq.sh - - ./install_kcov.sh - cargo build - cargo test - - + - echo "HOME FOLDER= " $HOME From d8c67247c1d677681907c12f1b8fa9faf42cb57c Mon Sep 17 00:00:00 2001 From: Jongwhan Lee Date: Wed, 16 Oct 2019 16:06:07 +0800 Subject: [PATCH 3/5] compile --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index c678ddff0..b207bcba4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,4 +14,4 @@ steps: - export PKG_CONFIG_PATH=$HOME/lib/pkgconfig - cargo build - cargo test - - echo "HOME FOLDER= " $HOME + - echo "HOME FOLDER2= " $HOME From 72ec5691e18a0bc88b052071590ecf492dc68d35 Mon Sep 17 00:00:00 2001 From: Jongwhan Lee Date: Wed, 16 Oct 2019 16:26:28 +0800 Subject: [PATCH 4/5] compile2 --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index b207bcba4..c678ddff0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,4 +14,4 @@ steps: - export PKG_CONFIG_PATH=$HOME/lib/pkgconfig - cargo build - cargo test - - echo "HOME FOLDER2= " $HOME + - echo "HOME FOLDER= " $HOME From 58d6640b20c60208629413ecee857a8b4432e249 Mon Sep 17 00:00:00 2001 From: Jongwhan Lee Date: Wed, 16 Oct 2019 17:43:51 +0800 Subject: [PATCH 5/5] test --- test.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 test.txt diff --git a/test.txt b/test.txt new file mode 100644 index 000000000..4c479deff --- /dev/null +++ b/test.txt @@ -0,0 +1 @@ +apple