Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Commit

Permalink
Merge pull request #63 from tiiuae/new_fog_sw_full_deb
Browse files Browse the repository at this point in the history
New fog-sw-full debian meta package. This is release 3.1.
  • Loading branch information
maseabunikie authored Jun 4, 2021
2 parents bb630db + 3fb5cfd commit 5be215c
Show file tree
Hide file tree
Showing 8 changed files with 182 additions and 53 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: main

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'ver_ssrc_rel_*' # Push events to matching ver_ssrc_rel_*

jobs:
tii-deb:
runs-on: ubuntu-latest
steps:

- name: Checkout fog_sw
uses: actions/checkout@v2
with:
path: fog_sw

- name: Checkout ci-scripts
uses: actions/checkout@v2
with:
repository: tiiuae/fogsw-ci-scripts
path: fogsw-ci-scripts

# Run docker build
- name: Run fog-sw docker build
run: |
set -eux
mkdir bin
pushd fogsw-ci-scripts
./generate_deb.sh ../fog_sw ../bin/
popd
- name: Install jfrog CLI tool
env:
JFROG_CLI_URL: https://artifactory.ssrc.fi/artifactory/gen-public-local/tools/jfrog/jfrog-1.45.2.tar.gz
if: github.event_name == 'push'
run: |
set -exu
mkdir -p "$GITHUB_WORKSPACE/.jfrog/bin"
curl -L "$JFROG_CLI_URL" -o "$GITHUB_WORKSPACE/.jfrog/jfrog.tar.gz"
tar -C "$GITHUB_WORKSPACE/.jfrog/bin" -zxf "$GITHUB_WORKSPACE/.jfrog/jfrog.tar.gz"
echo "$GITHUB_WORKSPACE/.jfrog/bin" >> "$GITHUB_PATH"
echo "JFROG_CLI_HOME_DIR=$GITHUB_WORKSPACE/.jfrog" >> "$GITHUB_ENV"
- name: Upload to Artifactory
env:
ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }}
ARTIFACTORY_REPO: debian-release-local
DISTRIBUTION: focal
COMPONENT: fog-sw
ARCHITECTURE: amd64
BUILD_NAME: fog-sw-full
CI: true
if: github.event_name == 'push'
run: |
set -exu
jfrog rt c import "$ARTIFACTORY_TOKEN"
jfrog rt ping
pkg=$(find bin -name 'fog-sw-full*.deb')
jfrog rt u --deb "$DISTRIBUTION/$COMPONENT/$ARCHITECTURE" \
--target-props COMMIT="$GITHUB_SHA" \
--build-name "$BUILD_NAME" \
--build-number "$GITHUB_SHA" \
"$pkg" \
"$ARTIFACTORY_REPO"
jfrog rt build-publish "$BUILD_NAME" "$GITHUB_SHA"
jfrog rt bpr "$BUILD_NAME" "$GITHUB_SHA" "$ARTIFACTORY_REPO" \
--status "${GITHUB_REF#refs/tags/}" \
--comment "fog-sw-full release build"
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ build/
venv/
ros2_ws/KeyFrameTrajectory.txt
ros2_ws/src/ros-foxy-*
*debian/
*obj-x86_64*/

# avoid adding binary to repo
packaging/agent_protocol_splitter/protocol_splitter
packaging/agent_protocol_splitter/protocol_splitter
9 changes: 9 additions & 0 deletions packaging/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

build_dir=$1
dest_dir=$2

# Copy debian files from mod_specific directory
cp ${build_dir}/packaging/debian/* ${dest_dir}/DEBIAN/

exit 0
20 changes: 20 additions & 0 deletions packaging/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Package: fog-sw-full
Version: VERSION
Maintainer: manuel.segarra-abad <[email protected]>
Architecture: amd64
Description: FOG SW meta package.
Depends: agent-protocol-splitter (= 1.0.0-13~git20210419.ed16b42),
communication-link (= 2.0.0-29~git20210526.843fd45),
fast-dds-gen (= 1.0.0-3~git20210421.694704f),
fogsw-configs (= 1.0.0-4~git20210526.5b156bf),
fog-sw-systemd-services (= 1.0.0-21~git20210601.675cb6f),
libsurvive (= 1.0.0-3~git20210421.b966a6c),
mavlink-router (= 1.0.0-6~git20210419.14c1368),
mavsdk (= 0.34.0),
mission-engine (= 2.0.0-10~git20210526.b4285bc),
ros-foxy-depthai-ctrl (= 0.5.3-28~git20210601.80de68d),
ros-foxy-indoor-pos (= 1.0.0-12~git20210426.81d1987),
ros-foxy-mesh-com (= 0.3.3-29~git20210601.8ecb707),
ros-foxy-px4-mavlink-ctrl (= 0.1.0-11~git20210426.5836a83),
ros-foxy-px4-msgs (= 2.0.1-5~git20210419.b4c4a12),
ros-foxy-px4-ros-com (= 0.1.0-15~git20210602.4acff59)
3 changes: 3 additions & 0 deletions packaging/debian/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

exit 0
3 changes: 3 additions & 0 deletions packaging/debian/prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

exit 0
74 changes: 23 additions & 51 deletions packaging/package.sh
Original file line number Diff line number Diff line change
@@ -1,53 +1,25 @@
#!/bin/bash

pushd agent_protocol_splitter
./package.sh
popd

pushd systemd
./package.sh
popd

pushd mavlink-router
./package.sh
popd

pushd ../ros2_ws/src/px4_mavlink_ctrl
bloom-generate rosdebian --os-name ubuntu --os-version focal --ros-distro foxy && sed -i 's/^\tdh_shlibdeps.*/& --dpkg-shlibdeps-params=--ignore-missing-info/g' debian/rules && fakeroot debian/rules binary && mv ../*.deb ../../../packaging/
popd

