Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #4203 (closed)

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

[SCM] Write fetch script for bf git

Reported by: jamoore Owned by: jamoore
Priority: minor Milestone: OMERO-Beta4.3
Component: General Version: n.a.
Keywords: n.a. Cc: mlinkert, cxallan
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: 0.0d
Sprint: 2011-02-10 (5)

Description

To have fetched sha1s from bf.git added to trac, a wrapper script will be necessary.

Change History (5)

comment:1 Changed 9 years ago by jmoore

  • Status changed from new to accepted

comment:2 Changed 9 years ago by jmoore

  • Status changed from accepted to new

comment:3 Changed 9 years ago by jmoore

  • Status changed from new to assigned

comment:4 Changed 9 years ago by jmoore

  • Cc mlinkert-x added
  • Remaining Time changed from 0.25 to 0
  • Resolution set to fixed
  • Status changed from assigned to closed

Simple script put into place which will be called by hudson (alias jenkins). If anything goes wrong, the BIOFORMATS-sync build will start failing. Otherwise, each run of git-fetch.sh (caused by a POST to the BIOFORMATS-sync job from a post-receive hook on the loci git) will invoke /hudson/bioformats.git/hooks/post-receive hook to make this copy act like it were being pushed to directly.

Script:

hudson@necromancer ~/bioformats.git $ cat git-fetch.sh 
# Script ended to fetch from a remote repository
# into a bare repository and perform some action
# for all the named updated branches

set -e

# CONFIGURATION

action() {
  cat - | hooks/post-receive
}


for branch in master 4_2 4_1; do

  BEFORE=`git rev-list -n 1 $branch`

  if test -z "$VERBOSE"; then
    FETCH_MESSAGE=`git fetch origin +$branch:$branch 2>&1`
  else
    git fetch origin +$branch:$branch
  fi

  AFTER=`git rev-list -n 1 $branch`
  if [ "$BEFORE" != "$AFTER" ]; then
    echo $BEFORE $AFTER refs/heads/$branch | action
  fi

done

This does not handle pushes which reset the branch, but that is unlikely for the primary develop branches. We will need to add the dev branches when they are added.

comment:5 Changed 9 years ago by jmoore

  • Cc cxallan added

Note: to make this work, I disabled the check for status in (Ticket.ACCEPTED, Ticket.ASSIGNED) in omero_svn_hooks.py because otherwise the fetch may fail, preventing a build just because the ticket was not properly marked. (This check was a bit annoying anyway).

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.86847 sec.)

We're Hiring!