]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
script/ceph-backport.sh: Allow to set component label 29318/head
authorTiago Melo <tmelo@suse.com>
Thu, 25 Jul 2019 12:38:25 +0000 (12:38 +0000)
committerTiago Melo <tmelo@suse.com>
Thu, 25 Jul 2019 16:33:53 +0000 (16:33 +0000)
ceph-backport.sh will now read the 'component' from a environment variable.

Signed-off-by: Tiago Melo <tmelo@suse.com>
src/script/ceph-backport.sh

index 3d01c0c425d8f8b5a39968b401fe4722d980fcbc..6acd8bb64891716e1793c92861baab1e8fe64ff2 100755 (executable)
 # git cherry-pick -x ...
 # ceph-backport.sh 19206 jewel
 #
+# optionally, you can set the component label that will be added to the PR with
+# an environment variable:
+#
+# COMPONENT=dashboard ceph-backport.sh 19206 jewel
+#
 # See http://tracker.ceph.com/projects/ceph-releases/wiki/HOWTO_backport_commits
 # for more info on cherry-picking.
 #
@@ -184,7 +189,7 @@ git push -u $github_repo wip-$issue-$milestone
 number=$(curl --silent --data-binary '{"title":"'"$title"'","head":"'$github_user':wip-'$issue-$milestone'","base":"'$target_branch'","body":"http://tracker.ceph.com/issues/'$issue'"}' 'https://api.github.com/repos/ceph/ceph/pulls?access_token='$github_token | jq .number)
 echo "Opened pull request $number"
 
-component=core ; curl --silent --data-binary '{"milestone":'$milestone_number',"assignee":"'$github_user'","labels":["bug fix","'$component'"]}' 'https://api.github.com/repos/ceph/ceph/issues/'$number'?access_token='$github_token
+component=${COMPONENT:-core}; curl --silent --data-binary '{"milestone":'$milestone_number',"assignee":"'$github_user'","labels":["bug fix","'$component'"]}' 'https://api.github.com/repos/ceph/ceph/issues/'$number'?access_token='$github_token
 firefox https://github.com/ceph/ceph/pull/$number
 redmine_status=2 # In Progress
 curl --verbose -X PUT --header 'Content-type: application/json' --data-binary '{"issue":{"description":"https://github.com/ceph/ceph/pull/'$number'","status_id":'$redmine_status',"assigned_to_id":'$redmine_user_id'}}' 'http://tracker.ceph.com/issues/'$issue.json?key=$redmine_key