Skip to content

Commit

Permalink
Merge pull request #483 from ewels/pipeline-names-json
Browse files Browse the repository at this point in the history
Make pipeline_names.json
  • Loading branch information
ewels authored Jul 31, 2020
2 parents 3c2dd70 + b9dd6dd commit 5616392
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

config.ini
public_html/pipelines.json
public_html/pipeline_names.json
public_html/assets/js/fa-icons.json
nfcore_stats.json
nfcore_issue_stats.json
Expand Down
9 changes: 8 additions & 1 deletion update_pipeline_details.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
]
]);

// Final filename to write JSON to
// Final filenames to write JSON to
$results_fn = dirname(__FILE__).'/public_html/pipelines.json';
$pipeline_names_fn = dirname(__FILE__).'/public_html/pipeline_names.json';

// Load a copy of the existing JSON file, if it exists
$old_json = false;
Expand Down Expand Up @@ -161,21 +162,27 @@ function sort_datestamp($a,$b) {
}

// Count workflows
$pipeline_names = [];
foreach($results['remote_workflows'] as $repo){
$results['pipeline_count']++;
if($repo['archived']){
$results['archived_count']++;
} else if(count($repo['releases']) > 0){
$results['published_count']++;
$pipeline_names[] = $repo['name'];
} else {
$results['devel_count']++;
$pipeline_names[] = $repo['name'];
}
}

// Print results to a file
$results_json = json_encode($results, JSON_PRETTY_PRINT)."\n";
file_put_contents($results_fn, $results_json);

// Print simple list of pipelines to a file
file_put_contents($pipeline_names_fn, json_encode(array('pipeline' => $pipeline_names)));

////// Tweet about new releases
// Get old releases
$old_rel_tags = array();
Expand Down

0 comments on commit 5616392

Please sign in to comment.