jvanzyl     2004/05/09 17:21:09

  Added:       maven-meeper/src/bin cron.txt deploy-bundle deploy-jar
                        deploy-lic deploy-pom sync-apache
  Log:
  o scripts for deploying bundles
  
  Revision  Changes    Path
  1.1                  maven-components/maven-meeper/src/bin/cron.txt
  
  Index: cron.txt
  ===================================================================
  # use /bin/sh to run commands, no matter what /etc/passwd says
  SHELL=/bin/sh
  
  # mail any output to `paul', no matter whose crontab this is
  MAILTO=mdiggory
   
  # run 23 minutes after midn, 4am, 8am ..., everyday
  0 0-23/4 * * * /export/sunsite/users/mdiggory/bin/sync-apache
  
  
  
  1.1                  maven-components/maven-meeper/src/bin/deploy-bundle
  
  Index: deploy-bundle
  ===================================================================
  #!/bin/sh
  
  # Deploy JAR to the repository
  # $1 : artifact to copy
  # $2 : project id
  
  BUNDLE=$1
  
  [ "${BUNDLE}" = "" ] && echo && echo "You must specify a bundle!" && echo && exit
  
  WORKDIR=bundle.tmp
  
  rm -rf $WORKDIR > /dev/null 2>&1
  
  mkdir $WORKDIR
  
  cp $BUNDLE $WORKDIR
  
  (
    cd $WORKDIR
  
    jar xf $BUNDLE
  
    POM=project.xml
  
    [ ! -f ${POM} ] && echo && echo "Cannot deploy without the project.xml file!" && 
echo && exit
  
    version=`cat ${POM} | tr '\n' ' ' | sed 's#<versions>.*</versions>##' | sed 
's#<dependencies>.*</dependencies>##' | grep '<version>' | sed -e 
's#^.*<version>##;s#</version>.*$##'`
  
    if [ -z $version ]
    then
      version=`grep currentVersion ${POM} | sed -e 's/^ 
*//;s/<currentVersion>//;s/<\/currentVersion>//'`
    fi
  
    artifactId=`cat ${POM} | tr '\n' ' ' | sed 's#<dependencies>.*</dependencies>##' | 
grep '<artifactId>' | sed -e 's#^.*<artifactId>##;s#</artifactId>.*$##'`
  
    if [ -z $artifactId ]
    then
      artifactId=`cat ${POM} | tr '\n' ' ' | sed 's#<versions>.*</versions>##' | sed 
's#<developers>.*</developers>##' | sed 's#<dependencies>.*</dependencies>##' | grep 
'<id>' | sed -e 's#^.*<id>##;s#</id>.*$##'`
    fi
    
    groupId=`cat ${POM} | tr '\n' ' ' | sed 's#<dependencies>.*</dependencies>##' | 
grep '<groupId>' | sed -e 's#^.*<groupId>##;s#</groupId>.*$##'`  
  
    if [ -z $groupId ]
    then
      groupId=${artifactId}
    fi
  
    echo "   version: ${version}"  
    echo "   groupId: ${groupId}"  
    echo "artifactId: ${artifactId}" 
  
    [ ! -f LICENSE.txt ] && echo && echo "Cannot deploy without the LICENSE.txt file!" 
&& echo && exit
  
    cp project.xml ${artifactId}-${version}.pom
  
    deploy-lic LICENSE.txt ${groupId}
    
    deploy-pom ${artifactId}-${version}.pom ${groupId}
    
    deploy-jar ${artifactId}-${version}.jar ${groupId}
  )  
  
  
  
  1.1                  maven-components/maven-meeper/src/bin/deploy-jar
  
  Index: deploy-jar
  ===================================================================
  #!/bin/sh
  
  # Deploy JAR to the repository
  # $1 : artifact to copy
  # $2 : project id
  
  ARTIFACT=$1
  ID=$2
  ARTIFACT_TYPE=jars
  REPO=login.ibiblio.org
  DIR=/public/html/maven/${ID}/${ARTIFACT_TYPE}
  
  echo ${DIR}
  
  # Make sure the target directory is present.
  ssh $REPO "mkdir -p ${DIR}"
  
  # Copy the artifact to the repository.
  scp $ARTIFACT ${REPO}:${DIR}
  
  # Make sure the perms are correct. Just in case
  ssh $REPO "chmod 664 ${DIR}/${ARTIFACT}; chgrp maven ${DIR}/${ARTIFACT}; cd ${DIR}; 
md5sum ${ARTIFACT} | sed 's/ .*$//' > ${ARTIFACT}.md5; chgrp maven ${ARTIFACT}.md5"
  
  
  
  1.1                  maven-components/maven-meeper/src/bin/deploy-lic
  
  Index: deploy-lic
  ===================================================================
  #!/bin/sh
  
  # Deploy JAR to the repository
  # $1 : artifact to copy
  # $2 : project id
  
  ARTIFACT=$1
  ID=$2
  ARTIFACT_TYPE=licenses
  REPO=login.ibiblio.org
  DIR=/public/html/maven/${ID}/${ARTIFACT_TYPE}
  
  echo ${DIR}
  
  # Make sure the target directory is present.
  ssh $REPO "mkdir -p ${DIR}"
  
  # Copy the artifact to the repository.
  scp $ARTIFACT ${REPO}:${DIR}
  
  # Make sure the perms are correct. Just in case
  ssh $REPO "chmod 664 ${DIR}/${ARTIFACT}; chgrp maven ${DIR}/${ARTIFACT}; cd ${DIR}; 
md5sum ${ARTIFACT} | sed 's/ .*$//' > ${ARTIFACT}.md5; chgrp maven ${ARTIFACT}.md5"
  
  
  
  1.1                  maven-components/maven-meeper/src/bin/deploy-pom
  
  Index: deploy-pom
  ===================================================================
  #!/bin/sh
  
  # Copy DIST to the repository
  # $1 : artifact to copy
  # $2 : project id
  
  ARTIFACT=$1
  ID=$2
  ARTIFACT_TYPE=poms
  REPO=login.ibiblio.org
  DIR=/public/html/maven/${ID}/${ARTIFACT_TYPE}
  
  echo ${DIR}
  
  # Make sure the target directory is present.
  ssh $REPO "mkdir -p ${DIR}"
  
  # Copy the artifact to the repository.
  scp $ARTIFACT ${REPO}:${DIR}
  
  # Make sure the perms are correct. Just in case
  ssh $REPO "chmod 664 ${DIR}/${ARTIFACT}; chgrp maven ${DIR}/${ARTIFACT}; cd ${DIR}; 
md5sum ${ARTIFACT} | sed 's/ .*$//' > ${ARTIFACT}.md5"
  
  
  
  1.1                  maven-components/maven-meeper/src/bin/sync-apache
  
  Index: sync-apache
  ===================================================================
  #!/bin/sh
  
  umask 002
  
  rsync -rvl --size-only www.apache.org::apache-dist/java-repository/ 
/public/html/maven
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to