Files
odo/docs/website/devfile.yaml
Armel Soro 803718a655 [Dogfooding] Create website deploy previews for PRs using odo deploy (#6871)
* Add 'deploy' command in Devfile to support outer-loop case for the website

The goal is to leverage this for creating PR deploy previews
in an automated way.

* Add GitHub Workflow to create Deploy previews for PRs using 'odo deploy'

* Leverage the image-names-as-selector feature

* Add odo binary location to system path to make it easier to use it

* Do not change the Devfile name dynamically

We are using a robot account on quay.io,
which requires specific permissions per repository name,
which cannot be dynamic in this case.

Since we are scoping everything per namespace, it should be fine.
2023-06-15 09:58:00 -04:00

96 lines
1.7 KiB
YAML

schemaVersion: 2.2.0
metadata:
name: odo-dev
description: Website for odo, the developer-focused CLI for container development
displayName: odo.dev
icon: https://odo.dev/img/logo.png
version: 3.12.0
tags:
- NodeJS
- React
- Docusaurus
- odo
variables:
DEPLOY_RESOURCE_NAME: odo-dev
DEPLOY_CONTAINER_IMAGE: odo-dev-webapp
DEPLOY_INGRESS_DOMAIN: 127.0.0.1.nip.io
components:
- name: doc-runtime
container:
image: registry.access.redhat.com/ubi8/nodejs-16:latest
memoryLimit: 512Mi
command: ['tail']
args: ['-f', '/dev/null']
endpoints:
- name: http-doc
targetPort: 3000
- name: outerloop-build
image:
imageName: "{{DEPLOY_CONTAINER_IMAGE}}"
dockerfile:
uri: ./Dockerfile
buildContext: ${PROJECT_SOURCE}
rootRequired: false
- name: outerloop-resources
kubernetes:
uri: ".kubernetes/resources.yaml"
commands:
- id: 0-install-yarn
exec:
commandLine: npm install --global yarn
component: doc-runtime
#
# Build
#
- id: doc-install-deps
exec:
commandLine: yarn
component: doc-runtime
workingDir: ${PROJECT_SOURCE}
group:
kind: build
isDefault: true
#
# Run
#
- id: doc-start
exec:
commandLine: yarn start
component: doc-runtime
hotReloadCapable: true
workingDir: ${PROJECT_SOURCE}
group:
kind: run
isDefault: true
#
# Deploy
#
- id: 2-deploy
composite:
commands:
- 20-build-image
- 21-k8s-resources
group:
isDefault: true
kind: deploy
- id: 20-build-image
apply:
component: outerloop-build
- id: 21-k8s-resources
apply:
component: outerloop-resources
events:
postStart:
- 0-install-yarn