Skip to content

Commit

Permalink
add CI build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
kulmesa authored and Jari Nippula committed Dec 3, 2021
1 parent 2057556 commit dde075f
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# fog-sw BUILDER
FROM ros:foxy-ros-base as fog-sw-builder

# Install build dependencies
RUN apt-get update -y && apt-get install -y --no-install-recommends \
curl \
build-essential \
dh-make debhelper \
cmake \
git-core \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /build

COPY . .

RUN /bin/bash -c "source /opt/ros/foxy/setup.bash && \
apt-get update && \
rosdep update && \
rosdep install --from-paths . --ignore-src -r -y && \
colcon build && \
mkdir /packages && cd install && \
find . -name '*.so' -exec cp --parents \{\} /packages \;"

FROM scratch
COPY --from=fog-sw-builder /packages/ /packages/
26 changes: 26 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

set -euxo pipefail

THISDIR="$(dirname "$(readlink -f "$0")")"

output_dir=$1
output="${output_dir}/gazebo_ros_pkgs"
mkdir -p "${output}"

pushd "${THISDIR}"
git_version=$(git log --date=format:%Y%m%d --pretty=~git%cd.%h -n 1)

iname=gazebo-ros-pkgs
docker build -t "${iname}" -f ./Dockerfile .
container_id=$(docker create "${iname}" "")
docker cp "${container_id}":/packages .
docker rm "${container_id}"
cp -r packages/* "${output}"
rm -Rf packages

pushd "${output_dir}"
tar -zcvf "gazebo_ros_pkgs-0.1.0${git_version}.tar.gz" ./gazebo_ros_pkgs
rm -rf ./gazebo_ros_pkgs
popd
popd

0 comments on commit dde075f

Please sign in to comment.