From 1b06bdc812c3bb8f5c048e431320494b30ee0b8a Mon Sep 17 00:00:00 2001 From: TrainDoctor Date: Tue, 23 Aug 2022 11:42:12 -0700 Subject: [PATCH] Move backend stuff to backend folder --- .gitignore | 1 - {backend-rs => backend}/Cargo.lock | 0 {backend-rs => backend}/Cargo.toml | 0 {backend-rs => backend}/Cross.toml | 0 backend/Dockerfile | 9 +++++++++ backend/Makefile | 14 ++++++++++++++ {backend-rs => backend}/build.sh | 0 backend/entrypoint.sh | 8 ++++++++ {backend-rs => backend}/src/api.rs | 0 {backend-rs => backend}/src/control.rs | 0 {backend-rs => backend}/src/datastructs.rs | 0 {backend-rs => backend}/src/json.rs | 0 {backend-rs => backend}/src/main.rs | 0 {backend-rs => backend}/src/sys.rs | 0 14 files changed, 31 insertions(+), 1 deletion(-) rename {backend-rs => backend}/Cargo.lock (100%) rename {backend-rs => backend}/Cargo.toml (100%) rename {backend-rs => backend}/Cross.toml (100%) create mode 100644 backend/Dockerfile create mode 100644 backend/Makefile rename {backend-rs => backend}/build.sh (100%) create mode 100755 backend/entrypoint.sh rename {backend-rs => backend}/src/api.rs (100%) rename {backend-rs => backend}/src/control.rs (100%) rename {backend-rs => backend}/src/datastructs.rs (100%) rename {backend-rs => backend}/src/json.rs (100%) rename {backend-rs => backend}/src/main.rs (100%) rename {backend-rs => backend}/src/sys.rs (100%) diff --git a/.gitignore b/.gitignore index 4bfe55c..aa2d529 100644 --- a/.gitignore +++ b/.gitignore @@ -41,7 +41,6 @@ yalc.lock # ignore Rust compiler files /backend-rs/target -backend /bin/backend # packaged teasers diff --git a/backend-rs/Cargo.lock b/backend/Cargo.lock similarity index 100% rename from backend-rs/Cargo.lock rename to backend/Cargo.lock diff --git a/backend-rs/Cargo.toml b/backend/Cargo.toml similarity index 100% rename from backend-rs/Cargo.toml rename to backend/Cargo.toml diff --git a/backend-rs/Cross.toml b/backend/Cross.toml similarity index 100% rename from backend-rs/Cross.toml rename to backend/Cross.toml diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 0000000..f46e170 --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,9 @@ +# we support images for building with a vanilla SteamOS base, +# or versions with ootb support for rust or go +# developers can also customize these images via this Dockerfile +#FROM ghcr.io/steamdeckhomebrew/holo-toolchain-rust:latest +#FROM ghcr.io/steamdeckhomebrew/holo-toolchain-go:latest +FROM ghcr.io/steamdeckhomebrew/holo-base:latest + +# entrypoint.sh should always be located in the backend folder +ENTRYPOINT [ "/backend/entrypoint.sh" ] \ No newline at end of file diff --git a/backend/Makefile b/backend/Makefile new file mode 100644 index 0000000..a1e5dc5 --- /dev/null +++ b/backend/Makefile @@ -0,0 +1,14 @@ +# This is the default target, which will be built when +# you invoke make +.PHONY: all +all: hello + +# This rule tells make how to build hello from hello.cpp +hello: + mkdir -p ./out + gcc -o ./out/hello ./src/main.c + +# This rule tells make to delete hello and hello.o +.PHONY: clean +clean: + rm -f hello \ No newline at end of file diff --git a/backend-rs/build.sh b/backend/build.sh similarity index 100% rename from backend-rs/build.sh rename to backend/build.sh diff --git a/backend/entrypoint.sh b/backend/entrypoint.sh new file mode 100755 index 0000000..af04d23 --- /dev/null +++ b/backend/entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e + +echo "Container's IP address: `awk 'END{print $1}' /etc/hosts`" + +cd /backend + +make \ No newline at end of file diff --git a/backend-rs/src/api.rs b/backend/src/api.rs similarity index 100% rename from backend-rs/src/api.rs rename to backend/src/api.rs diff --git a/backend-rs/src/control.rs b/backend/src/control.rs similarity index 100% rename from backend-rs/src/control.rs rename to backend/src/control.rs diff --git a/backend-rs/src/datastructs.rs b/backend/src/datastructs.rs similarity index 100% rename from backend-rs/src/datastructs.rs rename to backend/src/datastructs.rs diff --git a/backend-rs/src/json.rs b/backend/src/json.rs similarity index 100% rename from backend-rs/src/json.rs rename to backend/src/json.rs diff --git a/backend-rs/src/main.rs b/backend/src/main.rs similarity index 100% rename from backend-rs/src/main.rs rename to backend/src/main.rs diff --git a/backend-rs/src/sys.rs b/backend/src/sys.rs similarity index 100% rename from backend-rs/src/sys.rs rename to backend/src/sys.rs