wip, migrate all scripts to new build pattern (Makefile + multiple GH agents).

This commit is contained in:
Jason Kulatunga
2022-07-06 21:39:33 -07:00
parent 316ce856f7
commit 4a16ca0d5a
10 changed files with 148 additions and 152 deletions
+7 -6
View File
@@ -1,3 +1,8 @@
########################################################################################################################
# Collector Image
########################################################################################################################
########
FROM golang:1.17-bullseye as backendbuild
@@ -5,9 +10,7 @@ WORKDIR /go/src/github.com/analogj/scrutiny
COPY . /go/src/github.com/analogj/scrutiny
RUN go mod vendor && \
go build -ldflags '-w -extldflags "-static"' -o scrutiny-collector-selftest collector/cmd/collector-selftest/collector-selftest.go && \
go build -ldflags '-w -extldflags "-static"' -o scrutiny-collector-metrics collector/cmd/collector-metrics/collector-metrics.go
RUN make binary-clean binary-collector
########
FROM debian:bullseye-slim as runtime
@@ -18,10 +21,8 @@ RUN apt-get update && apt-get install -y cron smartmontools ca-certificates tzda
COPY /docker/entrypoint-collector.sh /entrypoint-collector.sh
COPY /rootfs/etc/cron.d/scrutiny /etc/cron.d/scrutiny
COPY --from=backendbuild /go/src/github.com/analogj/scrutiny/scrutiny-collector-selftest /opt/scrutiny/bin/
COPY --from=backendbuild /go/src/github.com/analogj/scrutiny/scrutiny-collector-metrics /opt/scrutiny/bin/
RUN chmod +x /opt/scrutiny/bin/scrutiny-collector-selftest && \
chmod +x /opt/scrutiny/bin/scrutiny-collector-metrics && \
RUN chmod +x /opt/scrutiny/bin/scrutiny-collector-metrics && \
chmod +x /entrypoint-collector.sh && \
chmod 0644 /etc/cron.d/scrutiny && \
rm -f /etc/cron.daily/apt /etc/cron.daily/dpkg /etc/cron.daily/passwd