Skip to content

Instantly share code, notes, and snippets.

@zhouchengming1
Forked from mikepurvis/bloom-local-deb
Last active March 3, 2018 07:45
Show Gist options
  • Save zhouchengming1/0ae16bff16dee94cf1c74cd63e173fc3 to your computer and use it in GitHub Desktop.
Save zhouchengming1/0ae16bff16dee94cf1c74cd63e173fc3 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Prerequisites:
# sudo apt-get install python-bloom git-buildpackage
#
# Installation:
# cd ~/bin
# wget https://gist.github.com/mikepurvis/7036293/raw/bloom-local-deb
# chmod +x bloom-local-deb
#
# Usage:
# - Prepare the repo (catkin_generate_changelog, catkin_prepare_release)
# - Invoke bloom-local-deb in the repo.
git rev-parse
if [[ "$?" != "0" ]]; then
echo "This directory is not a git repo!"
exit 1
fi
GIT_REMOTE_URL=$(git config --get remote.origin.url)
DEV_BRANCH=${DEV_BRANCH-kinetic-devel}
TEMPDIR=$(mktemp -d --tmpdir $(basename $(pwd)).XXXX)
mkdir $TEMPDIR/gbp
pushd $TEMPDIR/gbp
cat <<EOF > tracks.yaml
tracks:
${ROS_DISTRO}:
actions:
- bloom-export-upstream :{vcs_local_uri} :{vcs_type} --tag :{release_tag} --display-uri :{vcs_uri} --name :{name} --output-dir :{archive_dir_path}
- git-bloom-import-upstream :{archive_path} :{patches} --release-version :{version} --replace
- git-bloom-generate -y rosrelease :{ros_distro} --source upstream -i :{release_inc}
- git-bloom-generate -y rosdebian --prefix release/:{ros_distro} :{ros_distro} -i :{release_inc}
devel_branch: ${DEV_BRANCH}
last_version: null
name: upstream
patches: null
release_inc: '0'
release_repo_url: null
release_tag: :{version}
ros_distro: ${ROS_DISTRO}
vcs_type: git
vcs_uri: ${GIT_REMOTE_URL}
version: :{auto}
EOF
git init
git add tracks.yaml
git commit -m "Add tracks.yaml"
git-bloom-release ${ROS_DISTRO}
BRANCHES=$(git branch | grep "\sdebian/kinetic/$(lsb_release -cs)/")
for BRANCH in ${BRANCHES}
do
git checkout ${BRANCH}
git clean -df
git-buildpackage -uc -us --git-ignore-new
done
echo
echo "Generated:"
ls -1 $TEMPDIR/*.deb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment