Skip to content

Commit 42866cd

Browse files
Now detect and properly cast attribute
1 parent c4b2f02 commit 42866cd

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,19 @@ Lastly, if you override the `app_name` configuration in your Shipit deployment,
134134

135135
* * *
136136

137+
<h3 id="respecting-bare-files">Respecting bare <code>shipit.yml</code> files</h3>
138+
139+
Shipit will, by default, respect the "bare" <code>shipit.yml</code> file as a fallback option if no more specifically-named file exists (such as <code>shipit.staging.yml</code>).
140+
141+
You can configure this behavior via the attribute <code>Shipit.respect_bare_shipit_file</code>.
142+
143+
- The value <code>false</code> will disable this behavior and instead cause Shipit to emit an error upon deploy if Shipit cannot find a more specifically-named file.
144+
- Setting this attribute to any other value (**including <code>nil</code>**), or not setting this attribute, will cause Shipit to use the default behavior of respecting bare <code>shipit.yml</code> files.
145+
146+
You can determine if Shipit is configured to respect bare files using <code>Shipit.respect_bare_shipit_file?</code>.
147+
148+
* * *
149+
137150
<h3 id="installing-dependencies">Installing dependencies</h3>
138151

139152
The **<code>dependencies</code>** step allows you to install all the packages your deploy script needs.

lib/shipit.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ module Shipit
6969
:preferred_org_emails,
7070
:task_execution_strategy,
7171
:task_logger,
72+
:respect_bare_shipit_file,
7273
)
7374

7475
def task_execution_strategy
@@ -235,6 +236,13 @@ def task_logger
235236
@task_logger ||= Logger.new(nil)
236237
end
237238

239+
def respect_bare_shipit_file
240+
@respect_bare_shipit_file = true if @respect_bare_shipit_file.nil?
241+
!!@respect_bare_shipit_file
242+
end
243+
244+
alias_method :respect_bare_shipit_file?, :respect_bare_shipit_file
245+
238246
protected
239247

240248
def revision_file

0 commit comments

Comments
 (0)