Skip to content

Commit

Permalink
Add feature flag to skip upload of cookbook to supermarket
Browse files Browse the repository at this point in the history
  • Loading branch information
jlundqvist-criteo committed May 24, 2023
1 parent 60dd7ab commit e9d364c
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/checkstyle-idea.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/cookbook-release.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Optional environment variables:

```
export COOKBOOK_CATEGORY="Other" # defaults to Other
export SKIP_COOKOOK_UPLOAD=true #Just prepare release and push tag to git, but don't upload
```

Note: this setup is intended to be used in a CI system such as jenkins or travis.
Expand Down
1 change: 1 addition & 0 deletions lib/cookbook-release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def define_tasks(namespaced)
opts = {
no_prompt: ENV['NO_PROMPT'],
category: ENV['COOKBOOK_CATEGORY'],
skip_upload: ENV['SKIP_COOKOOK_UPLOAD']
}
git = GitUtilities.new
Release.new(git, opts).release!
Expand Down
3 changes: 2 additions & 1 deletion lib/cookbook-release/release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class ExistingRelease < StandardError
def initialize(git, opts={})
@git = git
@no_prompt = opts[:no_prompt]
@skip_upload = opts[:skip_upload]
@git.no_prompt = @no_prompt
@category = opts[:category] || 'Other'
end
Expand Down Expand Up @@ -108,7 +109,7 @@ def release!
exit 1 unless agreed
git.push_tag(new_version)
supermarket = Supermarket.new
supermarket.publish_ck(@category, git.sub_dir)
supermarket.publish_ck(@category, git.sub_dir) unless @skip_upload
rescue
puts HighLine.color("Release aborted, you have to reset to previous state manually", :red)
puts ":use with care: #{git.reset_command(new_version)}"
Expand Down

0 comments on commit e9d364c

Please sign in to comment.