shaftoe / lastversion

An HTTP(S) service to fetch latest stable version of OpenSource projects
Apache License 2.0
4 stars 0 forks source link

Lastversion: an HTTP(S) service to fetch last stable version of OpenSource projects

License Go Report Card Issue Count

Lastversion is a small serverless project that I built to teach myself a bit of Go and OpenWhisk along the way. It's making use of OpenWhisk built-in Docker support to run the Go application (lastversion.go) in a container, which is forking the provided (statically linked) git binary to fetch tags from public Git repositories, then selects the last stable version and returns it in json format

Usage

$ curl lastversion.info/go
{
    "request": "go",
    "result": "1.8"
}
$ curl lastversion.info/skynet
{
    "err": "project not available",
    "request": "skynet"
}

https transport is supported:

$ curl https://lastversion.info/kubernetes
{
    "request": "kubernetes",
    "result": "1.5.3"
}
$ curl https://lastversion.info/lastversion
{
    "request": "lastversion",
    "result": "0.2.0"
}

Current limitations

Develop on OpenWhisk

Fetch the development environment installing OpenWhisk development Vagrant box and set up credentials for wsk tool as suggested

Deploy lastversion action and api gateway

$ ./build.sh create
# ... edit code ...
$ ./build.sh update

Invoke lastversion action

$ ./build.sh run <project_name>

or fetch the api URL and use an http client

$ wsk -i api-experimental list /lastversion
$ curl <https url>/?project=<project_name>

Destroy lastversion

$ ./build.sh delete

Git binary

Compiled from sources (v2.11.1) with those flags: $ make "CFLAGS=${CFLAGS} -static" NO_OPENSSL=1 NO_CURL=1