Add jenkins build #1

Merged
phlaym merged 11 commits from jenkins into main 2023-11-30 17:33:12 +00:00
2 changed files with 7 additions and 1 deletions
Showing only changes of commit 47e47236ab - Show all commits

1
Jenkinsfile vendored
View File

@ -36,6 +36,7 @@ pipeline {
}
}
}
// For this to work, edit sonar-scanner script to set use_embedded_jre=false
stage('SonarQube Analysis') {
steps {
withSonarQubeEnv(installationName: 'SQ Bib Watcher', envOnly: true) {

View File

@ -1,6 +1,6 @@
use config::Config;
use reqwest::header;
use rss::{Channel, ChannelBuilder, ItemBuilder};
use rss::{Channel, ChannelBuilder, GuidBuilder, ItemBuilder};
use scraper::{Html, Selector};
use std::collections::HashMap;
use std::{error::Error, fs::File, io::BufReader};
@ -84,12 +84,17 @@ fn search(url: &str, title: &str) -> Result<(), Box<dyn Error>> {
.build()),
}?;
let mut items = channel.clone().into_items();
let guid = GuidBuilder::default()
.value(title.to_string() + &Utc::now().to_rfc2822())
.permalink(false)
.build();
items.push(
ItemBuilder::default()
.title(Some(title.to_string()))
.pub_date(Some(Utc::now().to_rfc2822()))
.link(Some(url.to_string()))
.description(Some(status))
.guid(Some(guid))
.build(),
);
channel.set_items(items);