From 86de855d5faa7ac2755440459438f0f9a0f8ed62 Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Mon, 13 Mar 2023 17:54:10 -0400 Subject: [PATCH] [WIP]devfile-web devfile added. Signed-off-by: Michael Valdron --- devfile.yaml | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 devfile.yaml diff --git a/devfile.yaml b/devfile.yaml new file mode 100644 index 00000000..dd6af2d4 --- /dev/null +++ b/devfile.yaml @@ -0,0 +1,89 @@ +# +# Copyright 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. +# +schemaVersion: 2.2.0 +metadata: + name: devfile-web + displayName: Devfile Web Services + description: A devworkspace of web services for devfile. + language: TypeScript + projectType: Next.js + tags: + - TypeScript + - Node.js + - Next.js + - Devfile + - Registry + - Documentation + - devfile.io + version: 1.0.0 +components: + - name: builder + image: + imageName: "{{project}}:{{imageTag}}" + autoBuild: true + dockerfile: + args: + - "PROJECT_NAME={{project}}" + buildContext: . + uri: Dockerfile + rootRequired: false + - name: runner + container: + image: "{{project}}:{{imageTag}}" + command: ['tail', '-f', '/dev/null'] + mountSources: true + memoryLimit: "{{memoryLimit}}" + endpoints: + - name: http-4200 + protocol: http + targetPort: 4200 + env: + - name: DEPLOY_CONFIG + value: "{{deployConfig}}" +commands: + # Install dependency packages & build project + - id: build + apply: + component: builder + group: + isDefault: true + kind: build + # Run tests in project + - id: test + exec: + commandLine: yarn nx test {{project}} + component: runner + group: + isDefault: true + kind: test + # Run project + - id: run + exec: + commandLine: yarn nx serve {{project}} --configuration ${DEPLOY_CONFIG} + component: runner + workingDir: ${PROJECT_SOURCE} + group: + isDefault: true + kind: run +variables: + # Web project to be run, default: landing-page + project: landing-page + # Image tag + imageTag: next + # Memory limit on runner, default: 256Mi + memoryLimit: 256Mi + # Deployment configuration to use + deployConfig: development