wip: initial somewhat functional Earthfile
parent
3f6a62b003
commit
26bec32803
|
@ -0,0 +1,129 @@
|
|||
VERSION 0.7
|
||||
|
||||
appimage:
|
||||
FROM --platform=linux/amd64 +base-rust
|
||||
RUN apt-get update && apt-get -y install wget curl file && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage && \
|
||||
chmod +x linuxdeploy-x86_64.AppImage && \
|
||||
./linuxdeploy-x86_64.AppImage --appimage-extract && \
|
||||
ln -s $PWD/squashfs-root/AppRun /usr/local/bin/linuxdeploy-x86_64.AppImage
|
||||
RUN linuxdeploy-x86_64.AppImage --appdir dist
|
||||
COPY +upend-cli/bin dist/usr/bin/upend
|
||||
COPY --dir +webui/dist dist/usr/share/upend/webui
|
||||
COPY assets/upend.png dist/usr/share/icons/upend.png
|
||||
COPY --dir build build
|
||||
COPY +get-version/version.txt .
|
||||
RUN export LINUXDEPLOY_OUTPUT_VERSION="$(cat version.txt)" ;\
|
||||
linuxdeploy-x86_64.AppImage --appdir dist -d build/upend.desktop --output appimage
|
||||
SAVE ARTIFACT UpEnd* AS LOCAL dist/
|
||||
|
||||
upend-docker:
|
||||
FROM debian:bookworm
|
||||
# COPY +upend-cli/bin dist/usr/bin/upend
|
||||
# COPY --dir +webui/dist dist/usr/share/upend/webui
|
||||
# COPY assets/upend.png dist/usr/share/icons/upend.png
|
||||
SAVE IMAGE upend/upend upend
|
||||
|
||||
get-version:
|
||||
LOCALLY
|
||||
RUN mkdir -p tmp && ./build/get_version.sh | tee tmp/version.txt
|
||||
SAVE ARTIFACT tmp/version.txt version.txt
|
||||
|
||||
upend-cli:
|
||||
FROM +base-rust
|
||||
RUN cargo fetch
|
||||
RUN cargo build --release
|
||||
SAVE ARTIFACT target/release/upend-cli bin
|
||||
|
||||
webui:
|
||||
FROM +base-node
|
||||
COPY +jslib/jslib tools/upend_js
|
||||
COPY +wasmlib/pkg tools/upend_wasm/pkg
|
||||
WORKDIR webui
|
||||
RUN pnpm install --frozen-lockfile
|
||||
RUN pnpm build
|
||||
SAVE ARTIFACT dist
|
||||
|
||||
wasmlib:
|
||||
FROM --platform=linux/amd64 +base-rust
|
||||
RUN cargo install wasm-pack wasm-bindgen-cli && rustup target add wasm32-unknown-unknown
|
||||
WORKDIR tools/upend_wasm
|
||||
RUN cargo fetch
|
||||
RUN wasm-pack build --target web
|
||||
SAVE ARTIFACT pkg
|
||||
|
||||
jslib:
|
||||
FROM +base-node
|
||||
COPY +wasmlib/pkg /upend/tools/upend_wasm/pkg
|
||||
WORKDIR tools/upend_js
|
||||
RUN pnpm install --frozen-lockfile
|
||||
RUN pnpm build
|
||||
SAVE ARTIFACT . jslib
|
||||
|
||||
webext:
|
||||
FROM +base-node
|
||||
WORKDIR webext
|
||||
RUN pnpm install --frozen-lockfile
|
||||
RUN pnpm build
|
||||
|
||||
lint:
|
||||
WAIT
|
||||
BUILD +lint-backend
|
||||
BUILD +lint-frontend
|
||||
BUILD +lint-jslib
|
||||
END
|
||||
|
||||
lint-backend:
|
||||
FROM +base-rust
|
||||
RUN rustup component add clippy
|
||||
RUN cargo fetch
|
||||
RUN cargo clippy --workspace
|
||||
|
||||
lint-frontend:
|
||||
FROM +base-node
|
||||
COPY +wasmlib/pkg tools/upend_wasm/pkg
|
||||
WORKDIR webui
|
||||
RUN pnpm install --frozen-lockfile
|
||||
RUN pnpm check && pnpm lint
|
||||
|
||||
lint-jslib:
|
||||
FROM +base-node
|
||||
COPY +wasmlib/pkg tools/upend_wasm/pkg
|
||||
WORKDIR tools/upend_js
|
||||
RUN pnpm install --frozen-lockfile
|
||||
RUN pnpm lint
|
||||
|
||||
test:
|
||||
WAIT
|
||||
BUILD +test-backend
|
||||
END
|
||||
|
||||
test-backend:
|
||||
FROM +base-rust
|
||||
RUN curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C /usr/local/cargo/bin
|
||||
RUN cargo fetch
|
||||
RUN cargo nextest run --workspace
|
||||
|
||||
|
||||
appimage-signed:
|
||||
FROM alpine
|
||||
RUN apk add git gpg openssh-client
|
||||
RUN sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
|
||||
COPY +appimage/* dist/
|
||||
RUN ls -la dist
|
||||
|
||||
|
||||
base-rust:
|
||||
FROM rust:bookworm
|
||||
WORKDIR /upend
|
||||
COPY --dir base cli db Cargo.toml Cargo.lock .
|
||||
COPY --dir tools/upend_wasm tools/upend_wasm
|
||||
|
||||
base-node:
|
||||
FROM node:lts
|
||||
RUN npm install -g pnpm
|
||||
WORKDIR /upend
|
||||
COPY --dir webui webext .
|
||||
COPY --dir tools/upend_js tools/upend_js
|
Loading…
Reference in New Issue