3 # a simple and quick method for making a new release, merging it into the master branch,
4 # and tagging it with a new tag for the release.
5 # currently needs to be told the new release name, which is actually also gotten from
6 # the "next_version" script. if these differ, there will be confusion for users about
7 # the right version number. for now, look at the config file in production to get
8 # the current version, add one to the revision number, and pass major.minor.revision to
11 source $FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh
14 # done + need to make the version a parameter passed to here, and complain if it's not provided.
15 # + better if we could get the version automatically, but there is a circular dependency where we want to check out the new branch by version number.
17 # these are the steps i take on feisty meow when i have a dev branch that is
18 # ready to merge in to the master branch as a new release. the process
19 # includes adding the tag for the new release and such. there are manual
20 # steps for adding the commit comments, including an introspection phase
21 # with gitk before the release commit comment is created.
22 function make_new_feisty_meow_release()
24 # snag the version number from the passed parameter.
25 local new_version="$1"; shift
26 local scriptname="$(basename $0 .sh)"
28 if [ -z "$new_version" ]; then
30 $scriptname: this script requires a version number to use for the
31 branch name and release tag name of the new release.
36 # jump into the top of the feisty meow codebase.
37 pushd $FEISTY_MEOW_APEX
38 # make up a release name based on the version number.
39 local new_release="release-${new_version}"
41 echo "About to create the release called '$new_release' as a branch"
42 echo "on the git repository -- please hit Enter."
45 # make sure we're working on the dev branch, since that's where our releases come from.
47 exit_on_error checking out the dev branch
49 # inflate all the git branches we might need, getting all their latest.
51 exit_on_error running rpuffer on the dev branch to update it
53 # make a new branch for the release based on the dev branch.
54 git checkout -b $new_release dev
55 exit_on_error checking out a new branch called $new_release
57 # bump feisty meow version.
58 bash ./scripts/generator/next_version.sh
59 exit_on_error bumping version for feisty meow codebase
61 # check in the changes in the new release branch, which now includes a revised version.
62 #echo about to commit--hit enter
65 exit_on_error committing all changes
67 # not sure if we really need to check in the release branch as a remote, but we like to see it in the list.
68 #echo about to push new release branch--hit enter
70 git push --set-upstream origin "$new_release"
72 # grab out the master branch as the active one.
73 #echo about to check out master--hit enter
76 exit_on_error checking out master branch
79 exit_on_error running rpuffer on master branch to update it
81 # merge the master branch with the new release.
82 #echo about to merge--hit enter
84 git merge --no-ff $new_release
85 exit_on_error merging in the new release in master
87 # let the committer see the most recent changes.
89 echo "=> launching gitk to show you the full set of changes;"
90 echo "=> please prepare an excellent commit comment."
92 exit_on_error launching gitk
94 # now make a tag for the new release, which is where we should go crazy with the detailed
95 # and useful comments for what has changed in this release, gathered from the gitk that
96 # we just launched. this should include all of the work on the development branch since
98 #echo about to TAG--hit enter
100 git tag -a $new_version
101 exit_on_error tagging new version as $new_version
103 # commit the full set of changes for the master branch now, including the tags.
104 #echo about to commit master branch with all those changes--hit enter
107 exit_on_error checking in the changes in master branch
109 # switch back to the dev branch.
110 #echo switching to dev branch--hit enter
113 exit_on_error checking the dev branch out again
115 # merge in the latest changes from master, which should only be the revised version really.
116 #echo merging in from release branch to dev--hit enter
118 git merge --no-ff $new_release
119 exit_on_error merging the release changes into the dev branch
120 #echo pushing merged dev branch up
122 # now update anything from our merged state in remote.
124 exit_on_error pushing merged dev branch up
126 # done with the serious actions.
127 echo -e "\ncompleted the release of version $new_version\n"
129 # back to where we started.
133 make_new_feisty_meow_release "$1"