-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
executable file
·58 lines (44 loc) · 1.4 KB
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh -l
set -x
set -e
BAZEL_ARGS=$1
IGN_BAZEL_BRANCH=$2
echo ::group::Install tools: apt
apt update 2>&1
apt -y install \
build-essential \
cmake \
cppcheck \
curl \
g++-8 \
git \
gnupg \
lsb-release \
python3-pip \
wget
SYSTEM_VERSION=`lsb_release -cs`
SOURCE_DEPENDENCIES="`pwd`/.github/ci/dependencies.yaml"
SOURCE_DEPENDENCIES_VERSIONED="`pwd`/.github/ci-$SYSTEM_VERSION/dependencies.yaml"
apt-get update 2>&1
echo ::endgroup::
echo ::group::Install tools: pip
pip3 install -U pip vcstool colcon-common-extensions
echo ::endgroup::
echo ::group::Install tools: bazel
curl https://bazel.build/bazel-release.pub.gpg | apt-key add -
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" > /etc/apt/sources.list.d/bazel.list
apt update && apt install bazel
echo ::endgroup::
mkdir ~/ignition/
cd ~/ignition/
wget https://raw.githubusercontent.com/ignitionrobotics/ign-bazel/${IGN_BAZEL_BRANCH}/example/bazel.repos
vcs import . < bazel.repos
echo ::group::Install dependencies from binaries
apt -y install \
$(sort -u $(find . -iname 'packages-'$SYSTEM_VERSION'.apt' -o -iname 'packages.apt') | tr '\n' ' ')
echo ::endgroup::
ln -sf ./ign_bazel/example/WORKSPACE.example ~/ignition/WORKSPACE
ln -sf ./ign_bazel/example/BUILD.example ~/ignition/BUILD.bazel
ln -sf ./ign_bazel/example/bazelrc.example ~/ignition/.bazelrc
bazel build $BAZEL_ARGS
bazel test $BAZEL_ARGS