diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2020-10-16 11:11:05 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2020-10-16 11:11:05 +0300 |
commit | 3a78bf41c62c2e8694b4d0187d490af2765c94a5 (patch) | |
tree | 0a98255d17f9426f2f7e14b51d40c74a845b8902 /Rakefile | |
parent | 167b10016958d07627d1c5f3991bfbf85d52b4e6 (diff) |
Revert "Merge branch 'rake-release-branch-checkout-automation' into 'master'"
This reverts merge request !1083
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 30 |
1 files changed, 15 insertions, 15 deletions
@@ -121,7 +121,7 @@ namespace :release do abort("Rake aborted! The branch already exists. Delete it with `git branch -D #{version}` and rerun the task.") end - # Stash modified and untracked files so we have a "clean" environment + # Stash modified and untracked files so we have "clean" environment # without accidentally deleting data puts "Stashing changes" `git stash -u` if git_workdir_dirty? @@ -180,22 +180,13 @@ namespace :release do desc 'Creates merge requests to update the dropdowns in all online versions' task :dropdowns do - # Check if a release branch has been created and warn the user if it hasn't - if `git rev-parse --verify #{release_branch}`.empty? + # Check if you're on master branch before starting. Fail if you are. + if `git branch --show-current`.tr("\n",'') == 'master' abort(' - A release branch for the latest stable version has not been created. - Follow the documentation guide on how to create one: - https://docs.gitlab.com/ee/development/documentation/site_architecture/versions.html#3-create-the-release-merge-request + It appears you are on master branch. Create the current release + branch and run the raketask again. Follow the documentation guide + on how to create it: https://docs.gitlab.com/ee/development/documentation/site_architecture/versions.html#3-create-the-release-merge-request ') - else - # Stash modified and untracked files so we have a "clean" environment - # without accidentally deleting data - puts "Stashing changes" - `git stash -u` if git_workdir_dirty? - - # Change to the release branch and sync with upstream - `git checkout #{release_branch}` - `git pull #{release_branch}` end # Load online versions @@ -207,6 +198,15 @@ namespace :release do # The release branch name release_branch = "release-#{current_version.tr('.', '-')}" + # Check if a release branch has been created, if not fail and warn the user + if `git rev-parse --verify #{release_branch}`.empty? + abort(' + A release branch for the latest stable version has not been created. + Follow the documentation guide on how to create one: + https://docs.gitlab.com/ee/development/documentation/site_architecture/versions.html#3-create-the-release-merge-request + ') + end + # Set the commit title commit_title = "Update dropdown to #{current_version}" |