| 
									
										
										
										
											2011-11-18 15:45:59 +01:00
										 |  |  | #!/bin/sh | 
					
						
							|  |  |  | # Nico Schottelius | 
					
						
							| 
									
										
										
										
											2011-04-19 22:40:51 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-26 08:31:54 +02:00
										 |  |  | # Ensure documentation builds cleanly | 
					
						
							|  |  |  | echo "Verifying documentation building works ..." | 
					
						
							|  |  |  | ## ./build clean && ./build man || exit 1 | 
					
						
							| 
									
										
										
										
											2011-04-19 22:34:47 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-26 08:31:54 +02:00
										 |  |  | # get version from changelog and ensure it's not already present | 
					
						
							|  |  |  | changelog_version=$(grep '^[[:digit:]]' docs/changelog | head -n1 | sed 's/:.*//') | 
					
						
							| 
									
										
										
										
											2011-04-19 22:34:13 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-26 08:31:54 +02:00
										 |  |  | if git show --quiet $changelog_version >/dev/null 2>&1; then | 
					
						
							|  |  |  |     echo "Version $changelog_version already exists, aborting." | 
					
						
							|  |  |  |     exit 1 | 
					
						
							|  |  |  | fi | 
					
						
							| 
									
										
										
										
											2011-11-18 15:45:59 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-26 08:31:54 +02:00
										 |  |  | echo "Target version from changelog: $changelog_version" | 
					
						
							| 
									
										
										
										
											2011-11-18 15:58:26 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-26 08:31:54 +02:00
										 |  |  | # verify date in changelog | 
					
						
							| 
									
										
										
										
											2012-02-13 14:48:22 +01:00
										 |  |  | date_today="$(date +%Y-%m-%d)" | 
					
						
							| 
									
										
										
										
											2012-10-26 08:31:54 +02:00
										 |  |  | date_changelog=$(grep '^[[:digit:]]' docs/changelog | head -n1 | sed 's/.*: //') | 
					
						
							| 
									
										
										
										
											2011-11-18 15:45:59 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-13 14:48:22 +01:00
										 |  |  | if [ "$date_today" != "$date_changelog" ]; then | 
					
						
							| 
									
										
										
										
											2012-10-26 08:31:54 +02:00
										 |  |  |     echo "Date in changelog is not today" | 
					
						
							| 
									
										
										
										
											2012-02-13 14:48:22 +01:00
										 |  |  |     echo "Changelog: $date_changelog" | 
					
						
							|  |  |  |     exit 1 | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-18 15:59:36 +01:00
										 |  |  | echo "Press enter to continue" | 
					
						
							|  |  |  | read wait | 
					
						
							| 
									
										
										
										
											2012-10-26 08:31:54 +02:00
										 |  |  | version=$changelog_version | 
					
						
							| 
									
										
										
										
											2011-04-19 22:40:51 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | # get target branch | 
					
						
							| 
									
										
										
										
											2012-10-26 12:17:43 +02:00
										 |  |  | target_branch=${version%\.*} | 
					
						
							|  |  |  | current_branch=$(git rev-parse --abbrev-ref HEAD) | 
					
						
							| 
									
										
										
										
											2011-04-19 22:34:13 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-26 12:17:43 +02:00
										 |  |  | echo "Selected branch $target_branch for merging $current_branch" | 
					
						
							| 
									
										
										
										
											2012-10-26 08:31:54 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-19 22:43:49 +02:00
										 |  |  | # add tag | 
					
						
							| 
									
										
										
										
											2011-11-18 16:04:19 +01:00
										 |  |  | printf "Enter tag description for %s> " "$version" | 
					
						
							| 
									
										
										
										
											2011-04-19 22:43:49 +02:00
										 |  |  | read tagmessage | 
					
						
							| 
									
										
										
										
											2011-05-10 15:51:08 +02:00
										 |  |  | git tag "$version" -m "$tagmessage" | 
					
						
							| 
									
										
										
										
											2011-04-19 22:43:49 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-19 22:34:13 +02:00
										 |  |  | # Import into current version branch | 
					
						
							| 
									
										
										
										
											2012-10-26 12:17:43 +02:00
										 |  |  | printf "Press enter to git merge into branch \"$target_branch\" > " | 
					
						
							| 
									
										
										
										
											2012-01-18 08:34:15 +01:00
										 |  |  | read prompt | 
					
						
							| 
									
										
										
										
											2012-10-26 12:17:43 +02:00
										 |  |  | git checkout "$target_branch" | 
					
						
							|  |  |  | git merge "$current_branch" | 
					
						
							|  |  |  | git checkout "$current_branch" | 
					
						
							| 
									
										
										
										
											2011-04-19 22:34:13 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-19 22:40:51 +02:00
										 |  |  | # Publish manpages and sourcecode | 
					
						
							| 
									
										
										
										
											2012-10-26 12:17:43 +02:00
										 |  |  | printf "Press enter to publish doc/ code/ pypi for $version > " | 
					
						
							| 
									
										
										
										
											2012-01-18 08:34:15 +01:00
										 |  |  | read prompt | 
					
						
							| 
									
										
										
										
											2011-11-18 15:45:59 +01:00
										 |  |  | ./build web | 
					
						
							|  |  |  | ./build pub | 
					
						
							| 
									
										
										
										
											2012-01-18 08:34:15 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | cat << notes | 
					
						
							|  |  |  | To be done manually... | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     - freecode release | 
					
						
							|  |  |  |     - blog entry | 
					
						
							| 
									
										
										
										
											2012-01-18 08:36:26 +01:00
										 |  |  |     - linkedin entry | 
					
						
							| 
									
										
										
										
											2012-01-18 08:34:15 +01:00
										 |  |  |     - mailinglist update | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | notes |