Skip to content

boneff/air-quality-api

Repository files navigation

Air quality API call from CMD

This simple command line tool enables you to get air quality data for a given sensor ID from OpenData Stuttgart API

  1. Query sensor by type, coordinates, country get all sensors in an area - find the sensor ID
  2. Get data for las 5 mins by sensor ID

The sensor ID can be passed from command line, as an argument or put in config file.

Prerequisites

  • Docker installed on your machine.

This project uses public images from DockerHub

Run the command locally

docker-compose up
docker run -it -v $(pwd):/application  airqualityapi_php-cli:latest php index.php

Jenkins integration

If Jenkins is set up with the ability to run Docker in it (if we deploy Jenkins as a Docker image - there are some extra steps), this command line script could be ran just like we run it locally.
Further reading on running Docker inside a Dockerized Jenkins Nestybox

If there are issues with running Docker in Jenkins - the repo contains a Jenkinsfile which builds the project and runs it without Docker. There should be PHP and Composer already installed on Jenkins.

Such a custom image of Jenkins can be found here.

Testing

In the PHP-CLI container run the following:

docker run -it -v $(pwd):/application  airqualityapi_php-cli:latest vendor/bin/phpunit

Built with

Authors

  • Iliyan Bonev

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published