Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
galaxyproject
GitHub Repository: galaxyproject/training-material
Path: blob/main/bin/lint-deploy.rb
1677 views
1
#!/usr/bin/env ruby
2
require 'json'
3
# Ensure that some mandatory files are here before we deploy. Mostly to catch
4
# people moving/renaming files that aren't as visibly used.
5
6
# _site/training-material/api/top-tools.json must exist + have correct structure.
7
raise 'top-tools.json missing' unless File.exist?('_site/training-material/api/top-tools.json')
8
top_tools = JSON.parse(File.read('_site/training-material/api/top-tools.json'))
9
raise 'top-tools.json is not an array' unless top_tools.is_a?(Hash)
10
raise 'Missing important tools' unless top_tools.key? 'Grep1'
11
raise 'Wrong structure: missing tool_id' unless top_tools['iuc/circos/circos'].key? 'tool_id'
12
raise 'Wrong structure: missing tutorials' unless top_tools['iuc/circos/circos'].key? 'tutorials' and top_tools['iuc/circos/circos']['tutorials'].length.positive?
13
14