Skip to content

Commit

Permalink
Add makefile and dockerfile
Browse files Browse the repository at this point in the history
Signed-off-by: trivernis <trivernis@protonmail.com>
  • Loading branch information
Trivernis committed Feb 13, 2022
1 parent a0310c8 commit dde9a1e
Show file tree
Hide file tree
Showing 12 changed files with 37,959 additions and 8,004 deletions.
39 changes: 39 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# compiled output
out

# IDEs and editors
mediarepo-api/.idea
mediarepo-daemon/.idea

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# System Files
.DS_Store
Thumbs.db

# other
*.zip
.vscode

# ui
mediarepo-ui/.angular
mediarepo-ui/.idea
mediarepo-ui/dist
mediarepo-ui/node_modules
mediarepo-ui/src-tauri/target

# daemon
mediarepo-daemon/.idea
mediarepo-daemon/target
mediarepo-daemon/*.svg
mediarepo-daemon/*.folded

# api
mediarepo-api/.idea
mediarepo-api/target
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/tmp
/out-tsc
/target
/out

# IDEs and editors
mediarepo-api/.idea
Expand All @@ -29,4 +30,5 @@ mediarepo-ui/.idea
Thumbs.db

# other
*.zip
*.zip
.vscode
45 changes: 45 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
ARG DEBIAN_RELEASE=bullseye

FROM bitnami/minideb:${DEBIAN_RELEASE} AS builder

WORKDIR /usr/src
COPY mediarepo-api ./mediarepo-api
COPY mediarepo-daemon ./mediarepo-daemon
COPY mediarepo-ui ./mediarepo-ui
COPY Makefile .

RUN apt-get update
RUN apt-get install -y \
build-essential \
libssl-dev \
libgtk-3-dev \
libappindicator3-0.1-cil-dev \
patchelf \
librsvg2-dev \
curl \
wget \
pkg-config \
libavutil-dev \
libavformat-dev \
libavcodec-dev \
libavfilter-dev \
libavdevice-dev \
libavresample-dev \
libpostproc-dev \
clang \
nodejs \
npm \
libsoup2.4-dev \
libwebkit2gtk-4.0-dev \
file

RUN apt remove cmdtest -y
RUN npm install -g yarn

RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"

RUN install_packages make

RUN make build_daemon
RUN make build_ui
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
default: build

build: build_daemon build_ui

create_output_dir:
mkdir -p out

build_daemon: create_output_dir
$(MAKE) -C mediarepo-daemon build
cp mediarepo-daemon/target/release/mediarepo-daemon* out/

build_ui: create_output_dir
$(MAKE) -C mediarepo-ui build
cp mediarepo-ui/src-tauri/target/release/mediarepo-ui* out/
cp mediarepo-ui/src-tauri/target/release/bundle out/
cp mediarepo-ui/src-tauri/icons out/
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Both can be downloaded from the [Releases](https://github.com/Trivernis/mediarep

Arch Linux:
```sh
yay -S mediarepo-daemon mediarepo
$ yay -S mediarepo-daemon mediarepo
```

When installing manually the `mediarepo-daemon` binary needs to be accessible in the `PATH` variable.
Expand All @@ -63,6 +63,28 @@ When installing manually the `mediarepo-daemon` binary needs to be accessible in

You need to have a working rust toolchain (e.g. via [rustup](https://rustup.rs/)) and [node.js](https://nodejs.org) installed.
For building the UI the required tauri build tooling needs to be installed as well. Please follow [their documentation](https://tauri.studio/docs/getting-started/prerequisites) for setup information.
You also need to have a working `make` installation on your system.

### Building mediarepo

After all required dependencies are installed and tools are accessible in the `PATH`, you can build the project like follows:

All Componens:
```sh
$ make build
```

Daemon only:
```sh
$ make build_daemon
```

UI only:
```sh
$ make build_ui
```

After building the `out` directory contains all the built binaries and bundles.

## Usage and Further Information

Expand Down
16 changes: 0 additions & 16 deletions mediarepo-api/README.md

This file was deleted.

7 changes: 7 additions & 0 deletions mediarepo-daemon/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
default: build

build: install_deps
cargo build --frozen --release --verbose

install_deps:
cargo fetch
35 changes: 0 additions & 35 deletions mediarepo-daemon/README.md

This file was deleted.

10 changes: 10 additions & 0 deletions mediarepo-ui/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
default: build

build: install_tauri install_angular
cargo tauri build --verbose

install_tauri:
cargo install tauri-cli --version ^1.0.0-rc.4

install_angular:
npm i --save-dev @angular/cli
33 changes: 0 additions & 33 deletions mediarepo-ui/README.md

This file was deleted.

Loading

0 comments on commit dde9a1e

Please sign in to comment.