|
1 | 1 | --- |
2 | | -title: 3. Coding with your DevSpace |
| 2 | +title: 3. Coding with DevSpace |
3 | 3 | --- |
4 | 4 |
|
5 | | -Coding within your Devspace is as easy as coding on localhost. |
| 5 | +There are 5 central features the devspace cli is doing for you when running `devspace up`: |
| 6 | +1. Image building |
| 7 | +2. Helm chart deployment |
| 8 | +3. Port forwarding from local machine to remote containers |
| 9 | +4. File synchronization between local machine and remote containers |
| 10 | +5. Terminal access to your release pods |
6 | 11 |
|
7 | | -## Terminal Access |
8 | | -Running `devspace up` will open a terminal for you, so you can directly run commands within your DevSpace. By default, `devspace up` will use `bash` as shell and fall-back to `sh` if `bash` is not available within your container. |
| 12 | +## Image Building |
| 13 | +When you run `devspace up` for the first time, your [/Dockerfile](/docs/configuration/dockerfile.html) will be built automatically. If you run `devspace up` again, it will check if the [/Dockerfile](/docs/configuration/dockerfile.html) has been modified since the last build and only re-build if the [/Dockerfile](/docs/configuration/dockerfile.html) has changed since then. |
9 | 14 |
|
10 | | -**Note:** Use `devspace up -s /my/shell` to open the terminal with a different shell. |
| 15 | +**Note:** To force re-build your docker image, you can run `devspace up -b`. |
11 | 16 |
|
12 | | -## Port Forwarding |
13 | | -By default, `devspace up` will forward all TCP and UDP traffic on the ports your application listens on from your localhost machine to the DevSpace within your cluster. |
| 17 | +## Chart Deployment |
| 18 | +The devspace cli will deploy a helm chart in the target cluster by running `devspace up`. The deployed chart can be found locally in the `chart/` folder and can be changed as wanted. There is one special field in the `chart/values.yaml`: For each container specified under the key `containers.containerName`, the `image` property will be filled automatically after the build step. |
14 | 19 |
|
15 | | -**Note:** See [/.devspace/config.yaml configuration](/docs/configuration/config.yaml.html) for details on how to configure more advanced port forwarding procedures. |
| 20 | +If you are interested how helm charts work and how to write and adjust them, you can take a look at [helm charts](https://github.com/helm/helm/blob/master/docs/charts.md) |
16 | 21 |
|
17 | | -## Code Synchronization & Hot Reloading |
18 | | -By default, `devspace up` will automatically synchronize your source code to the `/app` folder within your DevSpace. This sync-procedure is bi-directional and allows you to use hot reloading (e.g. for using nodemon for nodejs). |
| 22 | +## Terminal Access |
| 23 | +Running `devspace up` will by default open a terminal for you, so you can directly run commands within your DevSpace. By default, `devspace up` will use `bash` as shell and fall-back to `sh` if `bash` is not available within your container. If you wish to run a different shell or command just execute `devspace up [your command or shell]` |
19 | 24 |
|
20 | | -**Note:** See [/.devspace/config.yaml configuration](/docs/configuration/config.yaml.html) for details on how to configure more advanced code synchronization procedures. |
| 25 | +By running `devspace up` the cli will automatically establish the port forwarding and sync mechanism specified in the [/.devspace/config.yaml](/docs/configuration/config.yaml.html). If you just want to access the release pod, you can also execute `devspace enter` or `devspace enter [command]`. |
21 | 26 |
|
22 | | -## Image Building |
23 | | -When you run `devspace up` for the first time, your [/Dockerfile](/docs/configuration/dockerfile.html) will be built automatically. If you run `devspace up` again, it will check if the [/Dockerfile](/docs/configuration/dockerfile.html) has been modified since the last build and only re-build if the [/Dockerfile](/docs/configuration/dockerfile.html) has changed since then. |
| 27 | +## Port Forwarding |
| 28 | +By default, `devspace up` will forward all TCP and UDP traffic on the ports your application listens to from your localhost machine to the DevSpace within your cluster. You can see the configured ports by running `devspace list port`. If you want to add a port just run `devspace add port 8080` and on the next `devspace up` the port 8080 will be forwarded from your local machine to the remote port. |
24 | 29 |
|
25 | | -**Note:** To force re-build your docker image, you can run `devspace up -b`. |
| 30 | +**Note:** See [/.devspace/config.yaml](/docs/configuration/config.yaml.html) for details on how to configure more advanced port forwarding procedures. |
| 31 | + |
| 32 | +## Code Synchronization & Hot Reloading |
| 33 | +By default a file synchronization path is configured from the project path to the release pod container path `/app`. `devspace up` will then automatically synchronize your source code and remote changes. This allows you to use hot reloading (e.g. for using nodemon for nodejs). You can change this behaviour as you want by configuring the paths in the [/.devspace/config.yaml](/docs/configuration/config.yaml.html) |
0 commit comments