Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2019-10-22 10:52:28 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2019-10-22 10:52:28 +0300
commit714404480e6d41c8ba948c52da157ac316a3ad46 (patch)
tree5e95f25e0db9669233c9b58130c9ccd53ababa48
parente2d144d0e4eb5650355c726f7cb8d31c98aed3dc (diff)
parenta786d8b8d8c1b27a148ab4a2577af36d7bd4a8b9 (diff)
Merge branch 'update-dropdowns-raketask' into 'master'
Update releases:dropdown to check if we're on the release branch See merge request gitlab-org/gitlab-docs!600
-rw-r--r--Rakefile23
1 files changed, 22 insertions, 1 deletions
diff --git a/Rakefile b/Rakefile
index af8832f9..f11c9fb5 100644
--- a/Rakefile
+++ b/Rakefile
@@ -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
-