Commit eae1e861 authored by Łukasz Nowak's avatar Łukasz Nowak

deploy-test: Allow to use local slapos clone

Also expose location of playbook.
parent 471e6927
...@@ -20,6 +20,7 @@ command = ...@@ -20,6 +20,7 @@ command =
if [ ! -d srv/public ] ; then if [ ! -d srv/public ] ; then
dest=`echo ../*/srv/public` dest=`echo ../*/srv/public`
cp ${playbook:output} $dest/playbook.tar.gz && cp ${playbook:output} $dest/playbook.tar.gz &&
cp ${slapos-tarball:output} $dest/slapos.tar.gz &&
cp ${standalone-local-playbook:location} $dest/standalone-local-playbook cp ${standalone-local-playbook:location} $dest/standalone-local-playbook
fi fi
......
...@@ -6,6 +6,7 @@ parts = ...@@ -6,6 +6,7 @@ parts =
template-deploy-test template-deploy-test
runTestSuite_py runTestSuite_py
playbook playbook
slapos-tarball
[runTestSuite_py] [runTestSuite_py]
recipe = zc.recipe.egg recipe = zc.recipe.egg
...@@ -25,21 +26,29 @@ command = ...@@ -25,21 +26,29 @@ command =
ln -s ${buildout:bin-directory}/pythonwitheggs ${:location}/python2.7 ln -s ${buildout:bin-directory}/pythonwitheggs ${:location}/python2.7
update-command = ${:command} update-command = ${:command}
[playbook] [tarball]
recipe = plone.recipe.command recipe = plone.recipe.command
location = ${buildout:parts-directory}/${:_buildout_section_name_}
stop-on-error = true stop-on-error = true
environment = export PATH=${tar:location}/bin:${gzip:location}/bin:$PATH environment = export PATH=${tar:location}/bin:${gzip:location}/bin:$PATH
location = ${buildout:parts-directory}/${:_buildout_section_name_}
output = ${:location}/playbook.tar.gz
command = command =
${:environment} ${:environment}
rm -fr ${:location} rm -fr ${:location}
mkdir -p ${:location} mkdir -p ${:location}
cd ${slapos-package:location}/playbook cd ${:input}
tar czf ${:output} . tar czf ${:output} .
update-command = ${:command} update-command = ${:command}
[playbook]
<= tarball
input = ${slapos-package:location}/playbook
output = ${:location}/playbook.tar.gz
[slapos-tarball]
<= tarball
input = ${slapos-repository:repository}
output = ${:location}/slapos.tar.gz
[test-location] [test-location]
base = ${slapos-package:location} base = ${slapos-package:location}
......
...@@ -2178,6 +2178,7 @@ fi ...@@ -2178,6 +2178,7 @@ fi
sed -i "s/key = slapos-global-key/key = slapos-global-official-vifib-key/g" /etc/opt/slapcache.cfg sed -i "s/key = slapos-global-key/key = slapos-global-official-vifib-key/g" /etc/opt/slapcache.cfg
DFILE="/tmp/tmpplaybook_unstable$(basename $0).$$/" DFILE="/tmp/tmpplaybook_unstable$(basename $0).$$/"
PLAYBOOK_DIRECTORY=$DFILE
TFILE="archive.tar.gz" TFILE="archive.tar.gz"
mkdir -p $DFILE mkdir -p $DFILE
cd $DFILE cd $DFILE
...@@ -2185,7 +2186,16 @@ wget -O $TFILE http://10.0.2.100/playbook.tar.gz ...@@ -2185,7 +2186,16 @@ wget -O $TFILE http://10.0.2.100/playbook.tar.gz
tar -xzvf $TFILE tar -xzvf $TFILE
rm $TFILE rm $TFILE
DFILE="/test/slapos/"
TFILE="archive.tar.gz"
mkdir -p $DFILE
cd $DFILE
wget -O $TFILE http://10.0.2.100/slapos.tar.gz
tar -xzvf $TFILE
rm $TFILE
clear clear
echo "Starting Ansible playbook:" echo "Starting Ansible playbook:"
cd $PLAYBOOK_DIRECTORY
ansible-playbook $TEST_YML_PATH -i hosts --connection=local ansible-playbook $TEST_YML_PATH -i hosts --connection=local
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment