Skip to content

Commit f8c5931

Browse files
authored
Merge pull request #1970 from FabianKramm/master
fix: small fixes & examples update
2 parents 67f63ff + 40b2e23 commit f8c5931

27 files changed

Lines changed: 3106 additions & 1683 deletions

File tree

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
1-
version: v1beta11
1+
version: v2beta1
2+
name: buildkit-in-cluster
3+
4+
# Define an image to use
25
vars:
3-
- name: IMAGE
4-
value: myusername/devspace
6+
IMAGE: myusername/devspace
7+
8+
# Build the dockerfile with buildkit
59
images:
6-
default:
10+
my-image:
711
image: ${IMAGE}
8-
build:
9-
buildKit:
12+
buildKit:
1013
inCluster: {}
14+
15+
# Deploy the built image with helm and the component chart
1116
deployments:
12-
- name: quickstart
17+
my-deployment:
18+
updateImageTags: true
1319
helm:
14-
componentChart: true
1520
values:
1621
containers:
1722
- image: ${IMAGE}
18-
service:
19-
ports:
20-
- port: 3000
23+
24+
# Is started after images were built and deployments deployed
2125
dev:
22-
ports:
23-
- imageSelector: ${IMAGE}
24-
forward:
25-
- port: 3000
26-
sync:
27-
- imageSelector: ${IMAGE}
28-
excludePaths:
29-
- node_modules
26+
my-dev:
27+
imageSelector: ${IMAGE}
28+
logs: {}
29+
ports:
30+
- port: 3000
31+
sync:
32+
- path: ./
33+
excludePaths:
34+
- node_modules

examples/buildkit/devspace.yaml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,33 @@
1-
version: v1beta11
1+
version: v2beta1
2+
name: buildkit
3+
4+
# Define an image to use
25
vars:
3-
- name: IMAGE
4-
value: myusername/devspace
6+
IMAGE: myusername/devspace
7+
8+
# Build the dockerfile with buildkit
59
images:
6-
default:
10+
my-image:
711
image: ${IMAGE}
8-
build:
9-
buildKit: {}
12+
buildKit: {}
13+
14+
# Deploy the built image with helm and the component chart
1015
deployments:
11-
- name: quickstart
16+
my-deployment:
17+
updateImageTags: true
1218
helm:
13-
componentChart: true
1419
values:
1520
containers:
1621
- image: ${IMAGE}
17-
service:
18-
ports:
19-
- port: 3000
22+
23+
# Is started after images were built and deployments deployed
2024
dev:
21-
ports:
22-
- imageSelector: ${IMAGE}
23-
forward:
24-
- port: 3000
25-
sync:
26-
- imageSelector: ${IMAGE}
25+
my-dev:
26+
imageSelector: ${IMAGE}
27+
logs: {}
28+
ports:
29+
- port: 3000
30+
sync:
31+
- path: ./
2732
excludePaths:
28-
- node_modules
33+
- node_modules
Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,36 @@
11
# Note: This example only works in minikube, since the custom builder
22
# does not push the image
3-
version: v1beta11
3+
version: v2beta1
4+
name: custom-builder
5+
46
vars:
5-
- name: IMAGE
6-
value: myusername/devspace
7+
IMAGE: myusername/devspace
8+
79
images:
8-
default:
10+
my-image:
911
image: ${IMAGE}
10-
build:
11-
custom:
12-
skipImageArg: true
13-
command: |-
14-
# Also works on windows as this is executed in a golang shell
15-
docker build -t ${runtime.images.default.image}:${runtime.images.default.tag} . -f custom/Dockerfile
16-
onChange:
17-
- main.go
12+
custom:
13+
command: |-
14+
# Also works on windows as this is executed in a pseudo shell
15+
docker build -t ${runtime.images.my-image.image}:${runtime.images.my-image.tag} . -f custom/Dockerfile
16+
onChange:
17+
- main.go
18+
1819
deployments:
19-
- name: devspace-default
20-
kubectl:
21-
manifests:
22-
- kube
20+
my-deployment:
21+
updateImageTags: true
22+
kubectl:
23+
manifests:
24+
- kube
25+
2326
dev:
24-
ports:
25-
- imageSelector: ${IMAGE}
26-
forward:
27+
my-dev:
28+
imageSelector: ${IMAGE}
29+
logs: {}
30+
command: ["go", "run", "main.go"]
31+
ports:
2732
- port: 8080
28-
sync:
29-
- imageSelector: ${IMAGE}
33+
sync:
34+
- path: ./
35+
onUpload:
36+
restartContainer: true

