diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2019-10-22 10:49:28 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2019-10-22 10:49:28 +0300 |
commit | a786d8b8d8c1b27a148ab4a2577af36d7bd4a8b9 (patch) | |
tree | 5e95f25e0db9669233c9b58130c9ccd53ababa48 /Rakefile | |
parent | e2d144d0e4eb5650355c726f7cb8d31c98aed3dc (diff) |
Update releases:dropdown to check if we're on the release branch
[ci skip]
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -152,12 +152,34 @@ namespace :release do desc 'Creates merge requests to update the dropdowns in all online versions' task :dropdowns do + + # Check if you're on master branch before starting. Fail if you are. + if `git branch --show-current`.tr("\n",'') == 'master' + abort(' + 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 + ') + end + # Load online versions versions = YAML.load_file('./content/_data/versions.yaml') # The first online version should be the current stable one current_version = versions['online'].first + # 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}" @@ -179,4 +201,3 @@ namespace :release do end end end - |