Skip to content

Instantly share code, notes, and snippets.

@amoralej
Created October 6, 2016 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amoralej/6c01d3d4feb143c9892cd125c30da13f to your computer and use it in GitHub Desktop.
Save amoralej/6c01d3d4feb143c9892cd125c30da13f to your computer and use it in GitHub Desktop.
#!/bin/bash
# Send new releases to distgit from review in openstack/releases project
REVIEW=$1
BRANCH=$2
TOPIC=$2
rm -rf $REVIEW
git clone http://github.com/openstack/releases $REVIEW
cd $REVIEW
git review -s
git review -d $REVIEW
git diff HEAD~1 HEAD|grep ^+++|while read a
do
FILE=$(echo $a |awk '{print $2}'|sed 's/b\///')
echo "Change in $FILE detected"
VERSION=$(git diff --minimal HEAD~1 HEAD $FILE|grep '^+.*version'|awk '{print $4}')
git diff --minimal HEAD~1 HEAD $FILE|grep '^+.*repo'|awk '{print $4}'|while read repo
do
SHORT_REPO=$(echo $repo| awk -F/ '{print $2}')
PROJECT_NAME=$(python /home/amoralej/eng/RDO/utils/map-project-name $SHORT_REPO)
if [ -n "$PROJECT_NAME" ]; then
echo "Sending new version" $PROJECT_NAME $VERSION
rdopkg clone $PROJECT_NAME
cd $PROJECT_NAME
git checkout --track origin/$BRANCH
echo n|rdopkg new-version -b $VERSION
echo "git review -t $TOPIC"
#git review -t $TOPIC
cd ..
fi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment