Skip to content

Instantly share code, notes, and snippets.

@feloy
Created November 17, 2021 14:28
Show Gist options
  • Save feloy/3260e57f38d2eaa5519da669ea4d34d2 to your computer and use it in GitHub Desktop.
Save feloy/3260e57f38d2eaa5519da669ea4d34d2 to your computer and use it in GitHub Desktop.
devfile with inner and outer loop
commands:
- exec:
commandLine: npm install
component: runtime
group:
isDefault: true
kind: build
workingDir: /project
id: install
- exec:
commandLine: npm start
component: runtime
group:
isDefault: true
kind: run
workingDir: /project
id: run
- exec:
commandLine: npm run debug
component: runtime
group:
isDefault: true
kind: debug
workingDir: /project
id: debug
- exec:
commandLine: npm test
component: runtime
group:
isDefault: true
kind: test
workingDir: /project
id: test
- apply:
component: outerloop-build
id: build-image
- apply:
component: outerloop-deploy
id: deployk8s
- apply:
component: myredis
id: deploy-redis
- composite:
commands:
- build-image
- deployk8s
- deploy-redis
group:
isDefault: true
kind: deploy
id: deploy
components:
- image:
dockerfile:
buildContext: ${PROJECT_ROOT}
rootRequired: false
uri: ./utils/Dockerfile
imageName: quay.io/phmartin/myimage
name: outerloop-build
- kubernetes:
inlined: |
kind: Deployment
apiVersion: apps/v1
metadata:
name: my-node
spec:
replicas: 1
selector:
matchLabels:
app: node-app
template:
metadata:
labels:
app: node-app
spec:
containers:
- name: my-node
image: quay.io/phmartin/myimage
ports:
- name: http
containerPort: 3001
protocol: TCP
resources:
limits:
memory: "128Mi"
cpu: "500m"
name: outerloop-deploy
- container:
endpoints:
- name: http-3000
targetPort: 3000
image: registry.access.redhat.com/ubi8/nodejs-14:latest
memoryLimit: 1024Mi
mountSources: true
sourceMapping: /project
name: runtime
- kubernetes:
uri: kubernetes/odo-service-myredis.yaml
name: myredis
metadata:
description: Stack with Node.js 14
displayName: Node.js Runtime
language: nodejs
name: nodejs
projectType: nodejs
tags:
- NodeJS
- Express
- ubi8
version: 1.0.1
schemaVersion: 2.2.0
variables:
COMPONENT_NAME: my-node
CONTAINER_IMAGE: quay.io/phmartin/myimage
PORT: "3001"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment