Closed samcro1967 closed 6 months ago
Ah, that'll be from me removing the build artifacts from GitHub - https://github.com/release-argus/Argus/commit/0a228d64f52bf35bfdd7b45ea455315f79d6345a
Sorry! I did this as I read that they shouldn't really be uploaded and they were causing thousands of line changes with any changes to the web components. Also, removes the human error part of forgetting to push the built changes.
You're gonna need to build the web component with nodejs - make build
(Am currently switching from CreateReactApp to Vite as CRA is deprecated. Vite seems to build quicker)
make build fails with the following:
+ make build
cd web/ui && npx update-browserslist-db@latest -y && npm install
/bin/sh: 1: npx: not found
make: *** [Makefile:26: web-install] Error 127
Ah, I'll stop this breaking the build in my Vite commit later today
cd $(UI_PATH) && { npx update-browserslist-db@latest -y || true; } && npm install
This should be resolved now with the latest commits. Could you check again for me please @samcro1967?
After doing git clone https://github.com/release-argus/Argus.git and running make build, I am seeing:
make build
cd web/ui && { npx --yes update-browserslist-db@latest || true; } && npm install
/bin/sh: 1: npx: not found
/bin/sh: 1: npm: not found
make: *** [Makefile:26: web-install] Error 127
The npm: not found
bit will be the issue here. You'll need to install npm in order to build the web frontend
ARG DEBIAN_VERSION="bookworm"
ARG GO_VERSION="1.22"
ARG NODE_VERSION="20"
FROM golang:${GO_VERSION}-${DEBIAN_VERSION} as go_builder
FROM node:${NODE_VERSION}-${DEBIAN_VERSION} AS base
COPY --from=go_builder /usr/local/go/ /usr/local/go/
ENV PATH="/usr/local/go/bin:${PATH}"
RUN npm install -g npm@latest
COPY . /build/
WORKDIR /build/
ARG BUILD_VERSION="development"
RUN make BUILD_VERSION=${BUILD_VERSION} go-build
RUN chmod 755 /build/argus
RUN chmod 755 /build/healthcheck
I have this as the base for the Dockerfile. It copies go
into a node
image, builds argus
, then in the main alpine
iamge, I simply copy over that built binary
I was able to make this work in my drone.io pipeline using the node:latest image and running the following commands:
- curl -sL https://go.dev/VERSION?m=text | grep -oP '^go[0-9]+\.[0-9]+\.[0-9]+'
- wget -q "https://go.dev/dl/go1.22.2.linux-amd64.tar.gz" -O go-latest.tar.gz
- tar -C /usr/local -xzf go-latest.tar.gz
- export PATH=$PATH:/usr/local/go/bin
- go version
- make build
Have not quite figured out yet how to get it to dynamically install the latest version of go, but will solve that another time.
You could get the latest version of go
with this:
wget "https://go.dev/dl/$(curl https://go.dev/VERSION\?m\=text | head -n1).linux-amd64.tar.gz"
You triggered me to look into getting the automated release binaries to use the latest patch version (which it hasn't been since 1.21.0 as they changed the go.mod
to require the patch version). https://github.com/release-argus/Argus/commit/e35f66f63cd0f41b691ad4e87496995c66c17249 seems to have got it using the latest patch
I noticed yesterday that the Argus build in my pipeline started failing 7 days ago. Build logs are below.
Dockerfile build logs