This simple command line tool enables you to get air quality data for a given sensor ID from OpenData Stuttgart API
- Query sensor by type, coordinates, country get all sensors in an area - find the sensor ID
- 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.
- Docker installed on your machine.
This project uses public images from DockerHub
docker-compose up
docker run -it -v $(pwd):/application airqualityapi_php-cli:latest php index.php
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.
In the PHP-CLI container run the following:
docker run -it -v $(pwd):/application airqualityapi_php-cli:latest vendor/bin/phpunit
- Iliyan Bonev