Add Dockerfile and Docker Hub publishing (#9)

Adds docker image publishing with example usage in the README.
This commit is contained in:
Dave Gallant
2020-07-11 22:47:30 -04:00
committed by GitHub
parent 8af371626f
commit d3a23736cc
10 changed files with 99 additions and 251 deletions

View File

@@ -49,7 +49,7 @@ pub fn send(topic: &Topic, posts: &Posts, expression: &str, config: &Config) {
.add_html(&html_message);
match sg.send(mail_info) {
Err(err) => println!("Error: {}", err),
Ok(body) => println!("Response: {}", body),
Err(err) => println!("SendGrid failed to send mail. Error: {}", err),
Ok(body) => println!("SendGrid Response: {}", body),
};
}

View File

@@ -36,7 +36,7 @@ fn main() {
let config = matches.value_of("config").unwrap();
let parsed_config = config::parse(config);
debug!("{:?}\n", parsed_config);
info!("{:?}\n", parsed_config);
let hot_deals = rfd::get_hot_deals().map_err(|err| error!("{:?}", err)).ok();
let parsed_deals = rfd::parse_hot_deals(&hot_deals.unwrap());
rfd::match_deals(

View File

@@ -83,7 +83,7 @@ pub fn match_deals(deals: Deals, config: Config, dbpath: &str) {
.unwrap_or_else(|e| panic!("Invalid regex: {}. {}", expression, e));
if re.is_match(&topic.title) {
found_match = true;
debug!(
info!(
"Expression '{}' matched title: {}",
expression, &topic.title
)
@@ -91,7 +91,7 @@ pub fn match_deals(deals: Deals, config: Config, dbpath: &str) {
let dealer_name = topic.offer.dealer_name.as_ref().unwrap();
if re.is_match(&dealer_name) {
found_match = true;
debug!(
info!(
"Expression '{}' matched dealer: {}",
expression, &topic.title
)
@@ -102,7 +102,7 @@ pub fn match_deals(deals: Deals, config: Config, dbpath: &str) {
}
let deal_hash = hash_deal(topic);
if db::hash_exists(&deal_hash, db::get_config(dbpath)) {
debug!("deal hash '{}' already exists", &deal_hash);
info!("deal hash '{}' already exists", &deal_hash);
} else {
let posts = parse_posts(
get_topic(topic.id)