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-05-14 15:18:41 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2018-05-14 15:21:49 +0300
commit48edccacd7c5d9b28701e448244da996e66aa0de (patch)
tree98e55291d3f70929bbb5bb4e1237a4b23844e6ad /Rakefile
parentf2b4a1591e5a1a0cebe5ccbd9da02ad4352756d2 (diff)
Create monthly single release task
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile27
1 files changed, 27 insertions, 0 deletions
diff --git a/Rakefile b/Rakefile
index 342edfe4..c1f0c33e 100644
--- a/Rakefile
+++ b/Rakefile
@@ -62,3 +62,30 @@ task :pull_repos do
end
end
end
+
+namespace :release do
+ desc 'Creates a single release archive'
+ task :single, :version do |t, args|
+ require "highline/import"
+ version = args.version.to_s
+ source_dir = File.expand_path('../', __FILE__)
+
+ raise 'You need to specify a version, like 10.1' unless version =~ /\A\d+\.\d+\z/
+
+ dockerfile = "#{source_dir}/Dockerfile.#{version}"
+
+ if File.exist?(dockerfile)
+ abort('rake aborted!') if ask("#{dockerfile} already exists. Do you want to overwrite?", %w[y n]) == 'n'
+ end
+
+ puts "Created new Dockerfile: #{dockerfile}"
+
+ content = File.read('dockerfiles/Dockerfile.single')
+ content.gsub!('X.Y', version)
+ content.gsub!('X-Y', version.tr('.', '-'))
+
+ open(dockerfile, 'w') do |post|
+ post.puts content
+ end
+ end
+end \ No newline at end of file