Initial OpenECOMP MSO commit
[so.git] / packages / docker / src / main / docker / docker-files / scripts / init-chef.sh
1 #!/bin/sh
2 # Copyright 2015 AT&T Intellectual Properties
3 ##############################################################################
4 #       Script to initialize the chef-repo branch and.chef
5 #
6 ##############################################################################
7
8 set -x
9 cd /tmp/git/
10 export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=false -i ~/user"
11 git clone -b ${BRANCH_NAME:-master} --single-branch ssh://${REPO_USERNAME}@${REPO_ADDRESS}/${CHEF_REPO_NAME}.git
12
13
14 # Will have to be removed later
15 #mkdir -p /var/chef/nodes
16 sed "s/CHEF_REPO_NAME_TO_REPLACE/${CHEF_REPO_NAME}/g" -i /tmp/git/solo.rb
17 mv /tmp/git/solo.rb /tmp/git/${CHEF_REPO_NAME}/
18 cd /tmp/git/${CHEF_REPO_NAME}
19
20 echo "Vendor cookbooks with Berkshelf"
21 berks vendor /var/berks-cookbooks -b Berksfile.mso-docker
22
23 # Execute the ChefClient to configure the mso-config
24 echo "Update config with chef solo"
25 chef-solo -c /var/berks-cookbooks/${CHEF_REPO_NAME}/solo.rb -o recipe[mso-config::apih],recipe[mso-config::bpmn],recipe[mso-config::jra]