Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/dev-build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Push Slackwatch Image
name: Build and Push Dev Branch

on:
push:
Expand All @@ -9,6 +9,7 @@ on:
- 'src/**'
- 'Dockerfile'
- 'assets/**'
- '.github/workflows/dev-build.yaml'

concurrency:
group: "slackwatch"
Expand All @@ -19,18 +20,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
run: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: ./
file: ./Dockerfile
push: true
tags: ghcr.io/slackspace-io/slackwatch:dev,ghcr.io/slackspace-io/slackwatch:${{ github.sha }}
cache-from: type=registry,ref=ghcr.io/slackspace-io/slackwatch:build-cache
cache-to: type=registry,ref=ghcr.io/slackspace-io/slackwatch:build-cache,mode=max
2 changes: 2 additions & 0 deletions .github/workflows/slackwatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ jobs:
file: ./Dockerfile
push: true
tags: ghcr.io/slackspace-io/slackwatch:preview,ghcr.io/slackspace-io/slackwatch:${{ github.sha }}
cache-from: type=registry,ref=ghcr.io/slackspace-io/slackwatch:pr-build-cache
cache-to: type=registry,ref=ghcr.io/slackspace-io/slackwatch:pr-build-cache,mode=max
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
FROM rust:1.77.1 as builder
WORKDIR /app
COPY . .
RUN cargo install dioxus-cli@0.5.0
COPY Cargo.toml Cargo.lock ./
COPY src ./src
RUN dx build --platform fullstack --release

FROM rust:1.77.1
#RUN apt-get update && rm -rf /var/lib/apt/lists/*
#Copy all files from the builder
WORKDIR /app
COPY --from=builder /app/slackwatch /app/slackwatch
COPY --from=builder /app/target/release/slackwatch /app/slackwatch
EXPOSE 8080
CMD ["/app/slackwatch/slackwatch"]
12 changes: 0 additions & 12 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ use dioxus::prelude::*;
use log::info;
use crate::config::Settings;

//#[cfg(feature = "server")]
//use k8s_openapi::merge_strategies::list::set;
//use std::env;
//
mod config;
mod database;
mod gitops;
Expand All @@ -35,22 +31,17 @@ mod site;
#[tokio::main]
async fn main() {
println!("Hello, world!");
//Logging and env variables
env::set_var("RUST_LOG", "info");
env_logger::init();
// dotenv::dotenv().ok();
// Load Configurations
let settings = Settings::new().unwrap_or_else(|err| {
log::error!("Failed to load settings: {}", err);
panic!("Failed to load settings: {}", err);
});
log::info!("Starting up");
log::info!("Loading configuration {:?}", settings);
//create table if not exist
#[cfg(feature = "server")]
use crate::database::client::create_table_if_not_exist;
create_table_if_not_exist().unwrap();
//working tokio stuff
tokio::task::spawn(services::scheduler::run_scheduler(settings.clone()));
let mut config = dioxus::fullstack::Config::new();

Expand All @@ -59,12 +50,9 @@ async fn main() {
config = config.addr(std::net::SocketAddr::from(([0, 0, 0, 0], 8080)));
}

// Launch the app with the custom menu
let site = std::thread::spawn(|| LaunchBuilder::new().with_cfg(config).launch(App));
//let site = std::thread::spawn(|| launch(App));
log::info!("Started logger");
println!("Started print");
//let _ = web::exweb::site();
site.join().unwrap();
}

Expand Down
60 changes: 0 additions & 60 deletions src/oldc.rs

This file was deleted.