fix symlink creation path
don't pass rocket dependency to package package
This commit is contained in:
parent
04f4e99782
commit
96c2876c97
@ -24,9 +24,6 @@ RUN cargo build --release --features static
|
|||||||
# Stage 2: Create the final image
|
# Stage 2: Create the final image
|
||||||
FROM archlinux
|
FROM archlinux
|
||||||
|
|
||||||
# Copy the built binary from the previous stage
|
|
||||||
COPY --from=builder /app/target/release/untitled /usr/local/bin/untitled
|
|
||||||
|
|
||||||
RUN echo $'\n\
|
RUN echo $'\n\
|
||||||
[multilib]\n\
|
[multilib]\n\
|
||||||
Include = /etc/pacman.d/mirrorlist'>> /etc/pacman.conf
|
Include = /etc/pacman.d/mirrorlist'>> /etc/pacman.conf
|
||||||
@ -41,6 +38,9 @@ RUN echo $'\n\
|
|||||||
SigLevel = Optional TrustAll\n\
|
SigLevel = Optional TrustAll\n\
|
||||||
Server = http://localhost:8080/' >> /etc/pacman.conf
|
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
|
# Set the entry point or default command to run your application
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
CMD ["untitled"]
|
CMD ["untitled"]
|
||||||
|
@ -24,7 +24,6 @@ use sea_orm::{Database, DatabaseConnection};
|
|||||||
use sea_orm_migration::MigratorTrait;
|
use sea_orm_migration::MigratorTrait;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use tar::Archive;
|
|
||||||
use tokio::fs::symlink;
|
use tokio::fs::symlink;
|
||||||
use tokio::sync::broadcast;
|
use tokio::sync::broadcast;
|
||||||
|
|
||||||
@ -53,7 +52,7 @@ fn main() {
|
|||||||
let enc = GzEncoder::new(tar_gz, Compression::default());
|
let enc = GzEncoder::new(tar_gz, Compression::default());
|
||||||
let mut tar = tar::Builder::new(enc);
|
let mut tar = tar::Builder::new(enc);
|
||||||
tar.finish().expect("failed to create repo archive");
|
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
|
.await
|
||||||
.expect("failed to create repo symlink");
|
.expect("failed to create repo symlink");
|
||||||
|
|
||||||
@ -61,7 +60,7 @@ fn main() {
|
|||||||
let enc = GzEncoder::new(tar_gz, Compression::default());
|
let enc = GzEncoder::new(tar_gz, Compression::default());
|
||||||
let mut tar = tar::Builder::new(enc);
|
let mut tar = tar::Builder::new(enc);
|
||||||
tar.finish().expect("failed to create repo archive");
|
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
|
.await
|
||||||
.expect("failed to create repo symlink");
|
.expect("failed to create repo symlink");
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ use crate::builder::types::Action;
|
|||||||
use crate::db::prelude::Packages;
|
use crate::db::prelude::Packages;
|
||||||
use crate::db::{packages, versions};
|
use crate::db::{packages, versions};
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use rocket::State;
|
|
||||||
use sea_orm::ColumnTrait;
|
use sea_orm::ColumnTrait;
|
||||||
use sea_orm::QueryFilter;
|
use sea_orm::QueryFilter;
|
||||||
use sea_orm::{ActiveModelTrait, DatabaseConnection, EntityTrait, Set, TransactionTrait};
|
use sea_orm::{ActiveModelTrait, DatabaseConnection, EntityTrait, Set, TransactionTrait};
|
||||||
@ -12,7 +11,7 @@ use tokio::sync::broadcast::Sender;
|
|||||||
pub async fn package_add(
|
pub async fn package_add(
|
||||||
db: &DatabaseConnection,
|
db: &DatabaseConnection,
|
||||||
pkg_name: String,
|
pkg_name: String,
|
||||||
tx: &State<Sender<Action>>,
|
tx: &Sender<Action>,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
let txn = db.begin().await?;
|
let txn = db.begin().await?;
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ use crate::builder::types::Action;
|
|||||||
use crate::db::prelude::{Packages, Versions};
|
use crate::db::prelude::{Packages, Versions};
|
||||||
use crate::db::{packages, versions};
|
use crate::db::{packages, versions};
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use rocket::State;
|
|
||||||
use sea_orm::ColumnTrait;
|
use sea_orm::ColumnTrait;
|
||||||
use sea_orm::QueryFilter;
|
use sea_orm::QueryFilter;
|
||||||
use sea_orm::{ActiveModelTrait, DatabaseConnection, EntityTrait, Set, TransactionTrait};
|
use sea_orm::{ActiveModelTrait, DatabaseConnection, EntityTrait, Set, TransactionTrait};
|
||||||
@ -13,7 +12,7 @@ pub async fn package_update(
|
|||||||
db: &DatabaseConnection,
|
db: &DatabaseConnection,
|
||||||
pkg_id: i32,
|
pkg_id: i32,
|
||||||
force: bool,
|
force: bool,
|
||||||
tx: &State<Sender<Action>>,
|
tx: &Sender<Action>,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
let txn = db.begin().await?;
|
let txn = db.begin().await?;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user