<commit_before>#
# Copyright 2014 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name "supermarket-cookbooks"

dependency "berkshelf"
dependency "cacerts"

source path: "cookbooks/omnibus-supermarket"

build do
  cookbooks_path = "#{install_dir}/embedded/cookbooks"
  env = with_standard_compiler_flags(with_embedded_path)

  # FIXME: Berks fails here:
  # /opt/supermarket/embedded/lib/ruby/2.1.0/net/http.rb:920:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
  #
  # Tried:
  #
  # * Setting the SSL_CERT_FILE environment variable to the cacert.pem dependency
  #   in that softawre
  # * Creating .berkshelf/config.json in the cookbook with ssl verify false
  #
  # Haven't tried outside of vagrant/kitchen, so it could be specific to one
  # of those.
  #
  # It's failing on the "enterprise" dependency in
  # cookbooks/omnibus-supermarket/Berksfile, which is open source on GitHub.
  # Same failure happens if I use http:// or git://.
  #
  # We weren't seeing this when we were using berkshelf2, but we switched to
  # 3 because we're using 3 in the cookbook itself, and the file size issues are
  # much better now, and 2 is deprecated.
  #
  #command "berks vendor --path=#{cookbooks_path}", env: env
  #
  # Do this instead for now, so the directory is there:
  mkdir cookbooks_path

  block do<commit_msg>Switch back to `berks vendor` now that `cacerts` is locked<commit_after>#
# Copyright 2014 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name "supermarket-cookbooks"

dependency "berkshelf"

source path: "cookbooks/omnibus-supermarket"

build do
  cookbooks_path = "#{install_dir}/embedded/cookbooks"
  env = with_standard_compiler_flags(with_embedded_path)

  command "berks vendor #{cookbooks_path}", env: env

  block do
{'fraction_non_alphanumeric': 0.08286908077994429, 'fraction_numerical': 0.0100974930362117, 'mean_word_length': 4.233151183970856, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1546663', 'n_tokens_mistral': 877, 'n_tokens_neox': 832, 'n_words': 344}