Class: Buildizer::Ci::Base
- Inherits:
-
Object
- Object
- Buildizer::Ci::Base
- Defined in:
- lib/buildizer/ci/base.rb
Instance Attribute Summary collapse
-
#buildizer ⇒ Object
readonly
Returns the value of attribute buildizer.
Class Method Summary collapse
Instance Method Summary collapse
- #_git_tag ⇒ Object
- #buildizer_install_instructions(master: nil) ⇒ Object
- #ci_name ⇒ Object
- #conf ⇒ Object
- #conf_file_name ⇒ Object
- #conf_path ⇒ Object
- #configuration_actual! ⇒ Object
- #configuration_actual? ⇒ Boolean
- #docker_cache_setup! ⇒ Object
- #git_tag ⇒ Object
-
#initialize(buildizer) ⇒ Base
constructor
A new instance of Base.
- #package_cloud_setup! ⇒ Object
- #setup! ⇒ Object
Constructor Details
#initialize(buildizer) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 |
# File 'lib/buildizer/ci/base.rb', line 6 def initialize(buildizer) super() @buildizer = buildizer end |
Instance Attribute Details
#buildizer ⇒ Object (readonly)
Returns the value of attribute buildizer.
4 5 6 |
# File 'lib/buildizer/ci/base.rb', line 4 def buildizer @buildizer end |
Class Method Details
.ci_name ⇒ Object
72 73 74 |
# File 'lib/buildizer/ci/base.rb', line 72 def ci_name raise end |
Instance Method Details
#_git_tag ⇒ Object
45 46 47 |
# File 'lib/buildizer/ci/base.rb', line 45 def _git_tag raise end |
#buildizer_install_instructions(master: nil) ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/buildizer/ci/base.rb', line 49 def buildizer_install_instructions(master: nil) if master ['git clone https://github.com/flant/buildizer ~/buildizer', 'echo "export BUNDLE_GEMFILE=~/buildizer/Gemfile" | tee -a ~/.bashrc', 'export BUNDLE_GEMFILE=~/buildizer/Gemfile', 'gem install bundler', 'gem install overcommit', 'bundle install', ] else 'gem install buildizer' end end |
#ci_name ⇒ Object
24 25 26 |
# File 'lib/buildizer/ci/base.rb', line 24 def ci_name self.class.ci_name end |
#conf ⇒ Object
12 13 14 |
# File 'lib/buildizer/ci/base.rb', line 12 def conf @conf ||= conf_path.load_yaml end |
#conf_file_name ⇒ Object
20 21 22 |
# File 'lib/buildizer/ci/base.rb', line 20 def conf_file_name ".#{ci_name}.yml" end |
#conf_path ⇒ Object
16 17 18 |
# File 'lib/buildizer/ci/base.rb', line 16 def conf_path buildizer.package_path.join(conf_file_name) end |
#configuration_actual! ⇒ Object
36 37 38 |
# File 'lib/buildizer/ci/base.rb', line 36 def configuration_actual! raise Error, message: "#{ci_name} confugration update needed" unless configuration_actual? end |
#configuration_actual? ⇒ Boolean
32 33 34 |
# File 'lib/buildizer/ci/base.rb', line 32 def configuration_actual? raise end |
#docker_cache_setup! ⇒ Object
67 68 69 |
# File 'lib/buildizer/ci/base.rb', line 67 def docker_cache_setup! raise end |
#git_tag ⇒ Object
40 41 42 43 |
# File 'lib/buildizer/ci/base.rb', line 40 def git_tag res = _git_tag.to_s if res.empty? then nil else res end end |
#package_cloud_setup! ⇒ Object
63 64 65 |
# File 'lib/buildizer/ci/base.rb', line 63 def package_cloud_setup! raise end |
#setup! ⇒ Object
28 29 30 |
# File 'lib/buildizer/ci/base.rb', line 28 def setup! raise end |