<commit_before>#! /bin/bash -e
cd ~
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical
APT_GET="sudo apt-get -y"

$APT_GET install ruby-mime-types

mkdir .chef
cat - > .chef/knife.rb <<EOF
log_level                :info
log_location             STDOUT
node_name                'chef-webui'
client_key               '$HOME/.chef/chef-webui.pem'
validation_client_name   'chef-validator'
validation_key           '$HOME/.chef/chef-validator.pem'
chef_server_url          'http://localhost:4000'  
cache_type               'BasicFile'
cache_options( :path => '$HOME/.chef/checksums' )
cookbook_path [ '$HOME/cookbooks' ]
EOF

sudo cp /etc/chef/webui.pem .chef/chef-webui.pem
sudo chown `whoami` .chef/chef-webui.pem

wget http://public.fewbytes.com/cloudify-travel-cookbooks.tar.gz
wget http://public.fewbytes.com/cloudify-travel-roles.tar.gz
tar -xzf cloudify-travel-cookbooks.tar.gz
tar -xzf cloudify-travel-roles.tar.gz

knife cookbook upload -a
for role in roles/*.rb; do
    knife role from file $role
done<commit_msg>get cookbook and roles from github<commit_after>#! /bin/bash -e
cd ~

#TODO: move these into chef recipe so that the script is cross platform
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical
APT_GET="sudo apt-get -y"

$APT_GET install ruby-mime-types git

mkdir .chef
cat - > .chef/knife.rb <<EOF
log_level                :info
log_location             STDOUT
node_name                'chef-webui'
client_key               '$HOME/.chef/chef-webui.pem'
validation_client_name   'chef-validator'
validation_key           '$HOME/.chef/chef-validator.pem'
chef_server_url          'http://localhost:4000'  
cache_type               'BasicFile'
cache_options( :path => '$HOME/.chef/checksums' )
cookbook_path [ '$HOME/cookbooks' ]
EOF

sudo cp /etc/chef/webui.pem .chef/chef-webui.pem
sudo chown `whoami` .chef/chef-webui.pem

git clone https://github.com/CloudifySource/cloudify-recipes.git
ln -s $HOME/cloudify-recipes/application-recipes/travel-chef/cookbooks $HOME/cookbooks

knife cookbook upload -a
for role in $HOME/cloudify-recipes/travel-chef/roles/*.rb; do
    knife role from file $role
done
{'fraction_non_alphanumeric': 0.11451089476124246, 'fraction_numerical': 0.0037088548910523874, 'mean_word_length': 3.1420345489443378, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, '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': '6001687', 'n_tokens_mistral': 814, 'n_tokens_neox': 778, 'n_words': 163}