README and changelog

This commit is contained in:
Ismael Arenzana 2020-11-06 16:46:57 -05:00
parent eaaa998ee7
commit 70dbddb817
2 changed files with 15 additions and 39 deletions

View File

@ -2,6 +2,6 @@
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/).
## [0.1] - 2019-05-21
## [0.1] - 2020-1-06
### Added
- Initial Release

View File

@ -1,58 +1,34 @@
[![Build Status](https://travis-ci.org/arenzana/yessir.svg?branch=master)](https://travis-ci.org/arenzana/yessir)
# yessir
`yessir` creates a mock API server that will accept anything you throw at it (or reject, see below) for testing purposes.
# feeder
Generates RSS feed and can upload to S3. Also, it can generate episode and index HTML if desired.
## Install
### Build from source
Make sure Go 1.11+ is installed on your machine. You can follow [this guide](https://golang.org/doc/install) to do so. On a Mac, just set your $GOPATH and run `brew install go`.
Make sure Go 1.15+ is installed on your machine. You can follow [this guide](https://golang.org/doc/install) to do so. On a Mac, just set your $GOPATH and run `brew install go`.
```bash
git clone https://github.com/arenzana/yessir.git
cd yessir
git clone https://gitlab.com/iarenzana/feeder.git
cd feeder
make
```
Now you can execute `yessir`
Now you can execute `feeder`.
### Docker
```bash
make docker
docker run --rm -it -p 8888:8888 github.com/arenzana/yessir:latest
```
## Usage
Below is the usage of the `run` command.
```bash
Start serving!
Usage:
yessir run [flags]
Flags:
-c, --cert string Path to the server TLS certificate file (only for https)
-h, --help help for run
-k, --key string Path to the server TLS certificate key file (only for https)
-p, --port int Port to listen on (default 8888)
-r, --return int HTTP return code (200,404,500) (default 200)
-s, --scheme string Scheme http|https (default "http")
```
Noteworthy options are `-r` to return a different http code rather than 200. And `-s` to pick https (which works inconjunction with `-k` and `-c` for TLS) as the scheme.
### Examples
First, add an episode:
```bash
yessir run
feeder add -f ~/episode01.mp3 -u
```
This will generate an entry on the `podcast_episodes` file. We should edit the JSON file with the info we want first. The episode has also been uploaded at this point (it could have generated an episode file too if we had passed the `-w` option).
Is the simplest way to run `yessir`. It will start a server on port `8888` that will listen for all requests.
Now we need to generate the RSS file from the episodes:
```bash
yessir -p 8877 -s https -c ~/Downloads/example.com.crt -k ~/Downloads/example.com.key -r 500
feeder generate -c ~/feeder_podcastname.yml -u -w
```
The example above will listen for `https` requests on port `8877` and, instead of returning `200`, it will always return a `500` error.
This will generate the RSS file and upload it to S3.
It's recommended that you create a CloudFront distribution and point Route 53 entries to it rather than just going directly to the S3 bucket.