mirror of
https://github.com/luxfi/cli.git
synced 2026-10-30 17:01:20 +00:00
Update CLI for genesis Fix import paths from ethereum/go-ethereum to luxfi/geth - Replace all ethereum/go-ethereum imports with luxfi/geth - Add local rawdb package for unexported constants - Fix build errors in genesis tools - Add comprehensive migration documentation - Create build-all.sh script for building all tools - Clean up duplicate functions and unused imports Fix remaining imports Update CLI Remove symlink Remove local replace directives Update Update old templates
45 lines
963 B
Bash
45 lines
963 B
Bash
#!/usr/bin/env bash
|
|
|
|
if [ -d {{ .CustomVMRepoDir }} ]; then
|
|
rm -rf {{ .CustomVMRepoDir }}
|
|
fi
|
|
mkdir -p {{ .CustomVMRepoDir }}
|
|
|
|
# prepare build script
|
|
cd {{ .CustomVMRepoDir }}
|
|
cat <<EOF >>build.sh
|
|
#!/usr/bin/env bash
|
|
set -x
|
|
git init -q
|
|
git remote add origin {{ .CustomVMRepoURL }}
|
|
git fetch --depth 1 origin {{ .CustomVMBranch }} -q
|
|
git checkout {{ .CustomVMBranch }}
|
|
chmod +x {{ .CustomVMBuildScript }}
|
|
./{{ .CustomVMBuildScript }} {{ .VMBinaryPath }}
|
|
echo {{ .VMBinaryPath }} [ok]
|
|
EOF
|
|
chmod +x build.sh
|
|
|
|
#prepare build Dockerfile
|
|
cat <<EOF >>Dockerfile
|
|
FROM golang:{{ .GoVersion }}-bullseye AS builder
|
|
RUN apt-get update
|
|
RUN apt-get install -y git ca-certificates
|
|
RUN mkdir -p {{ .CustomVMRepoDir }}
|
|
WORKDIR {{ .CustomVMRepoDir }}
|
|
COPY build.sh .
|
|
RUN ./build.sh
|
|
|
|
FROM scratch AS vm
|
|
COPY --from=builder {{ .VMBinaryPath }} /
|
|
EOF
|
|
|
|
VMBinaryDir=$(dirname {{ .VMBinaryPath }})
|
|
# build
|
|
docker buildx build --target=vm --output type=local,dest=${VMBinaryDir} .
|
|
|
|
|
|
|
|
|
|
|