aboutsummaryrefslogtreecommitdiffstats
path: root/aai-traversal/src/main/resources/docker/init-chef.sh
diff options
context:
space:
mode:
authorVenkata Harish K Kajur <vk250x@att.com>2017-09-18 10:33:06 -0400
committerVenkata Harish K Kajur <vk250x@att.com>2017-09-18 10:33:13 -0400
commit277be05aa962be97bed336acaafb808185fd20e9 (patch)
tree65b13a1b2492172ab3268ed21ad840f01bb5acce /aai-traversal/src/main/resources/docker/init-chef.sh
parent741ca84296546a70ae1ad204b1b6ee4940eecfe7 (diff)
Modify dockerfile to use common docker image
In order to decrease image size as well as decrease the build time of docker image everyday Issue-ID: AAI-219 Change-Id: I6c5aea3672a24f0512ef95eead32b04b642400e9 Signed-off-by: Venkata Harish K Kajur <vk250x@att.com>
Diffstat (limited to 'aai-traversal/src/main/resources/docker/init-chef.sh')
-rw-r--r--aai-traversal/src/main/resources/docker/init-chef.sh30
1 files changed, 26 insertions, 4 deletions
diff --git a/aai-traversal/src/main/resources/docker/init-chef.sh b/aai-traversal/src/main/resources/docker/init-chef.sh
index 112b0b3..0e10055 100644
--- a/aai-traversal/src/main/resources/docker/init-chef.sh
+++ b/aai-traversal/src/main/resources/docker/init-chef.sh
@@ -25,8 +25,30 @@
#
##############################################################################
-#echo "AAI_CHEF_ENV=${AAI_CHEF_ENV}" >> /etc/environment
-#echo "AAI_CHEF_LOC=${AAI_CHEF_LOC}" >> /etc/environment
-#touch /root/.bash_profile
-chef-solo -c /var/chef/aai-data/chef-config/dev/.knife/solo.rb -j /var/chef/aai-config/cookbooks/runlist-app-server.json -E ${AAI_CHEF_ENV}
+cd /var/chef;
+if [ ! -d "aai-config" ]; then
+
+ git clone --depth 1 -b ${CHEF_BRANCH} --single-branch ${CHEF_CONFIG_GIT_URL}/${CHEF_CONFIG_REPO}.git aai-config || {
+ echo "Error: Unable to clone the aai-config repo with url: ${CHEF_GIT_URL}/${CHEF_CONFIG_REPO}.git";
+ exit;
+ }
+
+ (cd aai-config/cookbooks/aai-traversal/ && \
+ for f in $(ls); do mv $f ../; done && \
+ cd ../ && rmdir aai-traversal);
+fi
+
+if [ ! -d "aai-data" ]; then
+
+ git clone --depth 1 -b ${CHEF_BRANCH} --single-branch ${CHEF_DATA_GIT_URL}/aai-data.git aai-data || {
+ echo "Error: Unable to clone the aai-data repo with url: ${CHEF_GIT_URL}";
+ exit;
+ }
+
+ chef-solo \
+ -c /var/chef/aai-data/chef-config/dev/.knife/solo.rb \
+ -j /var/chef/aai-config/cookbooks/runlist-aai-traversal.json \
+ -E ${AAI_CHEF_ENV};
+
+fi