concourse-objects 1.32.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/concourse-objects.rb +2 -1
- data/lib/concourse-objects/resources.rb +53 -0
- data/lib/concourse-objects/resources/alertmanager.rb +58 -0
- data/lib/concourse-objects/resources/android-sdk.rb +27 -0
- data/lib/concourse-objects/resources/ansible-playbook.rb +68 -0
- data/lib/concourse-objects/resources/artifactory-deb.rb +54 -0
- data/lib/concourse-objects/resources/artifactory.rb +33 -0
- data/lib/concourse-objects/resources/bender.rb +61 -0
- data/lib/concourse-objects/resources/bosh-io-release.rb +1 -0
- data/lib/concourse-objects/resources/bosh-io-stemcell.rb +1 -0
- data/lib/concourse-objects/resources/bosh-release.rb +64 -0
- data/lib/concourse-objects/resources/calendar.rb +36 -0
- data/lib/concourse-objects/resources/cf-event.rb +38 -0
- data/lib/concourse-objects/resources/cf-flyway.rb +45 -0
- data/lib/concourse-objects/resources/cf-zero-downtime.rb +64 -0
- data/lib/concourse-objects/resources/cf.rb +1 -0
- data/lib/concourse-objects/resources/chartmuseum.rb +56 -0
- data/lib/concourse-objects/resources/concourse-pipeline.rb +1 -0
- data/lib/concourse-objects/resources/deploygate.rb +38 -0
- data/lib/concourse-objects/resources/devpi.rb +44 -0
- data/lib/concourse-objects/resources/docker-compose.rb +131 -0
- data/lib/concourse-objects/resources/docker-image.rb +1 -0
- data/lib/concourse-objects/resources/email.rb +1 -0
- data/lib/concourse-objects/resources/fly.rb +46 -0
- data/lib/concourse-objects/resources/gcs.rb +61 -0
- data/lib/concourse-objects/resources/gerrit.rb +49 -0
- data/lib/concourse-objects/resources/git.rb +1 -0
- data/lib/concourse-objects/resources/github-list-repos.rb +1 -0
- data/lib/concourse-objects/resources/github-pr.rb +1 -0
- data/lib/concourse-objects/resources/github-release.rb +1 -0
- data/lib/concourse-objects/resources/github-status.rb +48 -0
- data/lib/concourse-objects/resources/github-webhook.rb +1 -0
- data/lib/concourse-objects/resources/grafana.rb +1 -0
- data/lib/concourse-objects/resources/hangouts.rb +35 -0
- data/lib/concourse-objects/resources/helm-chart.rb +1 -0
- data/lib/concourse-objects/resources/helm.rb +1 -0
- data/lib/concourse-objects/resources/hg.rb +1 -0
- data/lib/concourse-objects/resources/hipchat-notification.rb +1 -0
- data/lib/concourse-objects/resources/hockey.rb +32 -0
- data/lib/concourse-objects/resources/irc-notification.rb +1 -0
- data/lib/concourse-objects/resources/keyval.rb +1 -0
- data/lib/concourse-objects/resources/kubernetes-resource.rb +41 -0
- data/lib/concourse-objects/resources/kubernetes.rb +55 -0
- data/lib/concourse-objects/resources/marathon.rb +45 -0
- data/lib/concourse-objects/resources/maven.rb +43 -0
- data/lib/concourse-objects/resources/metadata.rb +1 -0
- data/lib/concourse-objects/resources/mock.rb +1 -0
- data/lib/concourse-objects/resources/newrelic-deploy.rb +31 -0
- data/lib/concourse-objects/resources/pool.rb +1 -0
- data/lib/concourse-objects/resources/registry-image.rb +1 -0
- data/lib/concourse-objects/resources/repo.rb +31 -0
- data/lib/concourse-objects/resources/rocketchat-notification.rb +43 -0
- data/lib/concourse-objects/resources/romver.rb +81 -0
- data/lib/concourse-objects/resources/rss.rb +1 -0
- data/lib/concourse-objects/resources/rubygems.rb +1 -0
- data/lib/concourse-objects/resources/s3.rb +1 -0
- data/lib/concourse-objects/resources/semver.rb +1 -0
- data/lib/concourse-objects/resources/serverspec.rb +30 -0
- data/lib/concourse-objects/resources/slack-notification.rb +1 -0
- data/lib/concourse-objects/resources/sonarqube.rb +70 -0
- data/lib/concourse-objects/resources/swift.rb +43 -0
- data/lib/concourse-objects/resources/telegram.rb +41 -0
- data/lib/concourse-objects/resources/time.rb +1 -0
- metadata +35 -2
- metadata.gz.sig +2 -3
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../concourse-objects"
|
4
|
+
|
5
|
+
module ConcourseObjects
|
6
|
+
module Resources
|
7
|
+
class BOSHRelease < Resource
|
8
|
+
RESOURCE_NAME = "bosh-release"
|
9
|
+
RESOURCE_LICENSE = "MIT"
|
10
|
+
GITHUB_OWNER = "dpb587"
|
11
|
+
GITHUB_REPOSITORY = "dpb587/bosh-release-resource"
|
12
|
+
GITHUB_VERSION = "v0.4.0"
|
13
|
+
|
14
|
+
class Source < Object
|
15
|
+
required :uri, write: AsString
|
16
|
+
|
17
|
+
optional :branch, write: AsString
|
18
|
+
optional :name, write: AsString
|
19
|
+
optional :version, write: AsString
|
20
|
+
optional :dev_releases, write: AsBoolean
|
21
|
+
optional :private_config, write: AsHash, default: EmptyHash
|
22
|
+
end
|
23
|
+
|
24
|
+
class InParams < Object
|
25
|
+
DEFAULT_TARBALL = true
|
26
|
+
DEFAULT_TARBALL_NAME = "{{.Name}}-{{.Version}}.tgz"
|
27
|
+
|
28
|
+
optional :tarball_name, write: AsString
|
29
|
+
optional :tarball, write: AsBoolean, default: proc { DEFAULT_TARBALL }
|
30
|
+
end
|
31
|
+
|
32
|
+
class OutParams < Object
|
33
|
+
DEFAULT_AUTHOR_NAME = "CI Bot"
|
34
|
+
DEFAULT_AUTHOR_EMAIL = "ci@localhost"
|
35
|
+
DEFAULT_REBASE = false
|
36
|
+
DEFAULT_SKIP_TAG = false
|
37
|
+
|
38
|
+
required :version, write: AsString
|
39
|
+
|
40
|
+
optional :repository, write: AsString
|
41
|
+
optional :tarball, write: AsString
|
42
|
+
optional :commit_file, write: AsString
|
43
|
+
optional :author_name, write: AsString, default: proc { DEFAULT_AUTHOR_NAME }
|
44
|
+
optional :author_email, write: AsString, default: proc { DEFAULT_AUTHOR_EMAIL }
|
45
|
+
optional :rebase, write: AsBoolean, default: proc { DEFAULT_REBASE }
|
46
|
+
optional :skip_tag, write: AsBoolean, default: proc { DEFAULT_SKIP_TAG }
|
47
|
+
|
48
|
+
def initialize(options = {})
|
49
|
+
super(options) do |this, options|
|
50
|
+
raise KeyError, "#{self.class.inspect} requires one of (repository, tarball)" unless (this.repository? or this.tarball?)
|
51
|
+
|
52
|
+
yield this, options if block_given?
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
optional :source, write: Source
|
58
|
+
|
59
|
+
def initialize(options = {})
|
60
|
+
super(options.merge(type: "bosh-release"))
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../concourse-objects"
|
4
|
+
|
5
|
+
module ConcourseObjects
|
6
|
+
module Resources
|
7
|
+
class Calendar < Resource
|
8
|
+
RESOURCE_NAME = "calendar"
|
9
|
+
RESOURCE_LICENSE = "MIT"
|
10
|
+
GITHUB_OWNER = "henrytk"
|
11
|
+
GITHUB_REPOSITORY = "henrytk/calendar-resource"
|
12
|
+
GITHUB_VERSION = "v1.1"
|
13
|
+
|
14
|
+
class Source < Object
|
15
|
+
required :provider, write: AsString
|
16
|
+
required :calendar_id, write: AsString
|
17
|
+
required :event_name, write: AsString
|
18
|
+
required :credentials, write: AsString
|
19
|
+
end
|
20
|
+
|
21
|
+
class OutParams < Object
|
22
|
+
optional :summary, write: AsString
|
23
|
+
optional :description, write: AsString
|
24
|
+
optional :time_zone, write: AsString
|
25
|
+
optional :start_time, write: AsString
|
26
|
+
optional :end_time, write: AsString
|
27
|
+
end
|
28
|
+
|
29
|
+
optional :source, write: Source
|
30
|
+
|
31
|
+
def initialize(options = {})
|
32
|
+
super(options.merge(type: "calendar"))
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../concourse-objects"
|
4
|
+
|
5
|
+
module ConcourseObjects
|
6
|
+
module Resources
|
7
|
+
class CFEvent < Resource
|
8
|
+
RESOURCE_NAME = "cf-event"
|
9
|
+
RESOURCE_LICENSE = nil
|
10
|
+
GITHUB_OWNER = "mevansam"
|
11
|
+
GITHUB_REPOSITORY = "mevansam/cf-event-resource-type"
|
12
|
+
GITHUB_VERSION = "0.9.3"
|
13
|
+
|
14
|
+
class Source < Object
|
15
|
+
DEFAULT_SKIP_SSL_VALIDATION = false
|
16
|
+
DEFAULT_DEBUG = false
|
17
|
+
DEFAULT_TRACE = false
|
18
|
+
|
19
|
+
required :api, write: AsString
|
20
|
+
required :user, write: AsString
|
21
|
+
required :password, write: AsString
|
22
|
+
required :org, write: AsString
|
23
|
+
required :space, write: AsString
|
24
|
+
|
25
|
+
optional :apps, write: AsArrayOf.(:to_s), default: EmptyArray
|
26
|
+
optional :"skip-ssl-validation", write: AsBoolean, default: proc { DEFAULT_SKIP_SSL_VALIDATION }
|
27
|
+
optional :debug, write: AsBoolean, default: proc { DEFAULT_DEBUG }
|
28
|
+
optional :trace, write: AsBoolean, default: proc { DEFAULT_TRACE }
|
29
|
+
end
|
30
|
+
|
31
|
+
optional :source, write: Source
|
32
|
+
|
33
|
+
def initialize(options = {})
|
34
|
+
super(options.merge(type: "cf-event"))
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../concourse-objects"
|
4
|
+
|
5
|
+
module ConcourseObjects
|
6
|
+
module Resources
|
7
|
+
class Flyway < Resource
|
8
|
+
RESOURCE_NAME = "cf-flyway"
|
9
|
+
RESOURCE_LICENSE = "MIT"
|
10
|
+
GITHUB_OWNER = "emerald-resource"
|
11
|
+
GITHUB_REPOSITORY = "emerald-resource/cf-flyway-resource"
|
12
|
+
GITHUB_VERSION = "v1.0.1"
|
13
|
+
|
14
|
+
class Source < Object
|
15
|
+
required :api, write: AsString
|
16
|
+
required :username, write: AsString
|
17
|
+
required :password, write: AsString
|
18
|
+
required :organization, write: AsString
|
19
|
+
required :space, write: AsString
|
20
|
+
required :service, write: AsString
|
21
|
+
end
|
22
|
+
|
23
|
+
class OutParams < Object
|
24
|
+
DEFAULT_CLEAN_DISABLED = false
|
25
|
+
DEFAULT_COMMANDS = ["info", "migrate", "info"]
|
26
|
+
ACCEPTABLE_COMMANDS = ["migrate", "clean", "info", "validate", "undo", "baseline", "repair"]
|
27
|
+
CommandsAreAcceptable = proc { |_, commands| commands.all? { |command| ACCEPTABLE_COMMANDS.include?(command) } }
|
28
|
+
|
29
|
+
required :locations, write: AsString
|
30
|
+
|
31
|
+
optional :commands, write: AsArrayOf.(:to_s), default: proc { DEFAULT_COMMANDS }, guard: CommandsAreAcceptable
|
32
|
+
optional :clean_disabled, write: AsBoolean, default: proc { DEFAULT_CLEAN_DISABLED }
|
33
|
+
optional :delete_service_key, write: AsBoolean, default: proc { DEFAULT_DELETE_SERVICE_KEY }
|
34
|
+
optional :flyway_conf, write: AsString
|
35
|
+
optional :jbdc_builder, write: AsString
|
36
|
+
end
|
37
|
+
|
38
|
+
optional :source, write: Source
|
39
|
+
|
40
|
+
def initialize(options = {})
|
41
|
+
super(options.merge(type: "cf-flyway"))
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../concourse-objects"
|
4
|
+
|
5
|
+
module ConcourseObjects
|
6
|
+
module Resources
|
7
|
+
class CFZeroDowntime < Resource
|
8
|
+
RESOURCE_NAME = "cf-zero-downtime"
|
9
|
+
RESOURCE_LICENSE = "MIT"
|
10
|
+
GITHUB_OWNER = "emerald-squad"
|
11
|
+
GITHUB_REPOSITORY = "emerald-squad/cf-zero-downtime-resource"
|
12
|
+
GITHUB_VERSION = "0.1.0"
|
13
|
+
|
14
|
+
class Source < Object
|
15
|
+
DEFAULT_SKIP_CERT_CHECK = false
|
16
|
+
DEFAULT_VERBOSE = false
|
17
|
+
|
18
|
+
required :api, write: AsString
|
19
|
+
required :organization, write: AsString
|
20
|
+
required :space, write: AsString
|
21
|
+
|
22
|
+
optional :username, write: AsString
|
23
|
+
optional :password, write: AsString
|
24
|
+
optional :client_id, write: AsString
|
25
|
+
optional :client_secret, write: AsString
|
26
|
+
optional :skip_cert_check, write: AsBoolean, default: proc { DEFAULT_SKIP_CERT_CHECK }
|
27
|
+
optional :verbose, write: AsBoolean, default: proc { DEFAULT_VERBOSE }
|
28
|
+
|
29
|
+
def initialize(options = {})
|
30
|
+
super(options) do |this, options|
|
31
|
+
raise KeyError, "#{self.class.inspect} requires one of ((username, password), (client_id, client_secret))" unless ((this.username? and this.password?) or (this.client_id? and this.client_secret?))
|
32
|
+
|
33
|
+
yield this, options if block_given?
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
class OutParams < Object
|
39
|
+
class Service < Object
|
40
|
+
required :name, write: AsString
|
41
|
+
required :config, write: AsHash
|
42
|
+
end
|
43
|
+
|
44
|
+
required :name, write: AsString
|
45
|
+
required :manifest, write: AsString
|
46
|
+
required :path, write: AsString
|
47
|
+
|
48
|
+
optional :environment_variables, write: AsHashOf.(:to_s, :to_s), default: EmptyHash
|
49
|
+
optional :manifest, write: AsHash, default: EmptyHash
|
50
|
+
optional :manifest_vars, write: AsHash, default: EmptyHash
|
51
|
+
optional :manifest_vars_files, write: AsArrayOf.(:to_s), default: EmptyArray
|
52
|
+
optional :services, write: AsArrayOf.(Service), default: EmptyArray
|
53
|
+
optional :docker_username, write: AsString
|
54
|
+
optional :docker_password, write: AsString
|
55
|
+
end
|
56
|
+
|
57
|
+
optional :source, write: Source
|
58
|
+
|
59
|
+
def initialize(options = {})
|
60
|
+
super(options.merge(type: "cf-zero-downtime"))
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../concourse-objects"
|
4
|
+
|
5
|
+
module ConcourseObjects
|
6
|
+
module Resources
|
7
|
+
class ChartMuseum < Resource
|
8
|
+
RESOURCE_NAME = "chartmuseum"
|
9
|
+
RESOURCE_LICENSE = "Apache-2.0"
|
10
|
+
GITHUB_OWNER = "cathive"
|
11
|
+
GITHUB_REPOSITORY = "cathive/concourse-chartmuseum-resource"
|
12
|
+
GITHUB_VERSION = "0.6.0"
|
13
|
+
|
14
|
+
class Source < Object
|
15
|
+
required :server_url, write: AsString
|
16
|
+
required :chart_name, write: AsString
|
17
|
+
optional :version_range, write: AsString
|
18
|
+
optional :basic_auth_username, write: AsString
|
19
|
+
optional :basic_auth_password, write: AsString
|
20
|
+
end
|
21
|
+
|
22
|
+
class InParams < Object
|
23
|
+
optional :target_basename, write: AsString
|
24
|
+
end
|
25
|
+
|
26
|
+
class OutParams < Object
|
27
|
+
DEFAULT_FORCE = false
|
28
|
+
DEFAULT_SIGN = false
|
29
|
+
|
30
|
+
required :chart, write: AsString
|
31
|
+
|
32
|
+
optional :force, write: AsBoolean, default: proc { DEFAULT_FORCE }
|
33
|
+
optional :sign, write: AsBoolean, default: proc { DEFAULT_SIGN }
|
34
|
+
optional :key_data, write: AsString
|
35
|
+
optional :key_file, write: AsString
|
36
|
+
optional :version, write: AsString
|
37
|
+
optional :version_file, write: AsString
|
38
|
+
|
39
|
+
def initialize(options = {})
|
40
|
+
super(options)
|
41
|
+
super(options) do |this, options|
|
42
|
+
raise KeyError, "#{self.class.inspect} requires one of (key_data, key_file)" if this.sign? unless (this.key_data? or this.key_file?)
|
43
|
+
|
44
|
+
yield this, options if block_given?
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
optional :source, write: Source
|
50
|
+
|
51
|
+
def initialize(options = {})
|
52
|
+
super(options.merge(type: "chartmuseum"))
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../concourse-objects"
|
4
|
+
|
5
|
+
module ConcourseObjects
|
6
|
+
module Resources
|
7
|
+
class DeployGate < Resource
|
8
|
+
RESOURCE_NAME = "deploygate"
|
9
|
+
RESOURCE_LICENSE = "MIT"
|
10
|
+
GITHUB_OWNER = "YuukiARIA"
|
11
|
+
GITHUB_REPOSITORY = "YuukiARIA/concourse-deploygate-resource"
|
12
|
+
GITHUB_VERSION = "v0.2.1"
|
13
|
+
|
14
|
+
class Source < Object
|
15
|
+
required :api_key, write: AsString
|
16
|
+
required :owner, write: AsString
|
17
|
+
end
|
18
|
+
|
19
|
+
class OutParams < Object
|
20
|
+
required :file, write: AsString
|
21
|
+
|
22
|
+
optional :message, write: AsString
|
23
|
+
optional :message_file, write: AsString
|
24
|
+
optional :distribution_key, write: AsString
|
25
|
+
optional :distribution_name, write: AsString
|
26
|
+
optional :release_note, write: AsString
|
27
|
+
optional :disable_notify, write: AsBoolean
|
28
|
+
optional :visibility, write: AsString
|
29
|
+
end
|
30
|
+
|
31
|
+
optional :source, write: Source
|
32
|
+
|
33
|
+
def initialize(options = {})
|
34
|
+
super(options.merge(type: "mock"))
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../concourse-objects"
|
4
|
+
|
5
|
+
module ConcourseObjects
|
6
|
+
module Resources
|
7
|
+
class DevPI < Resource
|
8
|
+
RESOURCE_NAME = "devpi"
|
9
|
+
RESOURCE_LICENSE = "MIT"
|
10
|
+
GITHUB_OWNER = "mdomke"
|
11
|
+
GITHUB_REPOSITORY = "mdomke/devpi-resource"
|
12
|
+
GITHUB_VERSION = "1.1.1"
|
13
|
+
|
14
|
+
class Source < Object
|
15
|
+
ACCEPTABLE_VERSIONINGS = ["loose", "semantic"]
|
16
|
+
DEFAULT_VERSIONING = "loose"
|
17
|
+
VersioningIsAcceptable = proc { |_, versioning| ACCEPTABLE_VERSIONINGS.include?(versioning) }
|
18
|
+
|
19
|
+
required :uri, write: AsString
|
20
|
+
required :index, write: AsString
|
21
|
+
required :package, write: AsString
|
22
|
+
|
23
|
+
optional :username, write: AsString
|
24
|
+
optional :password, write: AsString
|
25
|
+
optional :versioning, write: AsString, default: proc { DEFAULT_VERSIONING }, guard: VersioningIsAcceptable
|
26
|
+
end
|
27
|
+
|
28
|
+
class InParams < Object
|
29
|
+
optional :version, write: AsString
|
30
|
+
end
|
31
|
+
|
32
|
+
class OutParams < Object
|
33
|
+
optional :file, write: AsString
|
34
|
+
optional :fileglob, write: AsString
|
35
|
+
end
|
36
|
+
|
37
|
+
optional :source, write: Source
|
38
|
+
|
39
|
+
def initialize(options = {})
|
40
|
+
super(options.merge(type: "devpi"))
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,131 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../concourse-objects"
|
4
|
+
|
5
|
+
module ConcourseObjects
|
6
|
+
module Resources
|
7
|
+
class DockerCompose < Resource
|
8
|
+
RESOURCE_NAME = "docker-compose"
|
9
|
+
RESOURCE_LICENSE = "MIT"
|
10
|
+
GITHUB_OWNER = "troykinsella"
|
11
|
+
GITHUB_REPOSITORY = "troykinsella/concourse-docker-compose-resource"
|
12
|
+
GITHUB_VERSION = "1.1.0"
|
13
|
+
|
14
|
+
class Source < Object
|
15
|
+
class CACert < Object
|
16
|
+
required :domain, write: AsString
|
17
|
+
required :domain, write: AsString
|
18
|
+
end
|
19
|
+
|
20
|
+
class Registry < Object
|
21
|
+
required :host, write: AsString
|
22
|
+
required :username, write: AsString
|
23
|
+
required :password, write: AsString
|
24
|
+
end
|
25
|
+
|
26
|
+
DEFAULT_PORT = 2376
|
27
|
+
DEFAULT_VERBOSE = false
|
28
|
+
|
29
|
+
required :host, write: AsString
|
30
|
+
|
31
|
+
optional :port, write: AsInteger, default: proc { DEFAULT_PORT }
|
32
|
+
optional :verbose, write: AsBoolean, default: proc { DEFAULT_VERBOSE }
|
33
|
+
optional :ca_certs, write: AsArrayOf.(CACert), default: EmptyArray
|
34
|
+
optional :registries, write: AsArrayOf.(Registry), default: EmptyArray
|
35
|
+
end
|
36
|
+
|
37
|
+
class OutParams < Object
|
38
|
+
class Options < Object
|
39
|
+
class Up < Options
|
40
|
+
DEFAULT_FORCE_RECREATE = false
|
41
|
+
DEFAULT_NO_DEPS = false
|
42
|
+
DEFAULT_NO_RECREATE = false
|
43
|
+
DEFAULT_REMOVE_ORPHANS = false
|
44
|
+
DEFAULT_RENEW_ANON_VOLUMES = false
|
45
|
+
|
46
|
+
optional :scale, write: AsHashOf.(:to_s, :to_i), default: EmptyHash
|
47
|
+
optional :"renew-anon_volumes", write: AsBoolean, default: proc { DEFAULT_RENEW_ANON_VOLUMES }
|
48
|
+
optional :force_recreate, write: AsBoolean, default: proc { DEFAULT_FORCE_RECREATE }
|
49
|
+
optional :no_deps, write: AsBoolean, default: proc { DEFAULT_NO_DEPS }
|
50
|
+
optional :no_recreate, write: AsBoolean, default: proc { DEFAULT_NO_RECREATE }
|
51
|
+
optional :remove_orphans, write: AsBoolean, default: proc { DEFAULT_REMOVE_ORPHANS }
|
52
|
+
optional :timeout, write: AsInteger
|
53
|
+
end
|
54
|
+
|
55
|
+
class Down < Options
|
56
|
+
DEFAULT_VOLUMES = false
|
57
|
+
DEFAULT_REMOVE_ORPHANS = false
|
58
|
+
|
59
|
+
ACCEPTABLE_RMIS = ["all", "local"]
|
60
|
+
RMIIsAcceptable = proc { |_, rmi| ACCEPTABLE_RMIS.include?(rmi) }
|
61
|
+
|
62
|
+
optional :volumes, write: AsBoolean, default: proc { DEFAULT_VOLUMES }
|
63
|
+
optional :remove_orphans, write: AsBoolean, default: proc { DEFAULT_REMOVE_ORPHANS }
|
64
|
+
optional :rmi, write: AsString, guard: RMIIsAcceptable
|
65
|
+
optional :timeout, write: AsInteger
|
66
|
+
end
|
67
|
+
|
68
|
+
class Start < Options
|
69
|
+
end
|
70
|
+
|
71
|
+
class Stop < Options
|
72
|
+
optional :timeout, write: AsInteger
|
73
|
+
end
|
74
|
+
|
75
|
+
class Restart < Options
|
76
|
+
optional :timeout, write: AsInteger
|
77
|
+
end
|
78
|
+
|
79
|
+
class Kill < Options
|
80
|
+
optional :signal
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
DEFAULT_COMMAND = "up"
|
85
|
+
DEFAULT_COMPOSE_FILE = "docker-compose.yml"
|
86
|
+
DEFAULT_PRINT = false
|
87
|
+
DEFAULT_PULL = false
|
88
|
+
|
89
|
+
ACCEPTABLE_COMMANDS = ["up", "down", "start", "stop", "restart", "kill"]
|
90
|
+
CommandIsAcceptable = proc { |_, command| ACCEPTABLE_COMMANDS.include?(command) }
|
91
|
+
|
92
|
+
optional :env, write: AsHashOf.(:to_s, :to_s), default: EmptyHash
|
93
|
+
optional :options, write: AsHash, default: EmptyHash
|
94
|
+
optional :services, write: AsArrayOf.(:to_s), default: EmptyArray
|
95
|
+
optional :print, write: AsBoolean, default: proc { DEFAULT_PRINT }
|
96
|
+
optional :pull, write: AsBoolean, default: proc { DEFAULT_PULL }
|
97
|
+
optional :compose_file, write: AsString, default: proc { DEFAULT_COMPOSE_FILE }
|
98
|
+
optional :command, write: AsString, default: proc { DEFAULT_COMMAND }, guard: CommandIsAcceptable
|
99
|
+
optional :env_file, write: AsString
|
100
|
+
optional :path, write: AsString
|
101
|
+
optional :project, write: AsString
|
102
|
+
optional :wait_before, write: AsInteger
|
103
|
+
optional :wait_after, write: AsInteger
|
104
|
+
|
105
|
+
def initialize(options = {})
|
106
|
+
super(options) do |this, options|
|
107
|
+
case this.command
|
108
|
+
when "up" then Options::Up.(options)
|
109
|
+
when "down" then Options::Down.(options)
|
110
|
+
when "start" then Options::Start.(options)
|
111
|
+
when "stop" then Options::Stop.(options)
|
112
|
+
when "restart" then Options::Restart.(options)
|
113
|
+
when "kill" then Options::Kill.(options)
|
114
|
+
else Options.(options)
|
115
|
+
end.yield_self do |options|
|
116
|
+
this.send(:instance_variable_set, :@options, options)
|
117
|
+
end
|
118
|
+
|
119
|
+
yield this, options if block_given?
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
optional :source, write: Source
|
125
|
+
|
126
|
+
def initialize(options = {})
|
127
|
+
super(options.merge(type: "docker-compose"))
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|