Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make pipeline_names.json #483

Merged
merged 1 commit into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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