Skip to content
Snippets Groups Projects
build.sh 5.17 KiB
Newer Older
  • Learn to ignore specific revisions
  • Lucia Morganti's avatar
    Lucia Morganti committed
    #!/bin/sh -x
    
    dn=$(dirname $0)
    if [ "${dn}" = "." ]; then
      echo "Run the build in a subdirectory or in an out-of-source directory"
      exit 1
    fi
    
    topdir=$(readlink -f ${dn})
    builddir=$(readlink -f .)
    papersdir=${builddir}/papers
    latex_templates=${topdir}/instructions/LaTeXTemplates.zip
    
    die() {
        echo >&2 "$1"
        exit 1
    }
    
    build_from_source() {
        local project project_dir main_tex_file other_files bib_file ok
        project_dir="$1"
        project=$(echo ${project_dir} | tr '/' '_')
        main_tex_file="$2"
        [ -f "${topdir}/contributions/${project_dir}/${main_tex_file}" ] || die "invalid call to build_from_source()"
        shift; shift;
        other_files="$@"
    
        if [ ! -d ${project_dir} ]; then
    	mkdir -p ${project_dir}
    	cd ${project_dir}
    
    	cp ${topdir}/contributions/${project_dir}/${main_tex_file} ./${project}.tex \
    	    && for f in ${other_files}; do \
    	           cp -a ${topdir}/contributions/${project_dir}/${f} .; done \
    	    && unzip ${latex_templates} \
    	    && pdflatex ${project} \
    	    && if grep bibdata ${project}.aux; then
    	           unzip -j BibTeX/iopart-num.zip iopart-num/iopart-num.bst
    		   bibtex ${project}
    		   pdflatex ${project}
    	       fi \
    	    && pdflatex ${project} \
    	    && ln -sf ${builddir}/${project_dir}/${project}.pdf ${papersdir}
    
    	cd -
        fi
    }
    
    link_pdf() {
        local project project_dir pdf_file
        project_dir="$1"
        project=$(echo ${project_dir} | tr '/' '_')
        pdf_file="$2"
        [ -f "${topdir}/contributions/${project_dir}/${pdf_file}" ] || die "invalid call to link_pdf()"
    
        ln -s "${topdir}/contributions/${project_dir}/${pdf_file}" ${papersdir}/${project}.pdf
    }
    
    if [ ! -d ${papersdir} ]; then
        mkdir -p ${papersdir}
    fi
    
    cd ${builddir}
    
    # prepare cover
    #link_pdf cover cover.pdf
    #link_pdf experiment experiment.pdf
    #link_pdf datacenter datacenter.pdf
    #link_pdf research research.pdf
    #link_pdf transfer transfer.pdf
    #link_pdf additional additional.pdf
    
    
    Lucia Morganti's avatar
    Lucia Morganti committed
    build_from_source user-support main.tex *.PNG
    
    Lucia Morganti's avatar
    Lucia Morganti committed
    #build_from_source ams ams.tex  AMS_nuovo.pdf  contributors.pdf  He-MC.pdf  He-MC.tiff  input_output.jpg  production_jobs.jpg
    #build_from_source alice alice.tex *.png *.eps
    #build_from_source atlas    atlas.tex
    #build_from_source borexino borexino.tex
    #build_from_source cms report-cms-feb-2018.tex cms-jobs.eps tier-1-sr-2017.eps
    #build_from_source cosa      cosa.tex  biblio.bib beegfs.PNG
    #build_from_source cnprov cnprov.tex
    #build_from_source cta      cta.tex  *.eps
    #build_from_source cuore    cnaf_cuore.tex cnaf_cuore.bib
    #build_from_source cupid    cupid.tex cupid.bib 
    #link_pdf dampe    dampe.pdf
    #link_pdf darkside ds.pdf
    #build_from_source eee eee.tex  EEEarch.eps  EEEmonitor.eps  EEEtracks.png  ELOGquery.png  request.png
    #build_from_source exanest   exanest.tex  biblio.bib monitoring.PNG storage.png
    
    Elisabetta Ronchieri's avatar
    Elisabetta Ronchieri committed
    build_from_source test TEST.tex  test.eps
    
    Lucia Morganti's avatar
    Lucia Morganti committed
    #build_from_source fazia fazia.tex
    #build_from_source gerda    gerda.tex *.pdf
    #build_from_source glast 	glast.tex 
    #link_pdf juno juno.pdf
    
    Lucia Morganti's avatar
    Lucia Morganti committed
    build_from_source km3net km3net.tex compmodel.png  threetier.png
    
    Fornari's avatar
    Fornari committed
    build_from_source newchim repnewchim18.tex fig1.png
    
    Lucia Morganti's avatar
    Lucia Morganti committed
    #build_from_source lhcb lhcb.tex *.jpg
    #build_from_source lhcf  lhcf.tex
    #build_from_source limadou  limadou.tex
    #build_from_source lowcostdev lowcostdev.tex *.jpg
    #build_from_source lspe lspe.tex biblio.bib lspe_data_path.pdf
    
    build_from_source virgo AdV_computing_CNAF.tex
    
    Lucia Morganti's avatar
    Lucia Morganti committed
    
    
    Lucia Morganti's avatar
    Lucia Morganti committed
    #build_from_source mw-esaco     mw-esaco.tex *.png
    #build_from_source mw-kube      mw-kube.tex
    #build_from_source mw-cdmi-storm mw-cdmi-storm.tex *.png *.jpeg
    #build_from_source mw-software  mw-software.tex
    #build_from_source mw-iam       mw-iam.tex
    
    #build_from_source na62	 na62.tex
    #link_pdf padme padme.pdf
    #build_from_source xenon xenon.tex  xenon-computing-model.pdf
    #build_from_source sysinfo  sysinfo.tex pres_rundeck.png deploy_grafana.png
    #link_pdf virgo VirgoComputing.pdf
    
    #build_from_source tier1 tier1.tex
    #build_from_source flood theflood.tex *.png
    #build_from_source farming farming.tex
    #build_from_source dynfarm dynfarm.tex 
    #build_from_source storage storage.tex *.png Huawei_rack.JPG
    #build_from_source seagate seagate.tex biblio.bib  *.png *.jpg
    #build_from_source dataclient dataclient.tex
    #build_from_source ltpd ltpd.tex *.png
    #build_from_source net net.tex *.png
    #build_from_source ssnn1 ssnn.tex *.jpg
    #build_from_source ssnn2 vmware.tex *.JPG *.jpg
    
    #build_from_source infra Chiller.tex  chiller-location.png
    
    #build_from_source cloud_cnaf cloud_cnaf.tex *.png
    #build_from_source srp SoftRel.tex ar2017.bib
    #build_from_source st StatMet.tex sm2017.bib
    
    Doina Cristina Duma's avatar
    Doina Cristina Duma committed
    build_from_source ds_eoscpilot ds_eoscpilot.tex 
    build_from_source ds_eoschub ds_eoschub.tex 
    build_from_source ds_cloud_c ds_cloud_c.tex 
    build_from_source ds_infn_cc ds_infn_cc.tex 
    build_from_source ds_devops_pe ds_devops_pe.tex 
    
    Lucia Morganti's avatar
    Lucia Morganti committed
    #build_from_source cloud_b cloud_b.tex *.png *.jpg
    #build_from_source cloud_c cloud_c.tex *.png *.pdf
    #build_from_source cloud_d cloud_d.tex *.png 
    
    Doina Cristina Duma's avatar
    Doina Cristina Duma committed
    build_from_source sdds-xdc sdds-xdc.tex *.png
    build_from_source sdds-deep sdds-deep.tex *.png
    
    Lucia Morganti's avatar
    Lucia Morganti committed
    
    #build_from_source pett pett.tex bibliopett.bib
    #build_from_source iso iso.tex 27001.png  biblioiso.bib
    
    pdflatex ${topdir}/cnaf-annual-report-2018.tex \
    && pdflatex ${topdir}/cnaf-annual-report-2018.tex 2> /dev/null \
    && pdflatex ${topdir}/cnaf-annual-report-2018.tex 2> /dev/null