Skip to content

Commit

Permalink
Merge pull request #555 from openziti/react_admin_create_account
Browse files Browse the repository at this point in the history
also build the console in local dev cross-builder
  • Loading branch information
qrkourier authored Feb 5, 2024
2 parents 5a1aaa6 + 251eb6e commit 2420f61
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ go.work
go.work.sum
zrok-venv

# cache used by local dev cross-build script
/.npm
npm-debug.log*
yarn-debug.log*
yarn-error.log*
Expand Down
17 changes: 13 additions & 4 deletions docker/images/cross-build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Stage 1: Install Node.js with nvm
FROM debian:bullseye-slim
#
# this file mirrors the build params used in the GitHub Actions and enables
Expand All @@ -12,23 +13,31 @@ ARG go_root=/usr/local/go
ARG go_cache=/usr/share/go_cache
ARG uid=1000
ARG gid=1000
RUN apt-get -y update
RUN apt-get -y install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf gcc-aarch64-linux-gnu
RUN apt-get -y install wget build-essential
RUN apt-get -y update \
&& apt-get -y install \
gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf gcc-aarch64-linux-gnu \
wget build-essential

COPY ./linux-build.sh /usr/local/bin/
RUN wget -q https://go.dev/dl/${go_distribution_file}
RUN tar -xzf ${go_distribution_file} -C /usr/local/

RUN wget -qO- https://deb.nodesource.com/setup_18.x | bash \
&& apt-get -y update \
&& apt-get -y install \
nodejs

RUN mkdir ${go_path} ${go_cache}
RUN chown -R ${uid}:${gid} ${go_path} ${go_cache}

COPY ./linux-build.sh /usr/local/bin/

USER ${uid}:${gid}
ENV TARGETARCH=${TARGETARCH}
ENV GOPATH=${go_path}
ENV GOROOT=${go_root}
ENV GOCACHE=${go_cache}
ENV PATH=${go_path}/bin:${go_root}/bin:$PATH

RUN go install github.com/mitchellh/gox@latest
WORKDIR /mnt
ENTRYPOINT ["linux-build.sh"]
Expand Down
15 changes: 14 additions & 1 deletion docker/images/cross-build/linux-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
#
#

set -o pipefail -e -u
set -o errexit
set -o nounset
set -o pipefail
set -o xtrace

# if no architectures supplied then default list of three
if (( ${#} )); then
Expand All @@ -31,6 +34,16 @@ else
PROCS_PER_JOB=0 # invokes gox default to use all CPUs-1
fi

(
HOME=/tmp/builder
# Navigate to the "ui" directory and run npm commands
npm config set cache /mnt/.npm
cd ./ui/
mkdir -p $HOME
npm install
npm run build
)

for ARCH in ${JOBS[@]}; do
GOX_CMD="
gox \
Expand Down

0 comments on commit 2420f61

Please sign in to comment.