Commit 6773a434 authored by Vincent Pelletier's avatar Vincent Pelletier Committed by Sebastien Robin

Stop using "git pull" and meaningless identity when updating.

We are never supposed to merge anything. We are supposed to just follow
upstream. pull merges, so it's just the wrong tool.
Instead, fetch and reset.
It is not a problem to always reset, as user already cannot rely on
repository's survival across updates: if there is any error reported by
git command, the repository will be wiped out. So resetting will not do
any more harm than what can already happen.
Also, properly quote paths to protect against spaces (in both command and
update-command).
parent 5a854172
...@@ -29,8 +29,8 @@ stop-on-error = true ...@@ -29,8 +29,8 @@ stop-on-error = true
branch = erp5-component branch = erp5-component
revision = revision =
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
command = ${git:location}/bin/git clone --branch ${:branch} --quiet http://git.erp5.org/repos/slapos.git ${:location} && if [ -n "${:revision}" ]; then cd ${:location} && ${git:location}/bin/git reset --quiet --hard ${:revision} ; fi command = "{git:location}/bin/git" clone --branch "${:branch}" --quiet http://git.erp5.org/repos/slapos.git "${:location}" && if [ -n "${:revision}" ]; then cd "${:location}" && "${git:location}/bin/git" reset --quiet --hard "${:revision}" ; fi
update-command = cd ${:location} && GIT_COMMITTER_EMAIL=nobody@example.com GIT_AUTHOR_NAME=Nobody GIT_AUTHOR_EMAIL=nobody@example.com ${git:location}/bin/git pull --quiet && if [ -n "${:revision}" ]; then echo "Resetting." ; cd ${:location} && ${git:location}/bin/git reset --hard ${:revision} ; fi update-command = cd "${:location}" && "${git:location}/bin/git" fetch --quiet && if [ -n "${:revision}" ]; then "${git:location}/bin/git" reset --hard "${:revision}"; else; "${git:location}/bin/git" reset --quiet --hard @{upstream} ; fi
[check-recipe] [check-recipe]
recipe = plone.recipe.command recipe = plone.recipe.command
......
...@@ -27,8 +27,8 @@ command = grep parts ${buildout:develop-eggs-directory}/slapos.cookbook.egg-link ...@@ -27,8 +27,8 @@ command = grep parts ${buildout:develop-eggs-directory}/slapos.cookbook.egg-link
recipe = plone.recipe.command recipe = plone.recipe.command
stop-on-error = true stop-on-error = true
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
command = git clone -b erp5scalabilitytestbed --quiet http://git.erp5.org/repos/slapos.git ${:location} command = git clone -b erp5scalabilitytestbed --quiet http://git.erp5.org/repos/slapos.git "${:location}"
update-command = cd ${:location} && git pull --quiet update-command = cd "${:location}" && git fetch --quiet && git reset --hard @{upstream}
[eggs] [eggs]
dummy = ${slapos.cookbook:location} dummy = ${slapos.cookbook:location}
......
...@@ -60,8 +60,8 @@ unzip = true ...@@ -60,8 +60,8 @@ unzip = true
recipe = plone.recipe.command recipe = plone.recipe.command
stop-on-error = true stop-on-error = true
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
command = ${git:location}/bin/git clone --quiet http://git.erp5.org/repos/slapos.git ${:location} command = "${git:location}/bin/git" clone --quiet http://git.erp5.org/repos/slapos.git "${:location}"
update-command = cd ${:location} && ${git:location}/bin/git pull --quiet update-command = cd "${:location}" && "${git:location}/bin/git" fetch --quiet && "${git:location}/bin/git" reset --hard @{upstream}
[check-recipe] [check-recipe]
recipe = plone.recipe.command recipe = plone.recipe.command
......
...@@ -38,8 +38,8 @@ command = grep parts ${buildout:develop-eggs-directory}/slapos.cookbook.egg-link ...@@ -38,8 +38,8 @@ command = grep parts ${buildout:develop-eggs-directory}/slapos.cookbook.egg-link
recipe = plone.recipe.command recipe = plone.recipe.command
stop-on-error = true stop-on-error = true
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
command = ${git:location}/bin/git clone -b nosqltestbed --quiet http://git.erp5.org/repos/slapos.git ${:location} command = "${git:location}/bin/git" clone -b nosqltestbed --quiet http://git.erp5.org/repos/slapos.git "${:location}"
update-command = cd ${:location} && ${git:location}/bin/git pull --quiet update-command = cd "${:location}" && "${git:location}/bin/git" fetch --quiet && "${git:location}/bin/git" reset --hard @{upstream}
[eggs] [eggs]
dummy = ${slapos.cookbook:location} dummy = ${slapos.cookbook:location}
......
...@@ -98,8 +98,8 @@ git_param =--quiet -b pulse ...@@ -98,8 +98,8 @@ git_param =--quiet -b pulse
git = ${git:location}/bin/git git = ${git:location}/bin/git
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
stop-on-error = true stop-on-error = true
command = ${:git} clone ${:git_param} http://git.erp5.org/repos/slapos.git ${:location} || exit 1; command = "${:git}" clone ${:git_param} http://git.erp5.org/repos/slapos.git "${:location}" || exit 1;
update-command = cd ${:location} && ${git:location}/bin/git pull --quiet update-command = cd "${:location}" && "${:git}" fetch --quiet && "${:git}" reset --hard @{upstream}
[instance-recipe-egg] [instance-recipe-egg]
recipe = zc.recipe.egg recipe = zc.recipe.egg
......
...@@ -34,8 +34,8 @@ command = grep parts ${buildout:develop-eggs-directory}/slapos.cookbook.egg-link ...@@ -34,8 +34,8 @@ command = grep parts ${buildout:develop-eggs-directory}/slapos.cookbook.egg-link
recipe = plone.recipe.command recipe = plone.recipe.command
stop-on-error = true stop-on-error = true
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
command = ${git:location}/bin/git clone -b testnode --quiet http://git.erp5.org/repos/slapos.git ${:location} command = "${git:location}/bin/git" clone -b testnode --quiet http://git.erp5.org/repos/slapos.git "${:location}"
update-command = cd ${:location} && ${git:location}/bin/git pull --quiet update-command = cd "${:location}" && "${git:location}/bin/git" fetch --quiet && "${git:location}/bin/git" reset --hard @{upstream}
[template] [template]
recipe = slapos.recipe.template recipe = slapos.recipe.template
......
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