Bug 766413

Summary: 2. Client workflow automation - push an updated spec to the server
Product: [Community] PressGang CCMS Reporter: Joshua Wulf <jwulf>
Component: CSProcessorAssignee: Joshua Wulf <jwulf>
Status: CLOSED DUPLICATE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.xCC: jwulf, lcarlon
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-23 08:31:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 766406, 766411    
Bug Blocks: 766412    

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 ***