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>2018-07-10 12:21:55 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2018-07-10 12:28:23 +0300
commit110bbbc569ce86f9f59899cea5b6144cab7da2a9 (patch)
tree9f677af44b2d711ff8465c89943a130532e83107 /Rakefile
parentdcf1e6e342a603a7aa35a066b35358714857bc63 (diff)
Change to branch when creating a new version
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile20
1 files changed, 19 insertions, 1 deletions
diff --git a/Rakefile b/Rakefile
index c2918081..fb48cc40 100644
--- a/Rakefile
+++ b/Rakefile
@@ -113,7 +113,16 @@ namespace :release do
abort('rake aborted!') if ask("#{dockerfile} already exists. Do you want to overwrite?", %w[y n]) == 'n'
end
- puts "Created new Dockerfile: #{dockerfile}"
+ # Stash modified and untracked files so we have "clean" environment
+ # without accidentally deleting data
+ `git stash -u` if git_workdir_dirty?
+
+ # Sync with upstream master
+ `git checkout master`
+ `git pull origin master`
+
+ # Reset so that if the repo is cached, the latest commit will be used
+ `git checkout -b #{version}`
content = File.read('dockerfiles/Dockerfile.single')
content.gsub!('X.Y', version)
@@ -122,5 +131,14 @@ namespace :release do
open(dockerfile, 'w') do |post|
post.puts content
end
+
+ puts "Created new Dockerfile: #{dockerfile}"
+
+ # Add and commit new Dockerfile
+ `git add Dockerfile.#{version}`
+ `git commit -m "Add #{version} Dockerfile"`
+
+ puts "You can now push the new branch:"
+ puts "git push origin #{version}"
end
end