Bug 766413 - 2. Client workflow automation - push an updated spec to the server
Summary: 2. Client workflow automation - push an updated spec to the server
Keywords:
Status: CLOSED DUPLICATE of bug 796009
Alias: None
Product: PressGang CCMS
Classification: Community
Component: CSProcessor
Version: 1.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Joshua Wulf
QA Contact:
URL:
Whiteboard:
Depends On: 766406 766411
Blocks: 766412
TreeView+ depends on / blocked
 
Reported: 2011-12-12 01:32 UTC by Joshua Wulf
Modified: 2014-10-19 22:59 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-03-23 08:31:31 UTC
Embargoed:


Attachments (Terms of Use)

Description Joshua Wulf 2011-12-12 01:32:48 UTC
Here's the script:

#!/bin/bash

SKYNETCLIENTCMD="java -jar /home/jwulf/Skynet/skynet.jar"
DIR=`pwd`
CONFFILE=csprocessor.cfg

  if [ ! -f $CONFFILE ]
  then
    echo "Cannot find $CONFFILE. Exiting."
    exit 2
  else
    source $CONFFILE
  fi

  if [ -z "$SPECID" ]
  then 
     echo "Please set a value for SPECID in $CONFFILE"
     exit 3
  fi

  if [ -z "$SPECNAME" ]
  then 
     echo "Please set a value for SPECNAME in $CONFFILE"
     exit 3
  fi

$SKYNETCLIENTCMD push -ce post-$SPECNAME.spec
---------------------------------------------------------

Put this into somewhere like ~/skynet/updateremote
edit the SKYNETCLIENTCMD to point to your installation of the skynet client
chmod 755 updateremote
add an alias to ~/.bashrc:
  alias updateremote='~/skynet/updateremote'
reload your environment:
  source ~/.bashrc

Now when you run "updateremote" in a directory with a csprocessor.cfg and a post-<SPECNAME>.spec, the local spec file will be pushed to the server.

Comment 1 Joshua Wulf 2011-12-12 01:33:31 UTC
Requires the csprocessor.cfg file described in bug 766406

Comment 2 Joshua Wulf 2011-12-12 01:36:19 UTC
The obvious thing to do now is to chain this with the refreshlocal command (see bug 766408), however, we can't reliably tell whether the push was successful or not until bug 766411 is fixed.

So for now, verify manually that the push was successful, then run refreshlocal to update your local copy of the content spec with the latest revision from the server.

Comment 3 Joshua Wulf 2012-02-20 05:59:37 UTC
 bug 766411 is fixed, and so here is a script that synchronises your local spec file on a push. It currently requires the absolute path to the refreshlocal script, so change that parameter in the script for your configuration.



#!/bin/bash

SKYNETCLIENTCMD="csprocessor"
DIR=`pwd`
CONFFILE=csprocessor.cfg
REFRESHLOCAL="/home/jwulf/skynet/refreshlocal"

  if [ ! -f $CONFFILE ]
  then
    echo "Cannot find $CONFFILE. Exiting."
    exit 2
  else
    source $CONFFILE
  fi

  if [ -z "$SPECID" ]
  then 
     echo "Please set a value for SPECID in $CONFFILE"
     exit 3
  fi

  if [ -z "$SPECNAME" ]
  then 
     echo "Please set a value for SPECNAME in $CONFFILE"
     exit 3
  fi

$SKYNETCLIENTCMD push -ce post-$SPECNAME.spec
  
  if [ $? = 0 ]
    then
      echo "Refreshing local copy"	
      $REFRESHLOCAL
  fi

Comment 4 Joshua Wulf 2012-03-23 08:31:31 UTC
Functionality implemented by 796009

*** This bug has been marked as a duplicate of bug 796009 ***


Note You need to log in before you can comment on or make changes to this bug.