diff --git a/build.gradle b/build.gradle index 4ef14c7791..37ccf5c6ed 100755 --- a/build.gradle +++ b/build.gradle @@ -13,6 +13,7 @@ apply plugin: 'groovy' apply from: 'agr.gradle' apply from: 'console.gradle' + //apply from: file('setupTestsReports.gradle') sourceCompatibility = 17 @@ -51,6 +52,7 @@ project.ext.set("dbname", dbname) project.ext.set("sourceroot", sourceroot) project.ext.set("pgdata", pgdata) project.ext.set("pgbindir", pgbindir) +project.ext.set("targetroot", targetroot) task loadDatabase() { doLast { @@ -222,116 +224,117 @@ def translateVariableSet = [ //Other def whitelistTemplateFiles = [ - '**/CreateMarkerSearchPage.sql', //server_apps/data_transfer/ExternalSearch - '**/CreateMarkerSearchPage.pl', - '**/OMIM.pl', //server_apps/data_transfer/OMIM - '**/loadOMIM.sql', - '**/NCBIStartEnd.pl', //server_apps/data_transfer/NCBIStartEnd - '**/gpad.pl', //server_apps/data_transfer/GO - '**/gofile2_all.sql', - '**/gofile.sql', - '**/gofile2.sql', - '**/gpad2.0.sql', - '**/go.pl', - '**/gp2protein.pl', - '**/validateUniprotIDsZFIN.pl', - '**/checkRNAConsequenceTerm.groovy', //server_apps/data_transfer/maintainTermDisplay - '**/insert_eco_go_map.sql', //server_apps/data_transfer/eco_go_mapping - '**/zfishbook.pl', //server_apps/data_transfer/zfishbook - '**/preprocess_zfishbook.pl', - '**/zfishbook.sh', - '**/sp_load.sql', //server_apps/data_transfer/SWISS-PROT - '**/load_protein_domain_info.sql', - '**/sp_load_ec2gopart.sql', - '**/referenceProteome.sql', - '**/sp_delete_ec2gopart.sql', - '**/loadTranscriptSequences.sql', //server_apps/data_transfer/RNACentral - '**/runTscriptSequenceLoad.pl', - '**/loadTscriptSeq.pl', - '**/preLoadTranscriptSequence.sql', - '**/blast_withdrawn.pl', //server_apps/data_transfer/Load - '**/generate_special_Sanger_uniprot_nomenclature_run.sh', //server_apps/data_transfer/Load/ReNo/Nomenclature - '**/load_run_report_hit.sh', //server_apps/data_transfer/Load/ReNo - '**/fetch_ensembl_agp.sh', //server_apps/data_transfer/Ensembl - '**/notifyStaleIds.sh', - '**/fetch_ensdarT_dbacc.sh', - '**/fetch_sangerMutantInfo.sh', - '**/reportEnsembleStatistics.sh', - '**/pullFromBioMart.pl', - '**/fetch_ensdarg.sh', - '**/fetch_ensdargOttdargTable.sh', - '**/loadNewSNPs.sql', //server_apps/data_transfer/SNP - '**/loadNewSNPAttrs.sql', - '**/addNewClonesJSmith.pl', - '**/addTalbotSNPAttr.sql', - '**/dbSNP.pl', - '**/parseObo.pl', //server_apps/data_transfer/LoadOntology - '**/parseHeader.pl', - '**/meow.pl', //server_apps/data_transfer/MEOW - '**/insertJournalAlias.sql', //server_apps/data_transfer/PUBMED/Journal - '**/checkAndUpdateJournals.sql', - '**/load_complete_author_names.sql', //server_apps/data_transfer/PUBMED - '**/loadNewPubs.sql', - '**/updatePublicationDate.groovy', - '**/pubActivation.groovy', - '**/addMeshTermsToAllPubs.groovy', - '**/addPMCidsToAllPubs.groovy', - '**/gbaccession.pl', //server_apps/data_transfer/Genbank - '**/loadHumanSynonyms.sql', //server_apps/data_transfer/ORTHO - '**/updateZebrafishGeneNames.sql', - '**/runOrthology.pl', - '**/emailOrthologyReports.pl', - '**/reportOrthoNameChanges.pl', - '**/parseOrthoFile.pl', - '**/downloadFiles.pl', - '**/parseHumanData.pl', - '**/updateZebrafishGeneNames.pl', - '**/loadAndUpdateNCBIOrthologs.sql', - '**/E_unload_ensembl_contig.sql', //server_apps/data_transfer/Downloads/GFF3 - '**/pullFromEZRC.pl', //server_apps/data_transfer/ResourceCenters - '**/pushToZirc.sql', - '**/pullFromZIRC.pl', - '**/pushToZirc.pl', - '**/fx_permission_check.pl', //server_apps/DB_maintenance - '**/loadExternalNotes.pl', - '**/checkVarcharOctetLength.pl', - '**/loadExternalNotes.sql', - '**/disable_updates.pl', - '**/set_unload_timestamp.sql', - '**/rotateInformixLog.sh', - '**/check_undefined_environment.pl', - '**/pushDataToPublic.sh', - '**/backupBlastDbsAndRsyncAlmostBlastDbs.sh', - '**/compareTables.groovy', //server_apps/DB_maintenance/postgres - '**/dailyExtentCheck.sh', //server_apps/DB_maintenance/extentMonitoring - '**/dailyQueryCostCheck.sh', //server_apps/DB_maintenance/queryMonitoring - '**/regenExpressionMart.sh', //server_apps/DB_maintenance/warehouse - '**/who_is.sh', - '**/regenPhenotypeMart.sh', - '**/regenChromosomeMart.sh', - '**/who_is_not.sh', - '**/switch.sh', - '**/runPhenotypeMart.sh', //server_apps/DB_maintenance/warehouse/phenotypeMart - '**/runExpressionMart.sh', //server_apps/DB_maintenance/warehouse/expressionMart - '**/runChromosomeMart.sh', //server_apps/DB_maintenance/warehouse/chromosomeMartPostgres - '**/rsync.pl', //server_apps/DB_maintenance/loadUp - '**/README_loadUp', - '**/signsoflife.sh', //server_apps/WebSiteTools - '**/gen-meetings-rss.r', - '**/gen-jobs-rss.r', - '**/gen-news-rss.r', - '**/inc-redirect', //server_apps/apache - '**/crontab.production', //server_apps/cron - '**/elsevier_report.pl', //server_apps/Reports - '**/reportPubsForGeneAndFeature.pl', - '**/runStats.sh', //server_apps/Reports/AnnualStats - '**/betterFish.sql', //server_apps/Reports/BetterFish - '**/runAverageTimeInBinsCumulative.sh', //server_apps/Reports/PubTracking - '**/runLongestBinResidents.sh', - '**/runPaperlessPubTrackingDailyIndexedMetrics.sh', - '**/runMonthlyBinLengthReport.sh', + 'cgi-bin/send_request.perl', + 'cgi-bin/merge_markers.pl', + 'server_apps/DB_maintenance/backupBlastDbsAndRsyncAlmostBlastDbs.sh', + 'server_apps/DB_maintenance/checkVarcharOctetLength.pl', + 'server_apps/DB_maintenance/check_undefined_environment.pl', + 'server_apps/DB_maintenance/disable_updates.pl', + 'server_apps/DB_maintenance/extentMonitoring/dailyExtentCheck.sh', + 'server_apps/DB_maintenance/fx_permission_check.pl', + 'server_apps/DB_maintenance/loadExternalNotes.pl', + 'server_apps/DB_maintenance/loadExternalNotes.sql', + 'server_apps/DB_maintenance/loadUp/README_loadUp', + 'server_apps/DB_maintenance/loadUp/rsync.pl', + 'server_apps/DB_maintenance/orphanChecks.pl', + 'server_apps/DB_maintenance/postgres/compareTables.groovy', + 'server_apps/DB_maintenance/pushDataToPublic.sh', + 'server_apps/DB_maintenance/queryMonitoring/dailyQueryCostCheck.sh', + 'server_apps/DB_maintenance/rotateInformixLog.sh', + 'server_apps/DB_maintenance/set_unload_timestamp.sql', + 'server_apps/DB_maintenance/warehouse/chromosomeMartPostgres/runChromosomeMart.sh', + 'server_apps/DB_maintenance/warehouse/expressionMart/runExpressionMart.sh', + 'server_apps/DB_maintenance/warehouse/phenotypeMart/runPhenotypeMart.sh', + 'server_apps/DB_maintenance/warehouse/regenChromosomeMart.sh', + 'server_apps/DB_maintenance/warehouse/regenExpressionMart.sh', + 'server_apps/DB_maintenance/warehouse/regenPhenotypeMart.sh', + 'server_apps/DB_maintenance/warehouse/switch.sh', + 'server_apps/DB_maintenance/warehouse/who_is.sh', + 'server_apps/DB_maintenance/warehouse/who_is_not.sh', + 'server_apps/Reports/AnnualStats/runStats.sh', + 'server_apps/Reports/BetterFish/betterFish.sql', + 'server_apps/Reports/PubTracking/runAverageTimeInBinsCumulative.sh', + 'server_apps/Reports/PubTracking/runLongestBinResidents.sh', + 'server_apps/Reports/PubTracking/runMonthlyBinLengthReport.sh', + 'server_apps/Reports/PubTracking/runPaperlessPubTrackingDailyIndexedMetrics.sh', + 'server_apps/Reports/elsevier_report.pl', + 'server_apps/Reports/reportPubsForGeneAndFeature.pl', + 'server_apps/WebSiteTools/gen-jobs-rss.r', + 'server_apps/WebSiteTools/gen-meetings-rss.r', + 'server_apps/WebSiteTools/gen-news-rss.r', + 'server_apps/WebSiteTools/signsoflife.sh', + 'server_apps/apache/inc-redirect', + 'server_apps/cron/crontab.production', + 'server_apps/data_transfer/Downloads/GFF3/E_unload_ensembl_contig.sql', + 'server_apps/data_transfer/Downloads/generateStagedAnatomy.pl', + 'server_apps/data_transfer/Ensembl/fetch_ensdarT_dbacc.sh', + 'server_apps/data_transfer/Ensembl/fetch_ensdarg.sh', + 'server_apps/data_transfer/Ensembl/fetch_ensdargOttdargTable.sh', + 'server_apps/data_transfer/Ensembl/fetch_ensembl_agp.sh', + 'server_apps/data_transfer/Ensembl/fetch_sangerMutantInfo.sh', + 'server_apps/data_transfer/Ensembl/notifyStaleIds.sh', + 'server_apps/data_transfer/Ensembl/pullFromBioMart.pl', + 'server_apps/data_transfer/Ensembl/reportEnsembleStatistics.sh', + 'server_apps/data_transfer/ExternalSearch/CreateMarkerSearchPage.pl', + 'server_apps/data_transfer/ExternalSearch/CreateMarkerSearchPage.sql', + 'server_apps/data_transfer/GO/go.pl', + 'server_apps/data_transfer/GO/gofile.sql', + 'server_apps/data_transfer/GO/gofile2.sql', + 'server_apps/data_transfer/GO/gofile2_all.sql', + 'server_apps/data_transfer/GO/gp2protein.pl', + 'server_apps/data_transfer/GO/gpad.pl', + 'server_apps/data_transfer/GO/gpad2.0.sql', + 'server_apps/data_transfer/GO/validateUniprotIDsZFIN.pl', + 'server_apps/data_transfer/Genbank/gbaccession.pl', + 'server_apps/data_transfer/Load/ReNo/Nomenclature/generate_special_Sanger_uniprot_nomenclature_run.sh', + 'server_apps/data_transfer/Load/ReNo/load_run_report_hit.sh', + 'server_apps/data_transfer/Load/blast_withdrawn.pl', + 'server_apps/data_transfer/LoadOntology/parseHeader.pl', + 'server_apps/data_transfer/LoadOntology/parseObo.pl', + 'server_apps/data_transfer/MEOW/meow.pl', + 'server_apps/data_transfer/NCBIStartEnd/NCBIStartEnd.pl', + 'server_apps/data_transfer/OMIM/OMIM.pl', + 'server_apps/data_transfer/OMIM/loadOMIM.sql', + 'server_apps/data_transfer/ORTHO/downloadFiles.pl', + 'server_apps/data_transfer/ORTHO/emailOrthologyReports.pl', + 'server_apps/data_transfer/ORTHO/loadAndUpdateNCBIOrthologs.sql', + 'server_apps/data_transfer/ORTHO/loadHumanSynonyms.sql', + 'server_apps/data_transfer/ORTHO/parseHumanData.pl', + 'server_apps/data_transfer/ORTHO/parseOrthoFile.pl', + 'server_apps/data_transfer/ORTHO/reportOrthoNameChanges.pl', + 'server_apps/data_transfer/ORTHO/runOrthology.pl', + 'server_apps/data_transfer/ORTHO/updateZebrafishGeneNames.pl', + 'server_apps/data_transfer/ORTHO/updateZebrafishGeneNames.sql', + 'server_apps/data_transfer/PUBMED/Journal/checkAndUpdateJournals.sql', + 'server_apps/data_transfer/PUBMED/Journal/insertJournalAlias.sql', + 'server_apps/data_transfer/PUBMED/addMeshTermsToAllPubs.groovy', + 'server_apps/data_transfer/PUBMED/addPMCidsToAllPubs.groovy', + 'server_apps/data_transfer/PUBMED/loadNewPubs.sql', + 'server_apps/data_transfer/PUBMED/load_complete_author_names.sql', + 'server_apps/data_transfer/PUBMED/pubActivation.groovy', + 'server_apps/data_transfer/PUBMED/updatePublicationDate.groovy', + 'server_apps/data_transfer/RNACentral/loadTranscriptSequences.sql', + 'server_apps/data_transfer/RNACentral/loadTscriptSeq.pl', + 'server_apps/data_transfer/RNACentral/preLoadTranscriptSequence.sql', + 'server_apps/data_transfer/RNACentral/runTscriptSequenceLoad.pl', + 'server_apps/data_transfer/ResourceCenters/pullFromEZRC.pl', + 'server_apps/data_transfer/ResourceCenters/pullFromZIRC.pl', + 'server_apps/data_transfer/ResourceCenters/pushToZirc.pl', + 'server_apps/data_transfer/ResourceCenters/pushToZirc.sql', + 'server_apps/data_transfer/SNP/addNewClonesJSmith.pl', + 'server_apps/data_transfer/SNP/addTalbotSNPAttr.sql', + 'server_apps/data_transfer/SNP/dbSNP.pl', + 'server_apps/data_transfer/SNP/loadNewSNPAttrs.sql', + 'server_apps/data_transfer/SNP/loadNewSNPs.sql', + 'server_apps/data_transfer/eco_go_mapping/insert_eco_go_map.sql', + 'server_apps/data_transfer/maintainTermDisplay/checkRNAConsequenceTerm.groovy', + 'server_apps/data_transfer/zfishbook/preprocess_zfishbook.pl', + 'server_apps/data_transfer/zfishbook/zfishbook.pl', + 'server_apps/data_transfer/zfishbook/zfishbook.sh', ] +project.ext.set("whitelistTemplateFiles", whitelistTemplateFiles) + // load properties into gradle task setup { project.ext.ttNameMap = new Properties() @@ -382,107 +385,44 @@ project(':home') { } } -project(':home:zf_info') { - task "deployGenericFiles"(type: ZfinTargetCopy) { - from(project.projectDir) { - ttNameMap.each { name, value -> - filter { it.replaceAll('', value) } - } - include '**/*.html' - } - into targetroot + pName - } - - task "deployStaticFiles"(type: ZfinTargetCopy) { - from(project.projectDir) { - exclude '**/*.html' - exclude '**/Makefile' - } - into targetroot + pName - } - - task "deployFiles"(type: GradleBuild) { - tasks = ['deployGenericFiles', 'deployStaticFiles'] - } +task "home;zf_info;deployFiles" (type: SimpleDirectoryCopyTask) { + sourcePath = 'home/zf_info' + excludes = ['Makefile'] } -project(':home:ZFIN') { - task "deployFiles"(type: ZfinTargetCopy) { - from(project.projectDir) { - ttNameMap.each { name, value -> - filter { it.replaceAll('', value) } - } - exclude '**/Makefile' - } - into targetroot + pName - } +task "home;ZFIN;deployFiles" (type: SimpleDirectoryCopyTask) { + sourcePath = 'home/ZFIN' + excludes = ['Makefile'] } -project(':server_apps:sysexecs') { - task "deployFiles"(type: ZfinTargetCopy) { - from(project.projectDir) { - ttNameMap.each { name, value -> - filter { it.replaceAll('', value) } - } - exclude '**/Makefile', '**/build.gradle' - } - into targetroot + pName - } +task "server_apps;sysexecs;deployFiles" (type: SimpleDirectoryCopyTask) { + sourcePath = 'server_apps/sysexecs' + excludes = ['Makefile', 'build.gradle'] } -project(':server_apps:apache') { - task "deployFiles"(type: ZfinTargetCopy) { - from(project.projectDir) { - ttNameMap.each { name, value -> - filter { it.replaceAll('', value) } - } - exclude '**/Makefile', '**/build.gradle' - } - into targetroot + pName - } +task "server_apps;apache;deployFiles" (type: SimpleDirectoryCopyTask) { + sourcePath = 'server_apps/apache' + excludes = ['Makefile', 'build.gradle'] } -project(':server_apps:Reports') { - task "deployFiles"(type: ZfinTargetCopy) { - from(project.projectDir) { - ttNameMap.each { name, value -> - filter { it.replaceAll('', value) } - } - exclude '**/Makefile', '**/build.gradle' - } - into targetroot + pName - } +task "server_apps;Reports;deployFiles" (type: SimpleDirectoryCopyTask) { + sourcePath = 'server_apps/Reports' + excludes = ['Makefile', 'build.gradle'] } -project(':server_apps:DB_maintenance') { - task "deployFiles"(type: ZfinTargetCopy) { - from(project.projectDir) { - ttNameMap.each { name, value -> - filter { it.replaceAll('', value) } - } - exclude '**/Makefile', '**/build.gradle', '**/postgres/liquibase/*' - } - into targetroot + pName - } +task "server_apps;DB_maintenance;deployFiles" (type: SimpleDirectoryCopyTask) { + sourcePath = 'server_apps/DB_maintenance' + excludes = ['Makefile', 'build.gradle'] + excludeDirs = ['postgres/liquibase'] } -project(':cgi-bin') { - task "deployFiles"(type: ZfinTargetCopy) { - from(project.projectDir) { - ttNameMap.each { name, value -> - filter { it.replaceAll('', value) } - } - exclude '**/Makefile', '**/build.gradle' - } - into targetroot + pName - } +task "cgi-bin;deployFiles" (type: SimpleDirectoryCopyTask) { + sourcePath = 'cgi-bin' + excludes = ['Makefile', 'build.gradle'] } -project(':server_apps:perl_lib') { - task "deployFiles"(type: ZfinTargetCopy) { - from project.projectDir - into targetroot + pName - } +task "server_apps;perl_lib;deployFiles" (type: SimpleDirectoryCopyTask) { + sourcePath = 'server_apps/perl_lib' } task deployGitInfoFile() { @@ -500,145 +440,17 @@ task deployGitInfoFile() { } } -project(':server_apps:data_transfer') { - task "deployFiles"(type: ZfinTargetCopy) { - from(project.projectDir) { - // Apply the search and replace logic only for files that need it - filesMatching(whitelistTemplateFiles) { fileCopyDetails -> -// println("Processing template rules for file: " + fileCopyDetails.file) - ttNameMap.each { name, value -> - fileCopyDetails.filter { String line -> line.replaceAll("", value) } - } - } - exclude '**/Makefile', '**/build.gradle', '**/SangerMutants/*', '**/Ensembl' - } - into targetroot + pName - } -} - -project(':server_apps:data_transfer:Ensembl') { - task "deployFiles"(type: ZfinTargetCopy) { - from(project.projectDir) { - ttNameMap.each { name, value -> - filter { it.replaceAll('', value) } - } - include '**/*.sh', '**/*.sql', '**/*.groovy' - } - into targetroot + pName - } -} - -project(':server_apps:data_transfer:PUBMED') { - task "deployFiles"(type: ZfinTargetCopy) { - from(project.projectDir) { - ttNameMap.each { name, value -> - filter { it.replaceAll('', value) } - } - include '**/*.sh', '**/*.sql', '**/*.groovy', '**/*.pl', '**/*.xml', '**/*.txt' - } - into targetroot + pName - } +task "server_apps;data_transfer;deployFiles" (type: SimpleDirectoryCopyTask) { + sourcePath = 'server_apps/data_transfer' + excludes = ['Makefile', 'build.gradle', '.gitignore', '.DS_Store'] + excludeDirs = ['SangerMutants', 'Ensembl'] } -project(':server_apps:data_transfer:GPAD') { - task "deployFiles"(type: ZfinTargetCopy) { - from(project.projectDir) { - ttNameMap.each { name, value -> - filter { it.replaceAll('', value) } - } - include '**/*.sh', '**/*.sql', '**/*.groovy', '**/*.pl', '**/*.xml', '**/*.txt' - } - into targetroot + pName - } +task "server_apps;data_transfer;Ensembl;deployFiles" (type: SimpleDirectoryCopyTask) { + sourcePath = 'server_apps/data_transfer/Ensembl' + includes = ['sh', 'sql', 'groovy'] } -project(':server_apps:data_transfer:GPI') { - task "deployFiles"(type: ZfinTargetCopy) { - from(project.projectDir) { - ttNameMap.each { name, value -> - filter { it.replaceAll('', value) } - } - include '**/*.sh', '**/*.sql', '**/*.groovy', '**/*.pl', '**/*.xml', '**/*.txt' - } - into targetroot + pName - } -} - - -project(':server_apps:data_transfer:ExpressionAtlas') { - task "deployFiles"(type: ZfinTargetCopy) { - from(project.projectDir) { - ttNameMap.each { name, value -> - filter { it.replaceAll('', value) } - } - include '**/*.sh', '**/*.sql', '**/*.groovy', '**/*.pl', '**/*.xml', '**/*.txt' - } - into targetroot + pName - } -} - -project(':server_apps:data_transfer:RNASeqCuration') { - task "deployFiles"(type: ZfinTargetCopy) { - from(project.projectDir) { - ttNameMap.each { name, value -> - filter { it.replaceAll('', value) } - } - include '**/*.sh', '**/*.sql', '**/*.groovy', '**/*.pl', '**/*.xml', '**/*.txt' - } - into targetroot + pName - } -} - -project(':server_apps:data_transfer:ResourceCenters') { - task "deployFiles"(type: ZfinTargetCopy) { - from(project.projectDir) { - ttNameMap.each { name, value -> - filter { it.replaceAll('', value) } - } - include '**/*.sh', '**/*.sql', '**/*.groovy', '**/*.pl', '**/*.xml', '**/*.txt' - } - into targetroot + pName - } -} - - -project(':server_apps:data_transfer:GO') { - task "deployFiles"(type: ZfinTargetCopy) { - from(project.projectDir) { - ttNameMap.each { name, value -> - filter { it.replaceAll('', value) } - } - include '**/*.sh', '**/*.sql', '**/*.groovy', '**/*.pl', '**/*.xml', '**/*.txt' - } - into targetroot + pName - } -} - -project(':server_apps:data_transfer:ORTHO') { - task "deployFiles"(type: ZfinTargetCopy) { - from(project.projectDir) { - ttNameMap.each { name, value -> - filter { it.replaceAll('', value) } - } - include '**/*.sh', '**/*.sql', '**/*.groovy', '**/*.pl', '**/*.xml', '**/*.txt' - } - into targetroot + pName - } -} - -project(':server_apps:data_transfer:eco_go_mapping') { - task "deployFiles"(type: ZfinTargetCopy) { - from(project.projectDir) { - ttNameMap.each { name, value -> - filter { it.replaceAll('', value) } - } - include '**/*.sh', '**/*.sql', '**/*.groovy', '**/*.pl', '**/*.xml', '**/*.txt' - } - into targetroot + pName - } -} - - project(':server_apps:data_transfer:Downloads') { task "createSymlink"() { doLast { @@ -657,41 +469,23 @@ project(':server_apps:data_transfer:Downloads') { } } -project(':server_apps:data_transfer:Downloads:GFF3') { - task "deployFiles"(type: ZfinTargetCopy) { - from(project.projectDir) { - ttNameMap.each { name, value -> - filter { it.replaceAll('', value) } - } - include '**/*.sh', '**/*.sql', '**/*.groovy', '**/*.xml' - } - into targetroot + pName - } -} - - task make(type: GradleBuild) { tasks = ['deployPostgresFunctions', 'deployPostgresTriggers', 'createEmptyDirsIfNotExists', - ':home:deployFiles', - ':home:zf_info:deployFiles', - ':home:ZFIN:deployFiles', - ':server_apps:apache:deployFiles', - ':server_apps:sysexecs:deployFiles', - ':server_apps:DB_maintenance:deployFiles', - ':server_apps:data_transfer:deployFiles', + 'home:deployFiles', + 'home;zf_info;deployFiles', + 'home;ZFIN;deployFiles', + 'server_apps;apache;deployFiles', + 'server_apps;sysexecs;deployFiles', + 'server_apps;DB_maintenance;deployFiles', + 'server_apps;data_transfer;deployFiles', ':server_apps:data_transfer:Downloads:createSymlink', - ':server_apps:data_transfer:Ensembl:deployFiles', - ':server_apps:data_transfer:PUBMED:deployFiles', - ':server_apps:data_transfer:ResourceCenters:deployFiles', - ':server_apps:data_transfer:GO:deployFiles', - ':server_apps:data_transfer:ORTHO:deployFiles', - ':server_apps:data_transfer:eco_go_mapping:deployFiles', - ':server_apps:Reports:deployFiles', + 'server_apps;data_transfer;Ensembl;deployFiles', + 'server_apps;Reports;deployFiles', 'deployGitInfoFile', - ':cgi-bin:deployFiles', - ':server_apps:perl_lib:deployFiles', + 'cgi-bin;deployFiles', + 'server_apps;perl_lib;deployFiles', ] } @@ -1169,22 +963,3 @@ task showDirs { } } -class ZfinTargetCopy extends Copy { - - @Input - String projectName - @Input - String pName - - ZfinTargetCopy() { - projectName = project.path - pName = projectName.replace(":", "/") - description 'Deploy ' + pName + ' to TARGETROOT' - group 'ZFIN Deployment' - } - - @TaskAction - void executeTask() { - } -} - diff --git a/buildSrc/src/main/groovy/SimpleDirectoryCopyTask.groovy b/buildSrc/src/main/groovy/SimpleDirectoryCopyTask.groovy new file mode 100644 index 0000000000..962fe3a5a5 --- /dev/null +++ b/buildSrc/src/main/groovy/SimpleDirectoryCopyTask.groovy @@ -0,0 +1,126 @@ +import org.gradle.api.DefaultTask +import org.gradle.api.tasks.Input +import org.gradle.api.tasks.Internal +import org.gradle.api.tasks.TaskAction +import org.gradle.api.GradleException + +class SimpleDirectoryCopyTask extends DefaultTask { + + @Input + String sourcePath + + @Input + List includes = [] // List of file extensions to include (e.g., 'sh', 'sql') + + @Input + List excludes = [] // List of filenames to exclude (e.g., 'Makefile', 'build.gradle') + + @Input + List excludeDirs = [] // List of directories to exclude (relative to sourcePath) + + // Access global properties from the project.ext + @Internal + def targetroot = project.ext.targetroot + + @Internal + def ttNameMap = project.ext.ttNameMap + + @Internal + def whitelistTemplateFiles = project.ext.whitelistTemplateFiles + + @TaskAction + void copyFiles() { + def debugMode = false + println "Starting copy task for sourcePath: $sourcePath" + + def targetDir = new File("$targetroot/$sourcePath") + def sourceDir = new File(sourcePath) + + if (!sourceDir.exists()) { + println "Source directory does not exist: $sourceDir" + return + } + + println "Exclude dirs: " + (excludeDirs.isEmpty() ? "None" : excludeDirs) + println "Include extensions: " + (includes.isEmpty() ? "All" : includes) + println "Exclude extensions: " + (excludes.isEmpty() ? "None" : excludes) + println "--------------------------------------------------" + + def copySingleFile = { source, destination -> + def relativeDestination = sourceDir.toURI().relativize(source.toURI()).path + + //are the files the same? + if (destination.exists()) { + def diffProc = ["diff", source, destination].execute() + diffProc.waitForOrKill(3600) + if (diffProc.exitValue() == 0) { + if (debugMode) { + println " Skipped: $relativeDestination (Identical file)" + } + return + } + } + + //if not, copy the file + def sout = new StringBuilder(), serr = new StringBuilder() + def proc = ["cp", source, destination].execute() + proc.consumeProcessOutput(sout, serr) + proc.waitForOrKill(3600) + if (proc.exitValue() != 0) { + println "Error" + println "$serr" + throw new GradleException("Failed to copy file: $source") + } + println " Copied: $relativeDestination" +// println "out> $sout\nerr> $serr" + } + + sourceDir.eachFileRecurse { file -> + def relativePath = sourceDir.toURI().relativize(file.toURI()).path + def pathRelativeToThisBuildFile = sourcePath + '/' + relativePath + + // Skip files in excluded directories (or if any of the excluded directories is a parent/grandparent/etc. directory) + if (excludeDirs.any { excludedDir -> relativePath.startsWith("${excludedDir}/") || relativePath == excludedDir }) { + if (debugMode) { + println " Skipped: $relativePath (Excluded directory or subdirectory)" + } + return + } + + // Filter files based on includes and excludes + def extension = file.name.tokenize('.').last() + def filename = file.name + if ((includes.isEmpty() || includes.contains(extension)) && !excludes.contains(filename)) { + def destinationFile = new File(targetDir, relativePath) + destinationFile.parentFile.mkdirs() + + if (file.isDirectory()) { + if (!destinationFile.exists()) { + destinationFile.mkdirs() + println " Directory: $relativePath" + } + } else if (whitelistTemplateFiles.contains(pathRelativeToThisBuildFile)) { + // Perform search-and-replace for whitelisted files + def processedContent = file.text + ttNameMap.each { name, value -> + processedContent = processedContent.replaceAll("", value) + } + if (!destinationFile.exists() || destinationFile.text != processedContent) { + destinationFile.text = processedContent + println "Transformed: $relativePath" + } else { + if (debugMode) { + println " Skipped: $relativePath (Identical file after transform)" + } + } + } else { + copySingleFile(file, destinationFile) + } + } else { + if (debugMode) { + println " Skipped: $relativePath (Skipped by includes/excludes)" + } + } + } + } +} diff --git a/home/zf_info/news/jobs.rss b/home/zf_info/news/jobs.rss deleted file mode 100644 index bec5bb4ca4..0000000000 --- a/home/zf_info/news/jobs.rss +++ /dev/null @@ -1,5 +0,0 @@ - - -feed:/spaces/createrssfeed.action?types=blogpost\&spaces=jobs\&title=Zebrafish+Jobs\&publicFeed=true\&maxResults=-1\&sort=created\&timeSpan=121 - - diff --git a/home/zf_info/news/mtgs.rss b/home/zf_info/news/mtgs.rss deleted file mode 100644 index 7bacd0c01f..0000000000 --- a/home/zf_info/news/mtgs.rss +++ /dev/null @@ -1,5 +0,0 @@ - - -feed:/spaces/createrssfeed.action?types=blogpost\&spaces=meetings\&title=Zebrafish+Meetings\&publicFeed=true\&maxResults=-1\&sort=created\&timeSpan=-1 - - diff --git a/home/zf_info/news/siteNews.rss b/home/zf_info/news/siteNews.rss deleted file mode 100644 index f8669e160f..0000000000 --- a/home/zf_info/news/siteNews.rss +++ /dev/null @@ -1,4 +0,0 @@ - - -feed:/spaces/createrssfeed.action?types=blogpost\&spaces=news\&title=Zebrafish+News\&publicFeed=true\&maxResults=-1\&sort=created\&timeSpan=120 - diff --git a/server_apps/WebSiteTools/gen-jobs-rss.r b/server_apps/WebSiteTools/gen-jobs-rss.r deleted file mode 100755 index e5bbac99d3..0000000000 --- a/server_apps/WebSiteTools/gen-jobs-rss.r +++ /dev/null @@ -1,52 +0,0 @@ -#! /opt/zfin/bin/rebol -sqw -rebol [ - date: 22-Apr-2008 - author: "Tom Conlin" - usage: {gen-jobs-rss.r [/path/to/destination/dir]} -] - -;;; url the logo is found -feed-logo: http:///images/zfinlogo.png - -;;; who owns the lawers -feed-copyright: "University of Oregon" - -;;; keywords for feed search engines -feed-categories: ["zebrafish" "research" "job"] - -;;; import some functions and parse rules -;;; common to our rss feed generators -do %rss-util.r - -;;; parse rules for this particular page -;;; creates XML stanza for a RSS item from this particular page -comment { - -} -rss-item: [ - thru
  • {} {">} - copy item-title to thru "(" - copy item-description to ")" thru "Posted" - copy item-date to

  • - (make-item item-anchor item-title item-date item-description) -] - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; the main loop for this particular page - -parse read feed-link [ - title-rule - description-rule - thru