mirror of
https://codeberg.org/icewind/log-archiver.git
synced 2026-06-03 09:34:09 +02:00
bumb dependencies and docker ci
This commit is contained in:
parent
aec77ae756
commit
d514ab7f30
4 changed files with 610 additions and 497 deletions
28
.github/workflows/docker.yml
vendored
Normal file
28
.github/workflows/docker.yml
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
name: docker-build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
- name: Build and push
|
||||||
|
id: docker_build
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
tags: icewind1991/log-archiver
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
- name: Image digest
|
||||||
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
1107
Cargo.lock
generated
1107
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
14
Cargo.toml
14
Cargo.toml
|
|
@ -7,10 +7,10 @@ edition = "2018"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
sqlx = { version = "0.5", default_features = false, features = ["macros", "postgres", "json", "runtime-actix-rustls", "offline"] }
|
sqlx = { version = "0.5", default_features = false, features = ["macros", "postgres", "json", "runtime-actix-rustls", "offline"] }
|
||||||
dotenv = "0.15"
|
dotenv = "0.15"
|
||||||
main_error = "0.1"
|
main_error = "0.1.2"
|
||||||
tokio = { version = "1", features = ["macros", "time"] }
|
tokio = { version = "1.17.0", features = ["macros", "time"] }
|
||||||
reqwest = { version = "0.11", default-features = false , features = ["rustls-tls"] }
|
reqwest = { version = "0.11.10", default-features = false , features = ["rustls-tls"] }
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1.0.136", features = ["derive"] }
|
||||||
serde_json = "1"
|
serde_json = "1.0.79"
|
||||||
chrono = { version = "0.4", features = ["serde"] }
|
chrono = { version = "0.4.19", features = ["serde"] }
|
||||||
zip = "0.5"
|
zip = "0.6.2"
|
||||||
|
|
@ -66,7 +66,7 @@ async fn get_last_demo(client: &Client, api_host: &str) -> Result<i32, MainError
|
||||||
async fn archive(database_url: &str, api_host: &str, log_target: &Path) -> Result<(), MainError> {
|
async fn archive(database_url: &str, api_host: &str, log_target: &Path) -> Result<(), MainError> {
|
||||||
let pool = PgPool::connect(database_url).await?;
|
let pool = PgPool::connect(database_url).await?;
|
||||||
|
|
||||||
let client = reqwest::Client::new();
|
let client = Client::new();
|
||||||
|
|
||||||
let row = sqlx::query!("SELECT MAX(id) AS last_archived FROM logs_raw")
|
let row = sqlx::query!("SELECT MAX(id) AS last_archived FROM logs_raw")
|
||||||
.fetch_one(&pool)
|
.fetch_one(&pool)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue