Git Product home page Git Product logo

weathercli's Introduction

WeatherCLI

Learning Project: A command-line tool to fetch weather data from Weather API for a Public Location. and convert it to different output formats.

Project based on this repo

This project gets also includes a CI/CD pipeline using GitHub actions and pushes the Docker Image to Docker Hub.

Table of Contents

Requirements

Installation

  1. Clone this repository to your local machine:

    git clone https://github.com/GuenadeSilva/WeatherCLI.git
    cd weathercli
  2. Install necessary dependencies

    go mod tidy

Configuration

In order to connect to CDO API set up a .env file int the project directory with following variable:
CDO_TOKEN=token

In order to use the CI/CD Pipeline ensure you create:

  1. DockerHub Account
  2. Create Personal Access Token
  3. Add them to the Repo's Secrets

Usage

Run the following command to see the available options:

go run main.go [flags]

Flags:

-csv: Enable CSV output (default: false)
-json: Enable JSON output (default: false)
Example usage:

go run main.go -csv -json

To use CI/CD Pipeline make sure you have the requiremens mentioned in the [Configuration](#configuration) then:
  1. Run this command to build a development image:
docker build -t weathercli:dev .
  1. To run the image use:
docker run --rm weathercli:dev
  1. To build the image locally for production:
docker build -t weathercli:1.0.0 . --build-arg VERSION=1.0.0
  1. After that push the changes to "branch-name"

  2. Check if the Tests ran properly, and if not fix them.

  3. Run these final commands to push these to run final tests and push to DockerHub

git tag v1.0.0
git push --tags

License

This project is licensed under the MIT License.

weathercli's People

Contributors

guenadesilva avatar

Watchers

 avatar

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.