Bug 1088705 - Deploy script: Generate revision file before rsyncing it

Previously the revision file was regenerated after it had already been
rsynced to the webheads, and as such the publicly accessible file
displayed the previous revision, not the new revision.
This commit is contained in:
Ed Morley 2015-03-01 19:24:38 +00:00
Родитель d011d2f9bd
Коммит 0e67ca47a4
1 изменённых файлов: 12 добавлений и 17 удалений

Просмотреть файл

@ -24,16 +24,27 @@ env_flag = '-p' if is_prod else '-s'
@task
def pre_update(ctx, ref=settings.UPDATE_REF):
# Update the code to a specific git reference (branch/tag/sha)
# Update the code to a specific git reference (branch/tag/sha) and write
# info about the current repository state to a publicly visible file.
with ctx.lcd(th_service_src):
ctx.local('git fetch --quiet origin %s' % ref)
ctx.local('git reset --hard FETCH_HEAD')
ctx.local("find . -type f -name '*.pyc' -delete")
ctx.local('date')
ctx.local('git branch')
ctx.local('git log -3')
ctx.local('git status')
ctx.local('git rev-parse HEAD > treeherder/webapp/media/revision')
with ctx.lcd(th_ui_src):
ctx.local('git fetch --quiet origin %s' % ref)
ctx.local('git reset --hard FETCH_HEAD')
ctx.local("find . -type f -name '*.pyc' -delete")
ctx.local('date')
ctx.local('git branch')
ctx.local('git log -3')
ctx.local('git status')
ctx.local('git rev-parse HEAD >> ../treeherder-service/treeherder/webapp/media/revision')
@task
@ -101,19 +112,3 @@ def deploy(ctx):
deploy_log()
restart_jobs(ctx, 'log')
with ctx.lcd(th_service_src):
# Write info about the current repository state to a publicly visible file.
ctx.local('date')
ctx.local('git branch')
ctx.local('git log -3')
ctx.local('git status')
ctx.local('git rev-parse HEAD > treeherder/webapp/media/revision')
with ctx.lcd(th_ui_src):
# Write info about the current repository state to a publicly visible file.
ctx.local('date')
ctx.local('git branch')
ctx.local('git log -3')
ctx.local('git status')
ctx.local('git rev-parse HEAD >> ../treeherder-service/treeherder/webapp/media/revision')