forked from redhat-developer/odo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue with
build-images
and deploy
not working with Docker if…
… optional `buildContext` field is not set in Devfile (redhat-developer#5600) (redhat-developer#5657) * Add unit test highlighting the issue * Add integration tests to both `build-images` and `deploy` highlighting the issue * Use the Devfile directory as default build context path if not defined Per the Devfile spec [1], `buildContext` should be optional. [1] https://devfile.io/docs/devfile/2.2.0/user-guide/api-reference/ * Quote the build context path value
- Loading branch information
Showing
5 changed files
with
215 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
...s/source/devfiles/nodejs/issue-5600-devfile-with-image-component-and-no-buildContext.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
commands: | ||
- exec: | ||
commandLine: npm install | ||
component: runtime | ||
group: | ||
isDefault: true | ||
kind: build | ||
workingDir: $PROJECT_SOURCE | ||
id: install | ||
- exec: | ||
commandLine: npm start | ||
component: runtime | ||
group: | ||
isDefault: true | ||
kind: run | ||
workingDir: $PROJECT_SOURCE | ||
id: run | ||
- apply: | ||
component: prod-image | ||
id: build-image | ||
- apply: | ||
component: outerloop-deploy | ||
id: deploy-deployment | ||
- apply: | ||
component: outerloop-service | ||
id: deploy-service | ||
- composite: | ||
commands: | ||
- build-image | ||
- deploy-deployment | ||
- deploy-service | ||
group: | ||
isDefault: true | ||
kind: deploy | ||
id: deploy | ||
components: | ||
- container: | ||
endpoints: | ||
- name: http-3000 | ||
targetPort: 3000 | ||
image: registry.access.redhat.com/ubi8/nodejs-14:0.1.0 | ||
memoryLimit: 1024Mi | ||
mountSources: true | ||
name: runtime | ||
- image: | ||
dockerfile: | ||
uri: ./Dockerfile | ||
imageName: localhost:5000/devfile-nodejs-deploy:0.1.0 | ||
name: prod-image | ||
- 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: "localhost:5000/devfile-nodejs-deploy:0.1.0" | ||
resources: {} | ||
name: outerloop-deploy | ||
- 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 | ||
name: outerloop-service | ||
metadata: | ||
language: javascript | ||
name: my-nodejs-without-buildctx | ||
projectType: nodejs | ||
schemaVersion: 2.2.0 | ||
variables: | ||
CONTAINER_IMAGE: localhost:5000/devfile-nodejs-deploy:0.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters