Skip to content

Instantly share code, notes, and snippets.

@rm3l
Created March 29, 2022 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rm3l/ee9a33d87d2e650f9ba688650c8659db to your computer and use it in GitHub Desktop.
Save rm3l/ee9a33d87d2e650f9ba688650c8659db to your computer and use it in GitHub Desktop.
Devfile with image with no dockerfile buildContext field set
schemaVersion: 2.2.0
metadata:
language: javascript
name: devfile-nodejs-deploy
projectType: nodejs
variables:
CONTAINER_IMAGE: localhost:5000/devfile-nodejs-deploy:latest
commands:
- id: install
exec:
commandLine: npm install
component: runtime
group:
isDefault: true
kind: build
workingDir: $PROJECT_SOURCE
- id: run
exec:
commandLine: npm start
component: runtime
group:
isDefault: true
kind: run
workingDir: $PROJECT_SOURCE
- id: build-image
apply:
component: prod-image
- id: deploy-deployment
apply:
component: outerloop-deploy
- id: deploy-service
apply:
component: outerloop-service
- id: deploy
composite:
commands:
- build-image
- deploy-deployment
- deploy-service
group:
kind: deploy
isDefault: true
components:
- container:
endpoints:
- name: http-3000
targetPort: 3000
image: registry.access.redhat.com/ubi8/nodejs-14:latest
memoryLimit: 1024Mi
mountSources: true
name: runtime
- name: prod-image
image:
imageName: "{{CONTAINER_IMAGE}}"
dockerfile:
uri: ./Dockerfile
# buildContext: ${PROJECT_SOURCE}
- name: outerloop-deploy
kubernetes:
inlined: |
kind: Deployment
apiVersion: apps/v1
metadata:
name: devfile-nodejs-deploy
spec:
replicas: 1
selector:
matchLabels:
app: devfile-nodejs-deploy
template:
metadata:
labels:
app: devfile-nodejs-deploy
spec:
containers:
- name: main
image: "{{CONTAINER_IMAGE}}"
resources: {}
- name: outerloop-service
kubernetes:
inlined: |
apiVersion: v1
kind: Service
metadata:
labels:
app: devfile-nodejs-deploy
name: devfile-nodejs-deploy
spec:
ports:
- name: http-3000
port: 3000
protocol: TCP
targetPort: 3000
selector:
app: devfile-nodejs-deploy
type: LoadBalancer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment