Giter Site home page Giter Site logo

groundskeeper's Introduction

A tool designed to parse through all the plan files in Biome (or Habitat), and discover the latest version available for that plan.

Output is compact, but simple to understand and read. Each line contains 3 fields. A plan with a detected possible update has a prefixed > . An up to date plan has a preceeding pipe | . Errors or inability to check latest version are prefixed with -

The fields are:

  1. Status
  2. plan name
  3. current plan version
  4. detected latest version
| 7zip 16.02 16.02
> R 3.5.0 3.6.0
| acbuild 0.4.0 0.4.0
| acl 2.2.53 2.2.53
| alex 3.2.4 3.2.4
| alsa-lib 1.1.9 1.1.9
> ansible 2.7.11 2.8.1
| ant 1.10.6 unknown
| apr-util 1.6.1 1.6.1
> apr 1.6.5 1.7.0
> artifactory-pro 6.11.0 6.11.1
> artifactory 6.11.0 6.11.1

This may not work for all plans consumed, but is designed to be improved over time to encompass as many cases as possible.

You can check an individual plan by providing its name:

./groundskeeper bats

You can filter the output as necessary by piping the output through grep/sed. Examples:

# Show all plans with possible updates
./groundskeeper | grep --line-buffered "^>"

# Show all plans that are up to date
./groundskeeper | grep --line-buffered "^|"

Want to get super fancy? Get a list of all plans with update candidates as JSON:

./groundskeeper | grep "^>" | jq -sRn '[input | split("\n") | .[] | split(" ")]'

You will get something like this:

[
  [ "|", "7zip", "16.02", "16.02" ],
  [ ">", "R", "3.5.0", "3.6.0" ],
  [ "|", "acbuild", "0.4.0", "0.4.0" ],
  ...
]

Requirements

This was designed and developed on a MacOS machine. As such, certain tools and options might be Mac (or BSD) only.

The goal is to have this implemented as standard Shell, designed for linux systems.

Currently requires the following commands:

  • jq
  • curl
  • uniq
  • sort
  • grep
  • awk
  • sed
  • find
  • tail
  • head

Running

Before running, please ensure you have the following environment variables set:

Name Description
GITHUB_USERNAME Your github username (Ex: export GITHUB_USERNAME="predominant")
GITHUB_TOKEN Your github personal access token (Ex: export GITHUB_TOKEN="1234451231351351355")

You can create a personal access token by visiting your profile on Github.

These tokens are sent to requests to Github only. They require no permissions, and are simply used to ensure you don't hit API limitations by making anonymous requests.

Run groundskeeper:

./groundskeeper

Coverage

Coverage of plans and sample output can be found in this Github Gist.

Authors

Copyright

Copyright 2019, Graham Weldon [email protected]

License

GNU General Public License v3.0

See LICENSE file.

groundskeeper's People

Contributors

predominant avatar stevendanna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

stevendanna

groundskeeper's Issues

version lookups returning HTML

It looks like the parsing might be a bit off for the following plans:

  • kafka
  • libpipeline
  • spark
> kafka 0.10.2.2 <img src="/icons/unknown.gif" alt="[   ]"> <a href="kafka-0.8.0-beta1-src.tgz.sh1">kafka-0.8.0-beta1-src.tgz.sh1</a>   2013-06-27 02:19  159    
>  libpipeline 1.5.1 <tr class="o"><td><a href="libpipeline-1.5.1.asc">libpipeline-1.5.1.tar.gz.asc</a></td><td>    833</td><td>27-jan-2019 14:09</td></tr>
> spark 2.1.2 <img src="/icons/folder.gif" alt="[dir]"> <a href="spark-2.4.3/">spark-2.4.3/</a>            2019-05-07 07:57    -    

release-montoring seems to intermittently return errors

Such as:

release-monitoring.org returned an error.
STDOUT:
{"backend":"custom","created_on":1412174965.0,"ecosystem":"https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/","homepage":"https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/","id":646,"name":"e2fsprogs","packages":[{"distro":"Fedora","package_name":"e2fsprogs"},{"distro":"Alpine","package_name":"e2fsprogs"},{"distro":"NixOS","package_name":"e2fsprogs"},{"distro":"Arch Linux","package_name":"e2fsprogs"},{"distro":"OpenMandriva","package_name":"e2fsprogs"},{"distro":"Buildroot","package_name":"e2fsprogs"}],"regex":"href=\"v?([0-9][0-9.]*)/\"","updated_on":1570759722.0,"version":"1.45.4","version_url":"https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/","versions":["1.45.4","1.45.3","1.45.2","1.45.1","1.45.0","1.44.6","1.44.5","1.44.4","1.44.3","1.44.2","1.44.1","1.44.0","1.43.9","1.43.8","1.43.7","1.43.6","1.43.5","1.43.4","1.43.3","1.43.2","1.43.1","1.43","1.42.13","1.42.12","1.42.11","1.42.10","1.42.9","1.42.8","1.42.7","1.42.6","1.42.5","1.42.4","1.42.3","1.42.2","1.42.1"]}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.