Skip to content

Commit

Permalink
📦 Build schemas when building helm-operator image
Browse files Browse the repository at this point in the history
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
  • Loading branch information
rinx committed Dec 9, 2020
1 parent a5adfe7 commit eaf9eb0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
1 change: 1 addition & 0 deletions Makefile.d/docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ docker/build/operator/helm:
$(DOCKER_OPTS) \
-f dockers/operator/helm/Dockerfile \
-t $(REPO)/$(HELM_OPERATOR_IMAGE):$(TAG) . \
--build-arg BASE_TAG=$(TAG) \
--build-arg OPERATOR_SDK_VERSION=$(OPERATOR_SDK_VERSION)

.PHONY: docker/name/loadtest
Expand Down
33 changes: 30 additions & 3 deletions dockers/operator/helm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@ ARG VERSION="v1alpha1"
ARG GROUP="vald.vdaas.org"
ARG VALD_KIND="ValdRelease"
ARG VALD_HELM_OPERATOR_KIND="ValdHelmOperatorRelease"
ARG BASE_TAG=latest

FROM ubuntu:devel AS builder
FROM vdaas/vald-base:${BASE_TAG} AS builder
ARG OPERATOR_SDK_VERSION
ARG VERSION
ARG GROUP
ARG VALD_KIND
ARG VALD_HELM_OPERATOR_KIND

ENV ORG vdaas
ENV REPO vald

RUN { \
echo "---"; \
echo "- version: ${VERSION}"; \
Expand All @@ -38,10 +42,33 @@ RUN { \
echo " chart: helm-charts/vald-helm-operator"; \
} > /tmp/watches.yaml

WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal
COPY internal .

WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions
COPY versions .

WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/charts
COPY charts .

WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/hack
COPY hack .

WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d
COPY Makefile.d .

WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}
COPY Makefile .
COPY .git .

RUN make helm/schema/vald
RUN make helm/schema/vald-helm-operator
RUN cp -r charts /charts

FROM quay.io/operator-framework/helm-operator:${OPERATOR_SDK_VERSION}
LABEL maintainer "Vald team <vald@vdaas.org>"

COPY --from=builder /tmp/watches.yaml ${HOME}/watches.yaml

COPY charts/vald ${HOME}/helm-charts/vald
COPY charts/vald-helm-operator ${HOME}/helm-charts/vald-helm-operator
COPY --from=builder /charts/vald ${HOME}/helm-charts/vald
COPY --from=builder /charts/vald-helm-operator ${HOME}/helm-charts/vald-helm-operator

0 comments on commit eaf9eb0

Please sign in to comment.