examples/dependencies/dependency1/devspace.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,3 @@ deployments:
1212
values:
1313
containers:
1414
- image: ${IMAGE}
15-
hooks:
16-
- command: "echo 'Hello from dependency1'"
17-
events: ["before:build:*"]
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1-
version: v1beta11
1+
version: v2beta1
2+
23
dependencies:
3-
- name: dependency1
4-
source:
4+
dependency1:
55
path: dependency1
6-
- name: dependency2
7-
source:
6+
dependency2:
87
path: dependency2
9-
# Use dev.ports config from dependency2
10-
dev:
11-
ports: true
12-
- name: dependency3
13-
source:
8+
pipeline: dev # Allow ports etc from dependency2
9+
dependency3:
1410
git: https://github.com/devspace-cloud/example-dependency.git
11+
1512
dev:
16-
# Open terminal to the pod with the imageName created in dependency1
17-
terminal:
18-
imageSelector: image(dependency1.default)
13+
my-dev:
14+
imageSelector: ${runtime.dependencies.dependency1.images.default}
15+
terminal: {}
1916

examples/hooks/Dockerfile

Lines changed: 0 additions & 8 deletions
This file was deleted.

examples/hooks/devspace.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.

examples/hooks/go.mod

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/hooks/main.go

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,29 @@
1-
version: v1beta11
1+
version: v2beta1
2+
name: hot-reload-container-restart
3+
24
vars:
3-
- name: IMAGE
4-
value: myusername/devspace
5+
IMAGE: myusername/devspace
6+
57
images:
6-
default:
8+
my-image:
79
image: ${IMAGE}
8-
# this option tells devspace to automatically wrap the Dockerfile entrypoint in memory
9-
# with a small restart helper script so that the process can be easily restarted from within the
10-
# container. This should work with most Dockerfiles that have an ENTRYPOINT statement.
11-
# This will also work for build targets.
12-
# Note: If you override the entrypoint in the kubernetes yaml via the Pod.spec.containers.command,
13-
# please make sure you wrap the command with the devspace script '/devspace-restart-helper'
14-
injectRestartHelper: true
15-
# If you don't have an entrypoint defined in your Dockerfile, you can also define an entrypoint here
16-
# entrypoint: ["go"]
17-
# cmd: ["run", "main.go"]
10+
1811
deployments:
19-
- name: quickstart
20-
helm:
21-
componentChart: true
22-
values:
23-
containers:
24-
- image: ${IMAGE}
25-
service:
26-
ports:
27-
- port: 8080
12+
my-deployment:
13+
updateImageTags: true
14+
helm:
15+
values:
16+
containers:
17+
- image: ${IMAGE}
18+
2819
dev:
29-
ports:
30-
- imageSelector: ${IMAGE}
31-
forward:
20+
my-dev:
21+
imageSelector: ${IMAGE}
22+
command: ["go", "run", "main.go"] # Needed so that DevSpace knows which command to restart
23+
logs: {}
24+
ports:
3225
- port: 8080
33-
sync:
34-
- imageSelector: ${IMAGE}
35-
onUpload:
36-
# this option tells devspace to restart the container process if something changes within
37-
# the container. This obviously only works if the restart helper script is present in the container.
38-
# You can either manually add the restart script or add the injectRestartHelper option to the image
39-
restartContainer: true
26+
sync:
27+
- path: ./
28+
onUpload:
29+
restartContainer: true

0 commit comments

Comments
 (0)