[cicd] add docker build workflow
This commit is contained in:
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Install the Dioxus CLI
|
||||
#cargo install dioxus-cli --version 0.7.1
|
||||
|
||||
# Build the Dioxus web app (assumes workspace subproject at ./gui)
|
||||
cd gui
|
||||
dx build --platform web --release
|
||||
cd ..
|
||||
|
||||
# Build the backend (proxy package)
|
||||
#cargo build --release -p proxy
|
||||
#
|
||||
## Prepare artifact directories
|
||||
#mkdir -p artifacts
|
||||
#
|
||||
## Copy Dioxus webroot (usually at gui/dist)
|
||||
#cp -r gui/dist artifacts/webroot
|
||||
#
|
||||
## Copy backend binary (proxy)
|
||||
## Finds the built binary under target/release/
|
||||
#PROXY_PATH=$(cargo metadata --format-version=1 --no-deps |
|
||||
# jq -r '.packages[] | select(.name=="proxy") | .targets[] | select(.kind[] == "bin") | .name')
|
||||
#cp "target/release/$PROXY_PATH" "artifacts/proxy"
|
||||
#
|
||||
#echo "Artifacts have been prepared at ./artifacts"
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
mkdir -p ./cargo-tmp
|
||||
mkdir -p ./docker-target
|
||||
|
||||
rm -rf ./docker-tmp
|
||||
mkdir ./docker-tmp
|
||||
rsync -av --exclude-from=.gitignore --exclude .git/ --exclude docker-tmp/ --exclude cargo-tmp/ --exclude docker-target/ ./ ./docker-tmp/
|
||||
|
||||
docker build -f ./docker/release-builder.Dockerfile -t mumbleweb2-builder:latest .
|
||||
|
||||
docker run -it --rm \
|
||||
-v "$(pwd)/docker-tmp":/work \
|
||||
-v "$(pwd)/docker-target":/work/target \
|
||||
-v "$(pwd)/cargo-tmp/registry":/usr/local/cargo/registry \
|
||||
-v "$(pwd)/cargo-tmp/git":/usr/local/cargo/git \
|
||||
-w /work \
|
||||
mumbleweb2-builder:latest /bin/bash ./bin/build-release.sh
|
||||
Reference in New Issue
Block a user