Skip to content

parent tests #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/devfile/library
go 1.13

require (
github.com/devfile/api/v2 v2.0.0-20210713153530-f78ab9de1a30
github.com/devfile/api/v2 v2.0.0-20210804191700-4f7b6856e70a
github.com/fatih/color v1.7.0
github.com/gobwas/glob v0.2.3
github.com/golang/mock v1.5.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/devfile/api/v2 v2.0.0-20210713153530-f78ab9de1a30 h1:DL1o2U9NuS2KpVHva5h3tbIReJfF1LkSTJFj+JRiqJg=
github.com/devfile/api/v2 v2.0.0-20210713153530-f78ab9de1a30/go.mod h1:QNzaIVQnCsYfXed+QZOn1uvEQFzyhvpi/uc3g/b2ws0=
github.com/devfile/api/v2 v2.0.0-20210804191700-4f7b6856e70a h1:mvnXqJAjmdrsUltkE3sOh29UcI+0jKQ8kKKXYkWArNc=
github.com/devfile/api/v2 v2.0.0-20210804191700-4f7b6856e70a/go.mod h1:QNzaIVQnCsYfXed+QZOn1uvEQFzyhvpi/uc3g/b2ws0=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
Expand Down
82 changes: 82 additions & 0 deletions tests/v2/devfiles/samples/Parent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
schemaVersion: 2.1.0
commands:
- apply:
component: testcontainerparent1
group:
kind: test
isDefault: true
label: JXTVtfYNNsaiQcqFSwTavCaBlRGMaBOXaxXsgDRxFxsNxbuHfGQuQjBwJWJVmHd
id: testapplyparentcommand1
- id: run
exec:
component: testcontainerparent1
commandLine: npm start
workingDir: /project
group:
kind: run
isDefault: true
hotReloadCapable: true
- id: test
composite:
commands: [testapplyparentcommand1]
group:
kind: debug
label: testcompositeparent1
parallel: true
components:
- container:
image: mKrpiOQnyGZ00003
name: testcontainerparent1
- kubernetes:
inlined: |
apiVersion: batch/v1
kind: Job
metadata:
name: pi
spec:
template:
spec:
containers:
- name: job
image: myimage
command: ["some", "command"]
restartPolicy: Never
name: testkubeparent1
- openshift:
uri: openshift.yaml
name: openshiftcomponent1
projects:
- name: petclinic
git:
remotes:
origin: "https://github.com/spring-projects/spring-petclinic.git"
checkoutFrom:
remote: origin
revision: main
- name: petclinic-dev
zip:
location: https://github.com/spring-projects/spring-petclinic/archive/refs/heads/main.zip
attributes:
editorFree: true
user: default
starterProjects:
- name: user-app
git:
remotes:
origin: 'https://github.com/OpenLiberty/application-stack-starters.git'
description: An Open Liberty Starter project
subDir: /app
attributes:
workingDir: /home
- name: user-app2
zip:
location: 'https://github.com/OpenLiberty/application-stack-starters.zip'
attributes: #only applicable to v2.1.0
category: parentdevfile
title: This is a parent devfile
variables: #only applicable to v2.1.0
version: 2.0.0
tag: parent
lastUpdated: "2020"


46 changes: 46 additions & 0 deletions tests/v2/devfiles/samples/Test_Parent_KubeCRD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
schemaVersion: 2.1.0
parent:
kubernetes:
name: testkubeparent1
namespace: default
commands:
- apply:
component: devbuild
group:
kind: build #override
isDefault: false #override
label: testcontainerparent1 #override
id: applycommand
components:
- container:
image: updatedimage #override
name: devbuild
projects:
- name: parentproject
git:
remotes:
neworigin: "https://github.com/spring-projects/spring-petclinic2.git" #override, should result in 2 remotes in flattened file
checkoutFrom:
remote: neworigin #override
revision: main #override
- name: parentproject2
zip:
location: "https://github.com/spring-projects/spring-petclinic2.zip" #override
starterProjects:
- name: parentstarterproject
git:
remotes:
origin: "https://github.com/spring-projects/spring-petclinic2.git" #override
checkoutFrom:
remote: origin
revision: master #override
attributes: # only applicable to v2.1.0
category: mainDevfile #override
title: This is a main devfile #override
variables: #only applicable to v2.1.0
version: 2.1.0 #override
tag: main #override




95 changes: 95 additions & 0 deletions tests/v2/devfiles/samples/Test_Parent_LocalURI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
schemaVersion: 2.1.0
parent:
uri: "Parent.yaml"
commands:
- apply:
component: testcontainer1 #override, point to a container in the main devfile
group:
kind: test
isDefault: false #override
label: testcontainerparent #override
id: testapplyparentcommand1
- id: run
exec:
component: testcontainerparent1
commandLine: npm install #override
workingDir: /project2 #override
env: #addition, does not exist in parent
- name: PATH
value: /dir
- name: USER
value: user1
group:
kind: build #override
isDefault: false #override
hotReloadCapable: false #override
- id: test
composite:
commands: [testapplyparentcommand1, run] #override
group:
kind: debug
label: testcompositeparent1
parallel: false #override
components:
- kubernetes:
inlined: | #override
apiVersion: batch/v1
kind: Pod
metadata:
name: pi
namespace: dev
spec:
template:
spec:
containers:
- name: newJob
image: myimage
command: ["some", "command"]
restartPolicy: Never
name: testkubeparent1
- openshift:
uri: openshift2.yaml #override
name: openshiftcomponent1
- container:
image: updatedimage #override
name: testcontainerparent1
projects:
- name: petclinic
git:
remotes:
neworigin: "https://github.com/spring-projects/spring-petclinic2.git" #override, should result in 2 remotes in flattened file
checkoutFrom:
remote: neworigin #override
revision: master #override
- name: petclinic-dev
zip:
location: https://github.com/spring-projects/spring-petclinic/petclinic.zip #override
clonePath: /petclinic #overrides the default
attributes:
editorFree: false #override
user: user1 #override
starterProjects:
- name: user-app
git:
remotes:
origin: 'https://github.com/OpenLiberty/application-stack-starters-new.git' #override
description: An Open Liberty Starter project override #override
subDir: /newapp #override
attributes: #add additional attributes
env: test
user: user1
attributes: # only applicable to v2.1.0
category: mainDevfile #override
title: This is a main devfile #override
variables: #only applicable to v2.1.0
version: 2.1.0 #override
tag: main #override
lastUpdated: "2021" #override
components:
- container:
image: mKrpiOQnyGZ00003
name: testcontainer1




29 changes: 29 additions & 0 deletions tests/v2/devfiles/samples/Test_Parent_RegistryURL.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
schemaVersion: 2.1.0
parent:
id: nodejs
registryUrl: "https://registry.stage.devfile.io"
commands:
- id: run
exec:
component: runtime
commandLine: npm install #override
workingDir: /project2 #override
components:
- name: runtime
container:
image: registry.access.redhat.com/ubi8/nodejs-14:dev #override
memoryLimit: 2048Mi #override
mountSources: false #override
sourceMapping: /project2 #override
endpoints:
- name: http-9080 #this will result in a second endpoint
targetPort: 9080
starterProjects:
- name: nodejs-starter
git:
remotes:
origin: "https://github.com/odo-devfiles/nodejs-ex2.git" #override




Loading