Skip to content

Commit

Permalink
Using devbox (will need to remove vscode)
Browse files Browse the repository at this point in the history
  • Loading branch information
ineiti committed Sep 3, 2024
1 parent 54da2c1 commit 049c13f
Show file tree
Hide file tree
Showing 9 changed files with 159 additions and 28 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-build-${{ hashFiles('**/Cargo.lock') }}
key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
cargo-build
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-test-${{ hashFiles('**/Cargo.lock') }}
key: cargo-test-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
cargo-test
cargo-build
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-make_test-${{ hashFiles('**/Cargo.lock') }}
key: cargo-make_test-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
cargo-make_test
cargo-build
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-docker-${{ hashFiles('**/Cargo.lock') }}
key: cargo-docker-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
cargo-docker
cargo-build
Expand All @@ -35,15 +35,14 @@ jobs:
run: devbox run -- make update_version

- name: Build servers
run: devbox run -- make build_cli_release build_web
run: devbox run -- make build_cli_release build_web_release

- name: Docker build signal
uses: mr-smithers-excellent/docker-build-push@v5
with:
image: fledgre/flsignal
registry: docker.io
dockerfile: Dockerfile.flsignal
directory: target-common/release
username: ${{ secrets.DOCKERHUB_NAME }}
password: ${{ secrets.DOCKERHUB }}
tags: latest
Expand All @@ -54,7 +53,6 @@ jobs:
image: fledgre/fledger
registry: docker.io
dockerfile: Dockerfile.fledger
directory: target-common/release
username: ${{ secrets.DOCKERHUB_NAME }}
password: ${{ secrets.DOCKERHUB }}
tags: latest
Expand Down
17 changes: 7 additions & 10 deletions Dockerfile.fledger
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
FROM jetpackio/devbox:latest
FROM debian:bookworm-slim

# Installing your devbox project
WORKDIR /code
USER root:root
RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code
USER ${DEVBOX_USER}:${DEVBOX_USER}
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.lock devbox.lock
RUN apt update && apt install patchelf

RUN devbox run -- echo "Installed Packages."
COPY target-common/release/fledger fledger
RUN patchelf --set-interpreter /usr/lib64/ld-linux-x86-64.so.2 fledger

FROM debian:bookworm-slim
WORKDIR /fledger
COPY ./fledger fledger
COPY --from=0 fledger /fledger/fledger

ENTRYPOINT ["/fledger/fledger", "-vv"]
17 changes: 7 additions & 10 deletions Dockerfile.flsignal
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
FROM jetpackio/devbox:latest
FROM debian:bookworm-slim

# Installing your devbox project
WORKDIR /code
USER root:root
RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code
USER ${DEVBOX_USER}:${DEVBOX_USER}
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.lock devbox.lock
RUN apt update && apt install patchelf

RUN devbox run -- echo "Installed Packages."
COPY target-common/release/flsignal flsignal
RUN patchelf --set-interpreter /usr/lib64/ld-linux-x86-64.so.2 flsignal

FROM debian:bookworm-slim
WORKDIR /fledger
COPY ./flsignal flsignal
COPY --from=0 flsignal /fledger/flsignal

ENTRYPOINT ["/fledger/flsignal", "-vv"]
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ build_cli:
build_cli_release:
cd cli && cargo build --release -p fledger && cargo build --release -p flsignal

build_web_release:
cd flbrowser && trunk build --release

build_web:
cd flbrowser && trunk build

Expand Down
66 changes: 66 additions & 0 deletions cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions flbrowser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ description = "Web interface for fledger"
repository = "https://github.com/ineiti/fledger"
license = "AGPLv3"

[profile.release]
lto = true
opt-level = 's'

[features]
local = []

Expand Down
66 changes: 66 additions & 0 deletions flnet/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ tokio-stream = "0.1"

# For libc
rand = { version = "0.8", optional = true }
tokio-tungstenite = { version = "0.23", features = ["rustls"], optional = true }
tokio-tungstenite = { version = "0.23", features = ["rustls-tls-native-roots"], optional = true }
webrtc = { version = "0.11", optional = true }

# For wasm
Expand Down

0 comments on commit 049c13f

Please sign in to comment.