relese.sh 1.35 KB
Newer Older
Tomasz Kucner's avatar
Tomasz Kucner committed
1 2 3 4 5 6
#!/bin/bash

release_messages() {
    for i in *msgs; do
	create_debian_package "$i"
    done
7
    dpkg -i ros-*msgs*_amd64.deb #> /dev/null
Tomasz Kucner's avatar
Tomasz Kucner committed
8 9 10 11 12 13
}

release_dependency_packages() {
    for i in v4r_object_tracker v4r_object_classification v4r_segmentation v4r_object_recognition; do
	create_debian_package "$i"
    done
14
    dpkg -i ros-*_amd64.deb #> /dev/null
Tomasz Kucner's avatar
Tomasz Kucner committed
15 16 17 18 19 20 21
    move_debian_packages
}

release_ros_wrappers() {
    for i in `ls -d */|grep -v 'rosdep\|images\|msgs\|v4r_ros_wrappers'`; do
	create_debian_package "$i"
    done
22
    dpkg -i ros-*_amd64.deb #> /dev/null
Tomasz Kucner's avatar
Tomasz Kucner committed
23 24 25 26 27
    move_debian_packages
}

release_meta_package() {
    create_debian_package "v4r_ros_wrappers"
28
    dpkg -i ros-*v4r*wrappers*_amd64.deb #> /dev/null
Tomasz Kucner's avatar
Tomasz Kucner committed
29 30 31 32 33 34 35 36 37 38 39
    move_debian_packages
}

create_debian_package() {
    cd $1
    if [ -f .done ]; then
	echo "Package $1 was already build. Skipping..."
    else
	echo "generating debian package for $1"
	bloom-generate rosdebian --os-name ubuntu --os-version $UBUNTU_DISTRO --ros-distro $CI_ROS_DISTRO &&\
	    sed -i 's/dh  $@/dh  $@ --parallel/' debian/rules
40
	debuild -rfakeroot -us -uc -b -j8 #> /dev/null
Tomasz Kucner's avatar
Tomasz Kucner committed
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
	touch .done
    fi
    cd ..
}

move_debian_packages() {
    mv *deb .build/
}

release_package() {
    release_messages
    release_dependency_packages
    release_ros_wrappers
    release_meta_package
}

show_info() {
    echo $UBUNTU_DISTRO
    echo $CI_ROS_DISTRO
}