Set up bash scripts that can be used as a build environment #52

Merged
savanni merged 4 commits from ci-cd into main 2023-08-07 19:23:27 +00:00
5 changed files with 1143 additions and 573 deletions
Showing only changes of commit 11ca8661fa - Show all commits

1672
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,5 @@
[workspace]
members = [
"dashboard",
"ifc"
]

View File

@ -2,26 +2,29 @@
set -euo pipefail
RUST_ALL_TARGETS="dashboard ifc"
build_rust_targets() {
local CMD=$1
local TARGETS=${@/$CMD}
for target in $TARGETS; do
MODULE=$target CMD=$CMD ./builders/rust.sh
done
}
export CARGO=`which cargo`
if [ -z "${TARGET-}" ]; then
echo "No target defined. build all doesn't exist yet"
exit 1
TARGET="all"
fi
if [ -z "${CMD-}" ]; then
CMD="release"
fi
export CMD
case $TARGET in
ifc)
MODULE=ifc builders/rust.sh
;;
"")
echo "No target defined. build all doesn't exist yet"
;;
esac
if [ "${TARGET}" == "all" ]; then
build_rust_targets $CMD $RUST_ALL_TARGETS
else
build_rust_targets $CMD $TARGET
fi

View File

@ -15,7 +15,7 @@ lazy_static = { version = "1.4" }
unic-langid = { version = "0.9" }
horrorshow = { version = "0.8" }
http = { version = "*" }
international-fixed-calendar = { path = "../ifc/" }
ifc = { path = "../ifc/" }
memorycache = { path = "../memory_cache" }
reqwest = { version = "0.11", features = ["json"] }
serde_derive = { version = "1" }

View File

@ -10,7 +10,7 @@ use fluent::{FluentArgs, FluentValue};
use geo_types::{Latitude, Longitude};
use horrorshow::helper::doctype;
use horrorshow::prelude::*;
use international_fixed_calendar as IFC;
use ifc;
use std::{
borrow::Cow,
net::{IpAddr, Ipv4Addr, SocketAddr},
@ -58,7 +58,7 @@ autumn_equinox = Aŭtuna Ekvinokso
winter_solstice = Vintra Solstico
";
fn date(fluent: Arc<fluent_ergonomics::FluentErgo>, today: IFC::IFC) -> impl Render {
fn date(fluent: Arc<fluent_ergonomics::FluentErgo>, today: ifc::IFC) -> impl Render {
let mut day_args = FluentArgs::new();
day_args.set(
"day",
@ -126,7 +126,7 @@ fn astronomia_eventa_desegno(
/*
fn page_template(
fluent: Arc<fluent_ergonomics::FluentErgo>,
today: IFC::IFC,
today: ifc::IFC,
sun_moon: SunMoon,
event: Option<solstices::Event>,
) -> String {
@ -156,7 +156,7 @@ async fn page(
longitude: Longitude,
) -> Result<Html<String>, Rejection> {
let now = Utc::now();
let d = IFC::IFC::from(now.with_timezone(&New_York).date());
let d = ifc::IFC::from(now.with_timezone(&New_York).date());
let sun_moon = solar_client
.request(latitude, longitude, now.with_timezone(&New_York).date())
.await;
@ -170,7 +170,7 @@ async fn page(
#[tokio::main]
pub async fn main() {
let now = Local::now();
let ifc = IFC::IFC::from(now.date_naive().with_year(12023).unwrap());
let ifc = ifc::IFC::from(now.date_naive().with_year(12023).unwrap());
let next_event = EVENTS.next_event(now.with_timezone(&Utc)).unwrap();
println!(