Skip to content

Commit

Permalink
[WIP]devfile-web devfile added.
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Valdron <[email protected]>
  • Loading branch information
michael-valdron committed Mar 27, 2023
1 parent 16e3731 commit 86de855
Showing 1 changed file with 89 additions and 0 deletions.
89 changes: 89 additions & 0 deletions devfile.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 86de855

Please sign in to comment.