Project

General

Profile

Download (653 Bytes) Statistics
| Branch: | Tag: | Revision:

runcible / lib / runcible / models / docker_distributor.rb @ c0df0f4c

1
require 'active_support/json'
2
require 'securerandom'
3

    
4
module Runcible
5
  module Models
6
    class DockerDistributor < Distributor
7
      #optional attributes
8
      attr_accessor 'docker_publish_directory', 'protected',
9
                    'redirect_url', 'repo_registry_id'
10

    
11
      def initialize(params = {})
12
        super(params)
13
      end
14

    
15
      def self.type_id
16
        'docker_distributor_web'
17
      end
18

    
19
      def config
20
        to_ret = as_json
21
        to_ret.delete('auto_publish')
22
        to_ret.delete('id')
23
        to_ret.delete("repo_registry_id")
24
        to_ret["repo-registry-id"] = repo_registry_id
25
        to_ret
26
      end
27
    end
28
  end
29
end