diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2018-05-14 15:18:41 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2018-05-14 15:21:49 +0300 |
commit | 48edccacd7c5d9b28701e448244da996e66aa0de (patch) | |
tree | 98e55291d3f70929bbb5bb4e1237a4b23844e6ad /Rakefile | |
parent | f2b4a1591e5a1a0cebe5ccbd9da02ad4352756d2 (diff) |
Create monthly single release task
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -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 |