fix symlink creation path

don't pass rocket dependency to package package
This commit is contained in:
lukas-heiligenbrunner 2024-02-16 11:42:25 +01:00
parent 04f4e99782
commit 96c2876c97
4 changed files with 7 additions and 10 deletions

View File

@ -24,9 +24,6 @@ RUN cargo build --release --features static
# Stage 2: Create the final image
FROM archlinux
# Copy the built binary from the previous stage
COPY --from=builder /app/target/release/untitled /usr/local/bin/untitled
RUN echo $'\n\
[multilib]\n\
Include = /etc/pacman.d/mirrorlist'>> /etc/pacman.conf
@ -41,6 +38,9 @@ RUN echo $'\n\
SigLevel = Optional TrustAll\n\
Server = http://localhost:8080/' >> /etc/pacman.conf
# Copy the built binary from the previous stage
COPY --from=builder /app/target/release/untitled /usr/local/bin/untitled
# Set the entry point or default command to run your application
WORKDIR /app
CMD ["untitled"]

View File

@ -24,7 +24,6 @@ use sea_orm::{Database, DatabaseConnection};
use sea_orm_migration::MigratorTrait;
use std::fs;
use std::fs::File;
use tar::Archive;
use tokio::fs::symlink;
use tokio::sync::broadcast;
@ -53,7 +52,7 @@ fn main() {
let enc = GzEncoder::new(tar_gz, Compression::default());
let mut tar = tar::Builder::new(enc);
tar.finish().expect("failed to create repo archive");
symlink("./repo/repo.db.tar.gz", "./repo/repo.db")
symlink("repo.db.tar.gz", "./repo/repo.db")
.await
.expect("failed to create repo symlink");
@ -61,7 +60,7 @@ fn main() {
let enc = GzEncoder::new(tar_gz, Compression::default());
let mut tar = tar::Builder::new(enc);
tar.finish().expect("failed to create repo archive");
symlink("./repo/repo.files.tar.gz", "./repo/repo.files")
symlink("repo.files.tar.gz", "./repo/repo.files")
.await
.expect("failed to create repo symlink");
}

View File

@ -3,7 +3,6 @@ use crate::builder::types::Action;
use crate::db::prelude::Packages;
use crate::db::{packages, versions};
use anyhow::anyhow;
use rocket::State;
use sea_orm::ColumnTrait;
use sea_orm::QueryFilter;
use sea_orm::{ActiveModelTrait, DatabaseConnection, EntityTrait, Set, TransactionTrait};
@ -12,7 +11,7 @@ use tokio::sync::broadcast::Sender;
pub async fn package_add(
db: &DatabaseConnection,
pkg_name: String,
tx: &State<Sender<Action>>,
tx: &Sender<Action>,
) -> anyhow::Result<()> {
let txn = db.begin().await?;

View File

@ -3,7 +3,6 @@ use crate::builder::types::Action;
use crate::db::prelude::{Packages, Versions};
use crate::db::{packages, versions};
use anyhow::anyhow;
use rocket::State;
use sea_orm::ColumnTrait;
use sea_orm::QueryFilter;
use sea_orm::{ActiveModelTrait, DatabaseConnection, EntityTrait, Set, TransactionTrait};
@ -13,7 +12,7 @@ pub async fn package_update(
db: &DatabaseConnection,
pkg_id: i32,
force: bool,
tx: &State<Sender<Action>>,
tx: &Sender<Action>,
) -> anyhow::Result<()> {
let txn = db.begin().await?;