pushd ../ros2_ws/src/mesh_com/modules/mesh_com
bloom-generate rosdebian --os-name ubuntu --os-version focal --ros-distro foxy && fakeroot debian/rules binary && mv ../*.deb ../../../../../packaging/
popd

pushd ../ros2_ws/src/px4_msgs
bloom-generate rosdebian --os-name ubuntu --os-version focal --ros-distro foxy && fakeroot debian/rules binary && mv ../*.deb ../../../packaging/
# The following px4_ros_com needs px4_msgs, which was just compiled, so add it to the CMAKE paths
export CMAKE_PREFIX_PATH=${PWD}/debian/ros-foxy-px4-msgs/opt/ros/foxy
popd

pushd ../ros2_ws/src/px4_ros_com
bloom-generate rosdebian --os-name ubuntu --os-version focal --ros-distro foxy && fakeroot debian/rules binary && mv ../*.deb ../../../packaging/
popd

pushd ../ros2_ws/src/indoor_pos
bloom-generate rosdebian --os-name ubuntu --os-version focal --ros-distro foxy && fakeroot debian/rules binary && mv ../*.deb ../../../packaging/
popd

pushd communication_link
./package.sh
popd

pushd ../ros2_ws/src/depthai_ctrl
bloom-generate rosdebian --os-name ubuntu --os-version focal --ros-distro foxy && \
sed -i 's/^\tdh_shlibdeps.*/& --dpkg-shlibdeps-params=--ignore-missing-info/g' debian/rules && \
fakeroot debian/rules binary && \
mv ../*.deb ../../../packaging/
popd

pushd ../fogsw_secure_os
./package.sh
popd
mv ../fogsw-secure-os*.deb .

exit 0
get_version() {
version=3.1~$(git log --date=format:%Y%m%d --pretty=git%cd.%h -n 1)
echo ${version}
}

make_deb() {
echo "Creating deb package..."
build_dir=$(mktemp -d)
mkdir ${build_dir}/DEBIAN

cp packaging/debian/* ${build_dir}/DEBIAN/

get_version
sed -i "s/VERSION/${version}/" ${build_dir}/DEBIAN/control
cat ${build_dir}/DEBIAN/control
echo fog-sw-full_${version}_amd64.deb
fakeroot dpkg-deb --build ${build_dir} ../fog-sw-full_${version}_amd64.deb
rm -rf ${build_dir}
echo "Done"
}

version=$(get_version)
make_deb
53 changes: 53 additions & 0 deletions packaging/package_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

pushd agent_protocol_splitter
./package.sh
popd

pushd systemd
./package.sh
popd

pushd mavlink-router
./package.sh
popd

pushd ../ros2_ws/src/px4_mavlink_ctrl
bloom-generate rosdebian --os-name ubuntu --os-version focal --ros-distro foxy && sed -i 's/^\tdh_shlibdeps.*/& --dpkg-shlibdeps-params=--ignore-missing-info/g' debian/rules && fakeroot debian/rules binary && mv ../*.deb ../../../packaging/
popd

pushd ../ros2_ws/src/mesh_com/modules/mesh_com
bloom-generate rosdebian --os-name ubuntu --os-version focal --ros-distro foxy && fakeroot debian/rules binary && mv ../*.deb ../../../../../packaging/
popd

pushd ../ros2_ws/src/px4_msgs
bloom-generate rosdebian --os-name ubuntu --os-version focal --ros-distro foxy && fakeroot debian/rules binary && mv ../*.deb ../../../packaging/
# The following px4_ros_com needs px4_msgs, which was just compiled, so add it to the CMAKE paths
export CMAKE_PREFIX_PATH=${PWD}/debian/ros-foxy-px4-msgs/opt/ros/foxy
popd

pushd ../ros2_ws/src/px4_ros_com
bloom-generate rosdebian --os-name ubuntu --os-version focal --ros-distro foxy && fakeroot debian/rules binary && mv ../*.deb ../../../packaging/
popd

pushd ../ros2_ws/src/indoor_pos
bloom-generate rosdebian --os-name ubuntu --os-version focal --ros-distro foxy && fakeroot debian/rules binary && mv ../*.deb ../../../packaging/
popd

pushd communication_link
./package.sh
popd

pushd ../ros2_ws/src/depthai_ctrl
bloom-generate rosdebian --os-name ubuntu --os-version focal --ros-distro foxy && \
sed -i 's/^\tdh_shlibdeps.*/& --dpkg-shlibdeps-params=--ignore-missing-info/g' debian/rules && \
fakeroot debian/rules binary && \
mv ../*.deb ../../../packaging/
popd

pushd ../fogsw_secure_os
./package.sh
popd
mv ../fogsw-secure-os*.deb .

exit 0

0 comments on commit 5be215c

Please sign in to comment.