concourse-objects 1.15.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data/.gitignore +59 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +22 -0
- data/README.org +41 -0
- data/concourse-objects.gemspec +21 -0
- data/lib/concourse-objects/resources/bosh-io-release.rb +34 -0
- data/lib/concourse-objects/resources/bosh-io-stemcell.rb +37 -0
- data/lib/concourse-objects/resources/cf.rb +56 -0
- data/lib/concourse-objects/resources/docker-image.rb +93 -0
- data/lib/concourse-objects/resources/git.rb +111 -0
- data/lib/concourse-objects/resources/github-release.rb +79 -0
- data/lib/concourse-objects/resources/hg.rb +54 -0
- data/lib/concourse-objects/resources/pool.rb +59 -0
- data/lib/concourse-objects/resources/registry-image.rb +49 -0
- data/lib/concourse-objects/resources/s3.rb +83 -0
- data/lib/concourse-objects/resources/semver.rb +135 -0
- data/lib/concourse-objects/resources/time.rb +29 -0
- data/lib/concourse-objects/resources.rb +59 -0
- data/lib/concourse-objects.rb +449 -0
- data/tools/check-resources +39 -0
- data/tools/test +72 -0
- data/trust/certificates/colstrom.pem +25 -0
- data.tar.gz.sig +0 -0
- metadata +90 -0
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2ad7abc71d5a356f6122e092a350ccfedc8eac2065d17a45c29d216f091a34c3
|
4
|
+
data.tar.gz: dbd4aba4fa7e4e415e48016e8355dcbc0b92c15e60aec1e0fceddb282ed48113
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 886b36824aa04cb770c9b25658d6fe97071df77a0bd2c19fbb3e6bd005725eabd69a4587974ceec298f52b4d03f0f767b30cf206e28f6b8b3b9158a26f512203
|
7
|
+
data.tar.gz: 32eb143574249b216858b3826b98fd19056587b154b3c21bd64f79213af4c35fef3b40ace2bbfe3904d653f304c3eed94aed845461ce95875748f60047340c15
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data/.gitignore
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
|
2
|
+
# Created by https://www.gitignore.io/api/ruby
|
3
|
+
# Edit at https://www.gitignore.io/?templates=ruby
|
4
|
+
|
5
|
+
### Ruby ###
|
6
|
+
*.gem
|
7
|
+
*.rbc
|
8
|
+
/.config
|
9
|
+
/coverage/
|
10
|
+
/InstalledFiles
|
11
|
+
/pkg/
|
12
|
+
/spec/reports/
|
13
|
+
/spec/examples.txt
|
14
|
+
/test/tmp/
|
15
|
+
/test/version_tmp/
|
16
|
+
/tmp/
|
17
|
+
|
18
|
+
# Used by dotenv library to load environment variables.
|
19
|
+
# .env
|
20
|
+
|
21
|
+
# Ignore Byebug command history file.
|
22
|
+
.byebug_history
|
23
|
+
|
24
|
+
## Specific to RubyMotion:
|
25
|
+
.dat*
|
26
|
+
.repl_history
|
27
|
+
build/
|
28
|
+
*.bridgesupport
|
29
|
+
build-iPhoneOS/
|
30
|
+
build-iPhoneSimulator/
|
31
|
+
|
32
|
+
## Specific to RubyMotion (use of CocoaPods):
|
33
|
+
#
|
34
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
35
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
36
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
37
|
+
# vendor/Pods/
|
38
|
+
|
39
|
+
## Documentation cache and generated files:
|
40
|
+
/.yardoc/
|
41
|
+
/_yardoc/
|
42
|
+
/doc/
|
43
|
+
/rdoc/
|
44
|
+
|
45
|
+
## Environment normalization:
|
46
|
+
/.bundle/
|
47
|
+
/vendor/bundle
|
48
|
+
/lib/bundler/man/
|
49
|
+
|
50
|
+
# for a library or gem, you might want to ignore these files since the code is
|
51
|
+
# intended to run in multiple environments; otherwise, check them in:
|
52
|
+
# Gemfile.lock
|
53
|
+
# .ruby-version
|
54
|
+
# .ruby-gemset
|
55
|
+
|
56
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
57
|
+
.rvmrc
|
58
|
+
|
59
|
+
# End of https://www.gitignore.io/api/ruby
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright © 2019 Chris Olstrom <chris@olstrom.com>
|
4
|
+
Copyright © 2019 SUSE Software Solutions
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
of this software and associated documentation files (the “Software”), to deal
|
8
|
+
in the Software without restriction, including without limitation the rights
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
11
|
+
furnished to do so, subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
14
|
+
all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
THE SOFTWARE.
|
data/README.org
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
#+TITLE: concourse-objects - Objects for Concourse
|
2
|
+
#+LATEX: \pagebreak
|
3
|
+
|
4
|
+
* Overview
|
5
|
+
|
6
|
+
~concourse-objects~ is a library for interacting with Concourse-related
|
7
|
+
concepts as Objects. It can parse and generate things like pipelines and task
|
8
|
+
definitions, and is intended to be intuitive to use and simple to extend.
|
9
|
+
|
10
|
+
* Why does this exist?
|
11
|
+
|
12
|
+
To support building more interesting tools for Concourse, like pipeline
|
13
|
+
generators, linters, etc.
|
14
|
+
|
15
|
+
* Installation
|
16
|
+
|
17
|
+
#+BEGIN_SRC shell
|
18
|
+
gem install concourse-objects
|
19
|
+
#+END_SRC
|
20
|
+
|
21
|
+
* Usage
|
22
|
+
|
23
|
+
#+BEGIN_SRC ruby
|
24
|
+
require "concourse-objects" # the main library
|
25
|
+
require "concourse-objects/resources" # (optional) supplementary library with resource-specific classes (including all official resource types)
|
26
|
+
#+END_SRC
|
27
|
+
|
28
|
+
* What's in the box?
|
29
|
+
|
30
|
+
- A collection of classes related to Concourse Pipelines, Tasks, and Resources (and more).
|
31
|
+
- Some tools for maintaining this library, including:
|
32
|
+
- A testing utility that parses a tree of samples and rewrites them. The results are intended to be inspected with =git diff=.
|
33
|
+
- A utility that checks for newer versions for resources, for human review.
|
34
|
+
|
35
|
+
* License
|
36
|
+
|
37
|
+
~concourse-objects~ is available under the [[https://tldrlegal.com/license/mit-license][MIT License]]. See ~LICENSE.txt~ for the full text.
|
38
|
+
|
39
|
+
* Contributors
|
40
|
+
|
41
|
+
- [[https://colstrom.github.io/][Chris Olstrom]] | [[mailto:chris@olstrom.com][e-mail]] | [[https://twitter.com/ChrisOlstrom][Twitter]]
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Gem::Specification.new do |gem|
|
2
|
+
tag = `git describe --tags --abbrev=0`.chomp
|
3
|
+
|
4
|
+
gem.name = 'concourse-objects'
|
5
|
+
gem.homepage = 'https://github.com/colstrom/concourse-objects'
|
6
|
+
gem.summary = 'Objects for Concourse'
|
7
|
+
|
8
|
+
gem.version = "#{tag}"
|
9
|
+
gem.licenses = ['MIT']
|
10
|
+
gem.authors = ['Chris Olstrom']
|
11
|
+
gem.email = 'chris@olstrom.com'
|
12
|
+
|
13
|
+
gem.cert_chain = ['trust/certificates/colstrom.pem']
|
14
|
+
gem.signing_key = File.expand_path ENV.fetch 'GEM_SIGNING_KEY'
|
15
|
+
|
16
|
+
gem.files = `git ls-files -z`.split("\x0")
|
17
|
+
gem.test_files = `git ls-files -z -- {test,spec,features}/*`.split("\x0")
|
18
|
+
gem.executables = `git ls-files -z -- bin/*`.split("\x0").map { |f| File.basename(f) }
|
19
|
+
|
20
|
+
gem.require_paths = ['lib']
|
21
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../concourse-objects"
|
4
|
+
|
5
|
+
module ConcourseObjects
|
6
|
+
module Resources
|
7
|
+
class BoshIORelease < Resource
|
8
|
+
RESOURCE_NAME = "bosh-io-release"
|
9
|
+
GITHUB_OWNER = "concourse"
|
10
|
+
GITHUB_REPOSITORY = "concourse/bosh-io-release-resource"
|
11
|
+
GITHUB_VERSION = "v1.0.2"
|
12
|
+
|
13
|
+
class Source < Object
|
14
|
+
required :repository, write: AsString
|
15
|
+
|
16
|
+
optional :regexp, write: AsString
|
17
|
+
end
|
18
|
+
|
19
|
+
class InParams < Object
|
20
|
+
DEFAULT_TARBALL = true
|
21
|
+
|
22
|
+
optional :tarball, write: AsBoolean, default: proc { DEFAULT_TARBALL }
|
23
|
+
end
|
24
|
+
|
25
|
+
optional :source, write: Source
|
26
|
+
|
27
|
+
def initialize(options = {})
|
28
|
+
super(options.merge(type: "bosh-io-release")) do |this, options|
|
29
|
+
yield this, options if block_given?
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../concourse-objects"
|
4
|
+
|
5
|
+
module ConcourseObjects
|
6
|
+
module Resources
|
7
|
+
class BoshIOStemcell < Resource
|
8
|
+
RESOURCE_NAME = "bosh-io-stemcell"
|
9
|
+
GITHUB_OWNER = "concourse"
|
10
|
+
GITHUB_REPOSITORY = "concourse/bosh-io-stemcell-resource"
|
11
|
+
GITHUB_VERSION = "v1.0.3"
|
12
|
+
|
13
|
+
class Source < Object
|
14
|
+
required :name, write: AsString
|
15
|
+
|
16
|
+
optional :version_family, write: AsString, default: proc { DEFAULT_VERSION_FAMILY }
|
17
|
+
optional :force_regular, write: AsBoolean, default: proc { DEFAULT_FORCE_REGULAR }
|
18
|
+
end
|
19
|
+
|
20
|
+
class InParams < Object
|
21
|
+
DEFAULT_TARBALL = true
|
22
|
+
DEFAULT_PRESERVE_FILENAME = false
|
23
|
+
|
24
|
+
optional :tarball, write: AsBoolean, default: proc { DEFAULT_TARBALL }
|
25
|
+
optional :preserve_filename, write: AsBoolean, default: proc { DEFAULT_PRESERVE_FILENAME }
|
26
|
+
end
|
27
|
+
|
28
|
+
optional :source, write: Source
|
29
|
+
|
30
|
+
def initialize(options = {})
|
31
|
+
super(options.merge(type: "bosh-io-stemcell")) do |this, options|
|
32
|
+
yield this, options if block_given?
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
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 CF < Resource
|
8
|
+
RESOURCE_NAME = "cf"
|
9
|
+
GITHUB_OWNER = "concourse"
|
10
|
+
GITHUB_REPOSITORY = "concourse/cf-resource"
|
11
|
+
GITHUB_VERSION = "v1.1.0"
|
12
|
+
|
13
|
+
class Source < Object
|
14
|
+
DEFAULT_SKIP_CERT_CHECK = false
|
15
|
+
DEFAULT_VERBOSE = false
|
16
|
+
|
17
|
+
required :api, write: AsString
|
18
|
+
required :organization, write: AsString
|
19
|
+
required :space, write: AsString
|
20
|
+
|
21
|
+
optional :username, write: AsString
|
22
|
+
optional :password, write: AsString
|
23
|
+
optional :client_id, write: AsString
|
24
|
+
optional :client_secret, write: AsString
|
25
|
+
optional :skip_cert_check, write: AsBoolean, default: proc { DEFAULT_SKIP_CERT_CHECK }
|
26
|
+
optional :verbose, write: AsBoolean, default: proc { DEFAULT_VERBOSE }
|
27
|
+
end
|
28
|
+
|
29
|
+
class OutParams < Object
|
30
|
+
DEFAULT_SHOW_APP_LOG = false
|
31
|
+
|
32
|
+
HasCurrentAppName = proc { |params| params.current_app_name? }
|
33
|
+
|
34
|
+
required :manifest, write: AsString
|
35
|
+
|
36
|
+
optional :path, write: AsString
|
37
|
+
optional :current_app_name, write: AsString
|
38
|
+
optional :docker_username, write: AsString
|
39
|
+
optional :docker_password, write: AsString
|
40
|
+
optional :no_start, write: AsBoolean, guard: HasCurrentAppName
|
41
|
+
optional :show_app_log, write: AsBoolean, default: proc { DEFAULT_SHOW_APP_LOG }
|
42
|
+
optional :vars_files, write: AsArrayOf.(:to_s), default: EmptyArray
|
43
|
+
optional :environment_variables, write: AsHashOf.(:to_s, :to_s), default: EmptyHash
|
44
|
+
optional :vars, write: AsHash, default: EmptyHash
|
45
|
+
end
|
46
|
+
|
47
|
+
optional :source, write: Source
|
48
|
+
|
49
|
+
def initialize(options = {})
|
50
|
+
super(options.merge(type: "cf")) do |this, options|
|
51
|
+
yield this, options if block_given?
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../concourse-objects"
|
4
|
+
|
5
|
+
module ConcourseObjects
|
6
|
+
module Resources
|
7
|
+
class DockerImage < Resource
|
8
|
+
RESOURCE_NAME = "docker-image"
|
9
|
+
GITHUB_OWNER = "concourse"
|
10
|
+
GITHUB_REPOSITORY = "concourse/docker-image-resource"
|
11
|
+
GITHUB_VERSION = "v1.3.1"
|
12
|
+
|
13
|
+
class Source < Object
|
14
|
+
class CACert < Object
|
15
|
+
required :domain, write: AsString
|
16
|
+
required :cert, write: AsString
|
17
|
+
end
|
18
|
+
|
19
|
+
class ClientCert < Object
|
20
|
+
required :domain, write: AsString
|
21
|
+
required :cert, write: AsString
|
22
|
+
required :key, write: AsString
|
23
|
+
end
|
24
|
+
|
25
|
+
DEFAULT_TAG = "latest"
|
26
|
+
|
27
|
+
required :repository, write: AsString
|
28
|
+
|
29
|
+
optional :ca_certs, write: AsArrayOf.(CACert), default: EmptyArray
|
30
|
+
optional :client_certs, write: AsArrayOf.(ClientCert), default: EmptyArray
|
31
|
+
optional :insecure_registries, write: AsArrayOf.(:to_s), default: EmptyArray
|
32
|
+
optional :tag, write: AsString, default: proc { DEFAULT_TAG }
|
33
|
+
optional :username, write: AsString
|
34
|
+
optional :password, write: AsString
|
35
|
+
optional :aws_access_key_id, write: AsString
|
36
|
+
optional :aws_secret_access_key, write: AsString
|
37
|
+
optional :aws_session_token, write: AsString
|
38
|
+
optional :registry_mirror, write: AsString
|
39
|
+
optional :max_concurrent_downloads, write: AsInteger
|
40
|
+
optional :max_concurrent_uploads, write: AsInteger
|
41
|
+
end
|
42
|
+
|
43
|
+
class InParams < Object
|
44
|
+
DEFAULT_SAVE = false
|
45
|
+
DEFAULT_ROOTFS = false
|
46
|
+
DEFAULT_SKIP_DOWNLOAD = false
|
47
|
+
|
48
|
+
optional :save, write: AsBoolean, default: proc { DEFAULT_SAVE }
|
49
|
+
optional :rootfs, write: AsBoolean, default: proc { DEFAULT_ROOTFS }
|
50
|
+
optional :skip_download, write: AsBoolean, default: proc { DEFAULT_SKIP_DOWNLOAD }
|
51
|
+
end
|
52
|
+
|
53
|
+
class OutParams < Object
|
54
|
+
DEFAULT_CACHE = false
|
55
|
+
DEFAULT_TAG_AS_LATEST = false
|
56
|
+
DEFAULT_LOAD_TAG = "latest"
|
57
|
+
DEFAULT_PULL_TAG = "latest"
|
58
|
+
|
59
|
+
optional :build_args, write: AsHashOf.(:to_s, :to_s), default: EmptyHash
|
60
|
+
optional :labels, write: AsHashOf.(:to_s, :to_s), default: EmptyHash
|
61
|
+
optional :cache_from, write: AsArrayOf.(:to_s), default: EmptyArray
|
62
|
+
optional :load_bases, write: AsArrayOf.(:to_s), default: EmptyArray
|
63
|
+
optional :cache, write: AsBoolean, default: proc { DEFAULT_CACHE }
|
64
|
+
optional :tag_as_latest, write: AsBoolean, default: proc { DEFAULT_TAG_AS_LATEST }
|
65
|
+
optional :load_tag, write: AsString, default: proc { DEFAULT_LOAD_TAG }
|
66
|
+
optional :pull_tag, write: AsString, default: proc { DEFAULT_PULL_TAG }
|
67
|
+
optional :additional_tags, write: AsString
|
68
|
+
optional :build, write: AsString
|
69
|
+
optional :build_args_file, write: AsString
|
70
|
+
optional :dockerfile, write: AsString
|
71
|
+
optional :import_file, write: AsString
|
72
|
+
optional :labels_file, write: AsString
|
73
|
+
optional :load, write: AsString
|
74
|
+
optional :load_base, write: AsString
|
75
|
+
optional :load_file, write: AsString
|
76
|
+
optional :load_repository, write: AsString
|
77
|
+
optional :pull_repository, write: AsString
|
78
|
+
optional :tag, write: AsString
|
79
|
+
optional :tag_file, write: AsString
|
80
|
+
optional :tag_prefix, write: AsString
|
81
|
+
optional :target_name, write: AsString
|
82
|
+
end
|
83
|
+
|
84
|
+
optional :source, write: Source
|
85
|
+
|
86
|
+
def initialize(options = {})
|
87
|
+
super(options.merge(type: "docker-image")) do |this, options|
|
88
|
+
yield this, options if block_given?
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
@@ -0,0 +1,111 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../concourse-objects"
|
4
|
+
|
5
|
+
module ConcourseObjects
|
6
|
+
module Resources
|
7
|
+
class Git < Resource
|
8
|
+
RESOURCE_NAME = "git"
|
9
|
+
GITHUB_OWNER = "concourse"
|
10
|
+
GITHUB_REPOSITORY = "concourse/git-resource"
|
11
|
+
GITHUB_VERSION = "v1.5.0"
|
12
|
+
|
13
|
+
class Source < Object
|
14
|
+
class HTTPSTunnel < Object
|
15
|
+
required :proxy_host, write: AsString
|
16
|
+
required :proxy_port, write: AsInteger
|
17
|
+
|
18
|
+
optional :proxy_user, write: AsString
|
19
|
+
optional :proxy_password, write: AsString
|
20
|
+
end
|
21
|
+
|
22
|
+
class CommitFilter < Object
|
23
|
+
optional :exclude, write: AsArrayOf.(:to_s)
|
24
|
+
optional :include, write: AsArrayOf.(:to_s)
|
25
|
+
end
|
26
|
+
|
27
|
+
DEFAULT_FORWARD_AGENT = false
|
28
|
+
DEFAULT_SKIP_SSL_VERIFICATION = false
|
29
|
+
DEFAULT_DISABLE_CI_SKIP = false
|
30
|
+
DEFAULT_GPG_KEYSERVER = "hkp://keys.gnupg.net/".freeze
|
31
|
+
|
32
|
+
required :uri, write: AsString
|
33
|
+
|
34
|
+
optional :branch, write: AsString
|
35
|
+
optional :private_key, write: AsString
|
36
|
+
optional :username, write: AsString
|
37
|
+
optional :password, write: AsString
|
38
|
+
optional :tag_filter, write: AsString
|
39
|
+
optional :git_crypt_key, write: AsString
|
40
|
+
optional :gpg_keyserver, write: AsString, default: proc { DEFAULT_GPG_KEYSERVER }
|
41
|
+
optional :forward_agent, write: AsBoolean, default: proc { DEFAULT_FORWARD_AGENT }
|
42
|
+
optional :skip_ssl_verification, write: AsBoolean, default: proc { DEFAULT_SKIP_SSL_VERIFICATION }
|
43
|
+
optional :disable_ci_skip, write: AsBoolean, default: proc { DEFAULT_DISABLE_CI_SKIP }
|
44
|
+
optional :paths, write: AsArrayOf.(:to_s), default: EmptyArray
|
45
|
+
optional :ignore_paths, write: AsArrayOf.(:to_s), default: EmptyArray
|
46
|
+
optional :commit_verification_keys, write: AsArrayOf.(:to_s), default: EmptyArray
|
47
|
+
optional :commit_verification_key_ids, write: AsArrayOf.(:to_s), default: EmptyArray
|
48
|
+
optional :git_config, write: AsHashOf.(:to_s, :to_s), default: EmptyHash
|
49
|
+
optional :https_tunnel, write: HTTPSTunnel
|
50
|
+
optional :commit_filter, write: CommitFilter
|
51
|
+
end
|
52
|
+
|
53
|
+
class InParams < Object
|
54
|
+
DEFAULT_SUBMODULE_RECURSIVE = true
|
55
|
+
DEFAULT_SUBMODULE_REMOTE = false
|
56
|
+
DEFAULT_DISABLE_GIT_LFS = false
|
57
|
+
DEFAULT_CLEAN_TAGS = false
|
58
|
+
DEFAULT_SHORT_REF_FORMAT = "%s"
|
59
|
+
ACCEPTABLE_SUBMODULES = ["none", "all", Array]
|
60
|
+
|
61
|
+
SubmodulesAreAcceptable = proc { |_, submodules| ACCEPTABLE_SUBMODULES.any? { |as| as === submodules } }
|
62
|
+
ValueIsPositive = proc { |_, value| value.positive? }
|
63
|
+
|
64
|
+
optional :depth, write: AsInteger, guard: ValueIsPositive
|
65
|
+
optional :submodules, guard: SubmodulesAreAcceptable
|
66
|
+
optional :submodule_recursive, write: AsBoolean, default: proc { DEFAULT_SUBMODULE_RECURSIVE }
|
67
|
+
optional :submodule_remote, write: AsBoolean, default: proc { DEFAULT_SUBMODULE_REMOTE }
|
68
|
+
optional :disable_git_lfs, write: AsBoolean, default: proc { DEFAULT_DISABLE_GIT_LFS }
|
69
|
+
optional :clean_tags, write: AsBoolean, default: proc { DEFAULT_CLEAN_TAGS }
|
70
|
+
optional :short_ref_format, write: AsString, default: proc { DEFAULT_SHORT_REF_FORMAT }
|
71
|
+
end
|
72
|
+
|
73
|
+
class OutParams < Object
|
74
|
+
DEFAULT_REBASE = false
|
75
|
+
DEFAULT_MERGE = false
|
76
|
+
DEFAULT_ONLY_TAG = false
|
77
|
+
DEFAULT_FORCE = false
|
78
|
+
DEFAULT_RETURNING = "merged"
|
79
|
+
ACCEPTABLE_RETURNING = ["merged", "unmerged"]
|
80
|
+
|
81
|
+
ReturningIsAcceptable = proc { |params, returning| params.merge and ACCEPTABLE_RETURNING.include?(returning) }
|
82
|
+
|
83
|
+
required :repository, write: AsString
|
84
|
+
|
85
|
+
optional :rebase, write: AsBoolean, default: proc { DEFAULT_REBASE }
|
86
|
+
optional :merge, write: AsBoolean, default: proc { DEFAULT_MERGE }
|
87
|
+
optional :returning, write: AsString, default: proc { DEFAULT_RETURNING }, guard: ReturningIsAcceptable
|
88
|
+
optional :tag, write: AsString
|
89
|
+
optional :only_tag, write: AsBoolean, default: proc { DEFAULT_ONLY_TAG }
|
90
|
+
optional :tag_prefix, write: AsString
|
91
|
+
optional :force, write: AsBoolean, default: proc { DEAULT_FORCE }
|
92
|
+
optional :annotate, write: AsString
|
93
|
+
optional :notes, write: AsString
|
94
|
+
|
95
|
+
def initialize(options = {})
|
96
|
+
super(options)
|
97
|
+
super(options) do |this, options|
|
98
|
+
raise KeyError, "expected one of (rebase || merge), got both" if [:rebase, :merge].all? { |key| options.key?(key) }
|
99
|
+
yield this, options if block_given?
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
optional :source, write: Source
|
105
|
+
|
106
|
+
def initialize(options = {})
|
107
|
+
super(options.merge(type: "git"))
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../concourse-objects"
|
4
|
+
|
5
|
+
module ConcourseObjects
|
6
|
+
module Resources
|
7
|
+
class GitHubRelease < Resource
|
8
|
+
RESOURCE_NAME = "github-release"
|
9
|
+
GITHUB_OWNER = "concourse"
|
10
|
+
GITHUB_REPOSITORY = "concourse/github-release-resource"
|
11
|
+
GITHUB_VERSION = "v1.1.1"
|
12
|
+
|
13
|
+
class Source < Object
|
14
|
+
DEFAULT_INSECURE = false
|
15
|
+
DEFAULT_RELEASE = true
|
16
|
+
DEFAULT_PRE_RELEASE = false
|
17
|
+
DEFAULT_DRAFTS = false
|
18
|
+
DEFAULT_TAG_FILTER = "v?([^v].*)"
|
19
|
+
DEFAULT_ORDER_BY = "version"
|
20
|
+
|
21
|
+
ACCEPTABLE_ORDER_BYS = ["version", "time"]
|
22
|
+
|
23
|
+
OrderByIsAcceptable = proc { |_, order_by| ACCEPTABLE_ORDER_BYS.include?(order_by) }
|
24
|
+
|
25
|
+
required :owner, write: AsString
|
26
|
+
required :repository, write: AsString
|
27
|
+
|
28
|
+
optional :access_token, write: AsString
|
29
|
+
optional :github_api_url, write: AsString
|
30
|
+
optional :github_uploads_url, write: AsString
|
31
|
+
optional :order_by, write: AsString, default: proc { DEFAULT_ORDER_BY }, guard: OrderByIsAcceptable
|
32
|
+
optional :tag_filter, write: AsString, default: proc { DEFAULT_TAG_FILTER }
|
33
|
+
optional :insecure, write: AsBoolean, default: proc { DEFAULT_INSECURE }
|
34
|
+
optional :release, write: AsBoolean, default: proc { DEFAULT_RELEASE }
|
35
|
+
optional :pre_release, write: AsBoolean, default: proc { DEFAULT_PRE_RELEASE }
|
36
|
+
optional :drafts, write: AsBoolean, default: proc { DEFAULT_DRAFTS }
|
37
|
+
|
38
|
+
def initialize(options = {})
|
39
|
+
options.transform_keys(&:to_sym).then do |options|
|
40
|
+
unless options.key?(:owner)
|
41
|
+
options.store(:owner, options.fetch(:user)) if options.key?(:user)
|
42
|
+
end
|
43
|
+
|
44
|
+
super(options) do |this, options|
|
45
|
+
yield this, options if block_given?
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
class InParams < Object
|
52
|
+
DEFAULT_INCLUDE_SOURCE_TARBALL = false
|
53
|
+
DEFAULT_INCLUDE_SOURCE_ZIP = false
|
54
|
+
|
55
|
+
optional :include_source_tarball, write: AsBoolean, default: proc { DEFAULT_INCLUDE_SOURCE_TARBALL }
|
56
|
+
optional :include_source_zip, write: AsBoolean, default: proc { DEFAULT_INCLUDE_SOURCE_ZIP }
|
57
|
+
optional :globs, write: AsArrayOf.(:to_s)
|
58
|
+
end
|
59
|
+
|
60
|
+
class OutParams < Object
|
61
|
+
required :name, write: AsString
|
62
|
+
required :type, write: AsString
|
63
|
+
|
64
|
+
optional :tag_prefix, write: AsString
|
65
|
+
optional :commitish, write: AsString
|
66
|
+
optional :body, write: AsString
|
67
|
+
optional :globs, write: AsArrayOf.(:to_s)
|
68
|
+
end
|
69
|
+
|
70
|
+
optional :source, write: Source
|
71
|
+
|
72
|
+
def initialize(options = {})
|
73
|
+
super(options.merge(type: "github-release")) do |this, options|
|
74
|
+
yield this, options if block_given?
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../concourse-objects"
|
4
|
+
|
5
|
+
module ConcourseObjects
|
6
|
+
module Resources
|
7
|
+
class Hg < Resource
|
8
|
+
RESOURCE_NAME = "hg"
|
9
|
+
GITHUB_OWNER = "concourse"
|
10
|
+
GITHUB_REPOSITORY = "concourse/hg-resource"
|
11
|
+
GITHUB_VERSION = "v1.0.2"
|
12
|
+
|
13
|
+
class Source < Object
|
14
|
+
DEFAULT_BRANCH = "default"
|
15
|
+
DEFAULT_SKIP_SSL_VERIFICATION = false
|
16
|
+
|
17
|
+
required :uri, write: AsString
|
18
|
+
|
19
|
+
optional :private_key, write: AsString
|
20
|
+
optional :tag_filter, write: AsString
|
21
|
+
optional :revset_filter, write: AsString
|
22
|
+
optional :branch, write: AsString, default: proc { DEFAULT_BRANCH }
|
23
|
+
optional :skip_ssl_verification, write: AsBoolean, default: proc { DEFAULT_SKIP_SSL_VERIFICATION }
|
24
|
+
optional :paths, write: AsArrayOf.(:to_s), default: EmptyArray
|
25
|
+
optional :ignore_paths, write: AsArrayOf.(:to_s), default: EmptyArray
|
26
|
+
end
|
27
|
+
|
28
|
+
class OutParams < Object
|
29
|
+
DEFAULT_REBASE = false
|
30
|
+
|
31
|
+
required :repository, write: AsString
|
32
|
+
|
33
|
+
optional :tag_prefix, write: AsString
|
34
|
+
optional :tag, write: AsString, guard: proc { |params| params.rebase? }
|
35
|
+
optional :rebase, write: AsBoolean, default: proc { DEFAULT_REBASE }
|
36
|
+
|
37
|
+
def initialize(options = {})
|
38
|
+
super(options)
|
39
|
+
super(options) do |this, options|
|
40
|
+
yield this, options if block_given?
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
optional :source, write: Source
|
46
|
+
|
47
|
+
def initialize(options = {})
|
48
|
+
super(options.merge(type: "hg")) do |this, options|
|
49
|
+
yield this, options if block_given?
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|