Sha256: 813aa78a80290486e1ac57f02fcbdeb29823ea27b160d616c17f4aff01fdc665

Contents?: true

Size: 886 Bytes

Versions: 3

Compression:

Stored size: 886 Bytes

Contents

require 'rake_factory'

require_relative '../../client'

module RakeCircleCI
  module Tasks
    module SSHKeys
      class Destroy < RakeFactory::Task
        default_name :destroy
        default_description RakeFactory::DynamicValue.new { |t|
          "Destroy SSH keys in the #{t.project_slug} project"
        }

        parameter :project_slug, required: true
        parameter :api_token, required: true
        parameter :base_url, default: 'https://circleci.com/api'
        parameter :ssh_keys, default: {}

        action do |t|
          client = Client.new(
              base_url: t.base_url,
              api_token: t.api_token,
              project_slug: t.project_slug)

          print "Destroying all SSH keys to the '#{t.project_slug}' " +
              "project... "
          client.delete_ssh_keys
          puts "Done."
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rake_circle_ci-0.2.0.pre.10 lib/rake_circle_ci/tasks/ssh_keys/destroy.rb
rake_circle_ci-0.2.0.pre.9 lib/rake_circle_ci/tasks/ssh_keys/destroy.rb
rake_circle_ci-0.2.0.pre.8 lib/rake_circle_ci/tasks/ssh_keys/destroy.rb