Skip to content

Commit

Permalink
chore: build strategy based on containers with cached layers
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Riobo Lorenzo <[email protected]>
  • Loading branch information
adrianriobo committed May 10, 2024
1 parent a2a650e commit fc4a76b
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 3 deletions.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CONTAINER_MANAGER ?= podman

IMG ?= quay.io/redhat-developer/openshift-local-extension:latest
IMG_CACHE ?= quay.io/rhqp/openshift-local-extension-cache:latest

# Build the container cache image
.PHONY: build-cache
build-cache:
${CONTAINER_MANAGER} build -t ${IMG_CACHE} -f oci/Containerfile.cache .

.PHONY: build
build:
${CONTAINER_MANAGER} build -t ${IMG} -f oci/Containerfile.multistage .
23 changes: 23 additions & 0 deletions oci/Containerfile.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# Copyright (C) 2023 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

FROM registry.access.redhat.com/ubi9/nodejs-20

COPY package.json .

RUN npm install yarn --global \
&& yarn --frozen-lockfile --network-timeout 180000
36 changes: 36 additions & 0 deletions oci/Containerfile.multistage
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# Copyright (C) 2023 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

FROM quay.io/rhqp/openshift-local-extension-cache:latest AS builder

COPY . .

RUN yarn --network-timeout 180000 \
&& yarn build

FROM scratch

LABEL org.opencontainers.image.title="Red Hat OpenShift Local" \
org.opencontainers.image.description="Integration for Red Hat OpenShift Local clusters" \
org.opencontainers.image.vendor="redhat" \
io.podman-desktop.api.version=">= 0.16.0"

COPY package.json /extension/
COPY LICENSE /extension/
COPY icon.png /extension/
COPY README.md /extension/
COPY --from=builder /opt/app-root/src/dist /extension/dist
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
"name": "openshift-local",
"displayName": "Red Hat OpenShift Local",
"description": "Integration for Red Hat OpenShift Local clusters",
"version": "1.3.0",
"version": "1.4.0-next",
"icon": "icon.png",
"license": "Apache-2.0",
"engines": {
"podman-desktop": "^0.16.0"
"node": ">=18.12.0",
"npm": ">=8.19.2"
},
"main": "./dist/extension.js",
"source": "./src/extension.ts",
Expand Down Expand Up @@ -80,7 +81,7 @@
"@typescript-eslint/eslint-plugin": "^5.55.0",
"@typescript-eslint/parser": "^5.55.0",
"compare-versions": "^6.0.0-rc.1",
"eslint": "^8.36.0",
"eslint": "^8.56.0",
"got": "^12.5.3",
"hasha": "^5.2.2",
"mkdirp": "^2.1.3",
Expand Down

0 comments on commit fc4a76b

Please sign in to comment.