Sha256: a37b7dd23a28af94af4f39b0577455286d5863fb3a50cdb931e5cb96c07a63f7

Contents?: true

Size: 766 Bytes

Versions: 3

Compression:

Stored size: 766 Bytes

Contents

require 'bundler/gem_tasks'

TOKEN_FILE = "#{Dir.home}/.rundock/slack.token"

task :default => [:spec]

desc 'Run all tests.'
task :spec => ['setup', 'rundock']

desc 'Setup environments'

task :setup do
  Bundler.with_clean_env do
    unless FileTest.exist?(TOKEN_FILE)
      puts "#{TOKEN_FILE} not found."
      exit
    end
    token = File.read(TOKEN_FILE)
    src = File.read('./spec/integration/hooks.yml')
    File.write("#{Dir.home}/.rundock/rundock-plugin-hook-slack-hooks.yml", src.gsub(/<SLACK_TOKEN>/, token.strip))
  end
end

desc "Run rundock-slack plugin"

task :rundock do
  cmd = "bundle exec rundock do ./spec/integration/scenario.yml -k #{Dir.home}/.rundock/rundock-plugin-hook-slack-hooks.yml -l debug"
  puts "[EXEC: ] #{cmd}"
  system cmd
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rundock-plugin-hook-slack-0.2.2 Rakefile
rundock-plugin-hook-slack-0.2.1 Rakefile
rundock-plugin-hook-slack-0.2.0 Rakefile