Rakefile in sidekiq-prometheus-exporter-0.1.14 vs Rakefile in sidekiq-prometheus-exporter-0.1.15

- old
+ new

@@ -9,10 +9,12 @@ require 'English' require 'fileutils' require_relative 'lib/sidekiq/prometheus/exporter/version' +VERSION = Sidekiq::Prometheus::Exporter::VERSION + def execute(command) output = `#{command}` unless $CHILD_STATUS.success? warn output @@ -21,32 +23,33 @@ output end namespace :docker do + desc "Release new Docker image strech/sidekiq-prometheus-exporter:#{VERSION} (latest)" task :release do Rake::Task['docker:build'].invoke Rake::Task['docker:push'].invoke end task :build do image = 'strech/sidekiq-prometheus-exporter' Dir.chdir(File.expand_path('./docker')) do - execute("docker build -t #{image}:#{Sidekiq::Prometheus::Exporter::VERSION} -t #{image}:latest .") + execute("docker build -t #{image}:#{VERSION} -t #{image}:latest .") end - puts "Successfully built strech/sidekiq-prometheus-exporter and tagged #{Sidekiq::Prometheus::Exporter::VERSION}, latest" + puts "Successfully built strech/sidekiq-prometheus-exporter and tagged #{VERSION} (latest)" end task :push do image = 'strech/sidekiq-prometheus-exporter' - execute("docker push #{image}:#{Sidekiq::Prometheus::Exporter::VERSION}") + execute("docker push #{image}:#{VERSION}") execute("docker push #{image}:latest") - puts "Successfully pushed strech/sidekiq-prometheus-exporter #{Sidekiq::Prometheus::Exporter::VERSION}, latest" + puts "Successfully pushed strech/sidekiq-prometheus-exporter:#{VERSION} (latest)" end end namespace :helm do desc 'Generate new Helm repo index' @@ -68,10 +71,10 @@ execute("helm package #{chart_dir} -d #{archive_dir}") end task :index, [:directory] do |_, args| Dir.chdir(args.fetch(:directory)) do - url = "https://github.com/Strech/sidekiq-prometheus-exporter/releases/download/v#{Sidekiq::Prometheus::Exporter::VERSION}" + url = "https://github.com/Strech/sidekiq-prometheus-exporter/releases/download/v#{VERSION}" execute('git show gh-pages:index.yaml > existing-index.yaml') execute("helm repo index . --url #{url} --merge existing-index.yaml") end end