Skip to content

Commit

Permalink
Add CI containerfile for portal javascript build (#3397)
Browse files Browse the repository at this point in the history
* Add CI containerfile for portal NPM commands + makefile target

* Update docs to reflect new envvar for makefile, including a reasonable default for local dev: NO_CACHE
  • Loading branch information
SudoBrendan committed Mar 20, 2024
1 parent c38242f commit c9b7d81
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
13 changes: 13 additions & 0 deletions Dockerfile.ci-portal
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ARG REGISTRY

FROM ${REGISTRY}/ubi8/nodejs-16 AS portal-base
WORKDIR /build/portal/v2
USER root

FROM portal-base AS portal-build
COPY /portal/v2/package*.json ./
RUN npm ci
RUN npm audit --omit=dev
COPY /portal/v2/ ./
RUN npm run lint
RUN npm run build
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ COMMIT = $(shell git rev-parse --short=7 HEAD)$(shell [[ $$(git status --porcela
ARO_IMAGE_BASE = ${RP_IMAGE_ACR}.azurecr.io/aro
E2E_FLAGS ?= -test.v --ginkgo.v --ginkgo.timeout 180m --ginkgo.flake-attempts=2 --ginkgo.junit-report=e2e-report.xml
GO_FLAGS ?= -tags=containers_image_openpgp,exclude_graphdriver_btrfs,exclude_graphdriver_devicemapper
NO_CACHE ?= true

export GOFLAGS=$(GO_FLAGS)

Expand Down Expand Up @@ -75,6 +76,9 @@ clean:
client: generate
hack/build-client.sh "${AUTOREST_IMAGE}" 2020-04-30 2021-09-01-preview 2022-04-01 2022-09-04 2023-04-01 2023-07-01-preview 2023-09-04 2023-11-22 2024-08-12-preview

ci-portal:
docker build . -f Dockerfile.ci-portal --build-arg REGISTRY=$(REGISTRY) --no-cache=$(NO_CACHE)

# TODO: hard coding dev-config.yaml is clunky; it is also probably convenient to
# override COMMIT.
deploy:
Expand Down Expand Up @@ -266,4 +270,4 @@ vendor:
install-go-tools:
go install ${GOTESTSUM}

.PHONY: admin.kubeconfig aks.kubeconfig aro az clean client deploy dev-config.yaml discoverycache generate image-aro-multistage image-fluentbit image-proxy lint-go runlocal-rp proxy publish-image-aro-multistage publish-image-fluentbit publish-image-proxy secrets secrets-update e2e.test tunnel test-e2e test-go test-python vendor build-all validate-go unit-test-go coverage-go validate-fips install-go-tools
.PHONY: admin.kubeconfig aks.kubeconfig aro az ci-portal clean client deploy dev-config.yaml discoverycache generate image-aro-multistage image-fluentbit image-proxy lint-go runlocal-rp proxy publish-image-aro-multistage publish-image-fluentbit publish-image-proxy secrets secrets-update e2e.test tunnel test-e2e test-go test-python vendor build-all validate-go unit-test-go coverage-go validate-fips install-go-tools
1 change: 1 addition & 0 deletions env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export LOCATION=eastus
export ARO_IMAGE=arointsvc.azurecr.io/aro:latest
export NO_CACHE=false

. secrets/env

0 comments on commit c9b7d81

Please sign in to comment.