You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/devinit/devinit-and-codespaces.md
+26-6Lines changed: 26 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -16,29 +16,49 @@ ms.technology: devinit
16
16
17
17
devinit is a great compliment to [GitHub Codespaces](https://github.com/features/codespaces) and devinit can be used to get a codespace setup so contributors can build, run, and debug right away.
18
18
19
-
To integrate with GitHub Codespaces, `devinit` needs to be called from the `postCreateCommand` defined in a `.devcontainer.json` file placed in the repo root. The string(s) in `postCreateCommand` are executed in the default shell, after the repo is cloned in the codespace. You can read more about `postCreateCommand` in the GitHub Codespaces [customization documentation](https://docs.github.com/github/developing-online-with-codespaces/configuring-codespaces-for-your-project). To add the `devinit` command, you can add `devinit init` to the `postCreateCommand` as shown in the examples below.
19
+
> [!IMPORTANT]
20
+
> Before integrating devinit with your codespace, you first need to make sure you have a `.devinit.json` file that defines your dependencies. For more information on how to create a `.devinit.json`, read the [getting started documentation](getting-started-with-devinit.md).
21
+
22
+
Inside of a GitHub Codespace, your application is built and run in the cloud. Being in the cloud means that your application doesn't have access to local resources on your machines. These include tools or programs that you have installed locally. If your application needs any system-wide dependencies to be installed or configured, it needs to be done on each codespace. The easiest way to achieve that is to use a `.devinit.json` file.
23
+
24
+
To make sure that a codespace is created with the dependencies your application needs, `devinit` needs to be run when the codespace is created. This can be done by calling `devinit init` from the `postCreateCommand` defined in a `.devcontainer.json` file placed in the repository root. The string(s) in `postCreateCommand` are executed in the default shell, after the repo is cloned in the codespace. You can read more about `postCreateCommand` in the GitHub Codespaces [customization documentation](https://docs.github.com/github/developing-online-with-codespaces/configuring-codespaces-for-your-project). To add the `devinit` command, you can add `devinit init` to the `postCreateCommand` as shown in the examples below.
20
25
21
26
You can also execute `devinit init -f <path to .devinit.json>` from the Visual Studio Integrated Terminal once connected to your codespace.
22
27
23
28
## Examples
24
29
25
-
### With a .devinit.json file
26
-
In this example, the _.devcontainer.json_ file below is placed in the repo root alongside the _.devinit.json_ file. The files can also be placed in a _.devcontainer_ directory.
30
+
In both examples below, the `.devinit.json` is in the repository root alongside `.devcontainer.json`.
31
+
32
+
### With a .devcontainer.json file
33
+
34
+
In this example, the `.devcontainer.json` file below is placed in the repo root alongside the `.devinit.json` file. The files can also be placed in a `.devcontainer` directory.
27
35
28
36
```json
29
37
{
30
38
"postCreateCommand": "devinit init"
31
39
}
32
40
```
33
41
42
+
When the `.devinit.json` is in another directory, the -f flag may be used.
"postCreateCommand": ["<some other command>", "devinit init"]
37
54
}
38
55
```
39
56
57
+
You can find more examples of using devinit in our [documentation](sample-all-tool.md) and on GitHub in the [.NET Core example](https://github.com/microsoft/devinit-example-dotnet-core) and [Node.js example](https://github.com/microsoft/devinit-example-nodejs) repositories.
58
+
40
59
### As commands
41
-
In this example _.devcontainer.json_ file below is placed in the repo root and `devinit run` is being called programmatically to run a tool
60
+
61
+
In this example, `.devcontainer.json` file below is placed in the repo root and `devinit run` is being called directly from the command line to run an individual tool.
42
62
43
63
```json
44
64
{
@@ -48,13 +68,13 @@ In this example _.devcontainer.json_ file below is placed in the repo root and `
48
68
49
69
### From a terminal prompt
50
70
51
-
When the current working directory contains a _.devinit.json_ file.
71
+
When the current working directory contains a `.devinit.json` file.
| -f,--file | No | Path to the _.devinit.json_ file. |
31
+
| -f,--file | No | Path to the `.devinit.json` file. |
32
32
| --error-action | No | Specifies how to handle errors. Options: Stop, Ignore, Continue (default).|
33
33
| -v,--verbose | No | Emit verbose output. |
34
34
| -n,--dry-run | No | Dry run. |
@@ -92,6 +92,10 @@ Specifies the action to take if a tool returns a non-zero exit code. The valid v
92
92
| ignore | Continue processing other tools after emitting a warning to standard output. DevInit process exit code should always be zero (success). The `ignore` setting ignores all errors. |
93
93
| stop | Emits an error to standard error and stops processing tools. The devinit.exe exit code is non-zero (failure). This is similar to the continue error action, but processing is halted at the first error encountered. `stop` is the default error-action for all commands except init. |
94
94
95
+
#### --dry-run switch
96
+
97
+
Echo tool commands that would be run. Some tools may take further action as documented for that tool.
98
+
95
99
#### --verbose switch
96
100
97
101
Emit verbose output to standard output. If the tool to be executed supports a verbose option, propagate the verbose switch to the tool.
Copy file name to clipboardExpand all lines: docs/devinit/devinit-json.md
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,11 @@ ms.technology: devinit
14
14
---
15
15
# devinit configuration file
16
16
17
+
The `.devinit.json` file defines the system-wide dependencies that your application needs in order to run and build. System-wide dependencies are things like Node.js, SQL Server, IIS, RabbitMQ, Docker, etc. These are the sort of things you would normally install on your dev box that aren't installed by a specific repo. It's not a place to define application-specific dependencies like you would in package managers such as NuGet or NPM. It is, however, a place to define that you need those package managers.
18
+
17
19
## File location
18
20
19
-
The `devinit.exe init` command is driven via the _.devinit.json_ file. By default, `devinit.exe` looks for the file in the following locations:
21
+
The `devinit init` command is driven via the `.devinit.json` file. By default, `devinit` looks for the file in the following locations:
20
22
21
23
* {current-directory}\\.devinit.json
22
24
* {current-directory}\\devinit.json
@@ -30,7 +32,7 @@ The `devinit.exe init` command is driven via the _.devinit.json_ file. By defaul
30
32
> [!NOTE]
31
33
> If multiple default files are found, then devinit will use the file that appears first in the above list.
32
34
33
-
The _.devinit.json_ file can also be specified explicitly via the `--file`/`-f` option.
35
+
The `.devinit.json` file can also be specified explicitly via the `--file`/`-f` option.
Copy file name to clipboardExpand all lines: docs/devinit/getting-started-with-devinit.md
+7-3Lines changed: 7 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -14,15 +14,19 @@ ms.technology: devinit
14
14
---
15
15
# Getting Started with devinit
16
16
17
+
devinit is a tool that you can use to enable anyone to get to code and be productive in your repository by running a simple command. You can use devinit to define all the system-wide dependencies that your repository needs something like SQL server, Node.js, Docker, or IIS. Devinit can invoke other tools and package managers to install what your repository needs. You define those dependencies in a JSON file named [.devinit.json](devinit-json.md) and then the next person to use your repository just has to run [`devinit init`](devinit-commands.md#init) to install all those dependencies. So, rather than spending half a day onboarding onto a new repository, it can be done in minutes.
18
+
19
+
devinit isn't a package manager or a Virtual Machine (VM) configuration tool in and of itself. It's a task runner for a manifest file, named [.devinit.json](devinit-json.md), that defines the system-wide dependencies that your application needs. To install these dependencies, devinit makes use of tools that you might already be using, such as [Chocolatey](https://chocolatey.org). You can review the available tools in the [full list](devinit-tool-list.md). By using these tools rather than distributing software directly, devinit gives you the convenience of using the tool of your choice and enabling you to use existing configurations, for example, a [packages.config](https://chocolatey.org/docs/commands-install#packagesconfig) file for Chocolatey.
20
+
17
21
## Step 1: Get devinit
18
22
19
23
devinit is currently only available as part of GitHub Codespaces when using Visual Studio and is accessible from the integrated terminal in Visual Studio. In the future, devinit will be available as part of Visual Studio.
20
24
21
25
## Step 2: Define your environment
22
26
23
-
The most important step is to define your 'developer' environment in a [_.devinit.json_ file](devinit-json.md). This file will be used by devinit to create your environment when you run `devinit init`.
27
+
The most important step is to define your 'development' environment in a [.devinit.json file](devinit-json.md). This file will be used by devinit to create your environment when you run `devinit init`.
24
28
25
-
For this step, think about the instructions you'd give someone to get up and running with a project repository. For example, do they need to have SQL installed? A specific version of .NET Core? etc. Then for each of those dependencies, look for a corresponding devinit tool in the [list of tools](devinit-tool-list.md) and add that to the repository's _.devinit.json_ file.
29
+
For this step, think about the instructions you'd give someone to get up and running with a project repository. For example, do they need to have SQL installed? A specific version of .NET Core? And so on. Then for each of those dependencies, look for a corresponding devinit tool in the [list of tools](devinit-tool-list.md) and add that to the repository's `.devinit.json` file. You can also see a selection of examples over in the [samples documentation](sample-readme.md).
26
30
27
31
## Step 3: Enjoy!
28
32
@@ -32,4 +36,4 @@ Now all someone has to do after cloning your repo is run `devinit init`.
32
36
devinit init
33
37
```
34
38
35
-
If you're using [GitHub Codespaces](https://github.com/features/codespaces), you can configure `devinit init` to run automatically when the codespace is provisioned. To learn more have a look at the [devinit and GitHub Codespaces documentation](devinit-and-codespaces.md).
39
+
If you're using [GitHub Codespaces](https://github.com/features/codespaces), you can configure `devinit init` to run automatically when the codespace is provisioned. To learn more, have a look at the [devinit and GitHub Codespaces documentation](devinit-and-codespaces.md).
Copy file name to clipboardExpand all lines: docs/devinit/sample-private-preview.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
-
title: Private Preview
3
-
description: Example customizations used in the GitHub Codespaces Visual Studio preview beta repo.
2
+
title: Private beta
3
+
description: Example customizations used in the GitHub Codespaces Visual Studio preview beta repository.
4
4
ms.date: 08/28/2020
5
5
ms.topic: reference
6
6
author: andysterland
@@ -12,13 +12,13 @@ monikerRange: ">= vs-2019"
12
12
ms.prod: visual-studio-windows
13
13
ms.technology: devinit
14
14
---
15
-
# Private preview
15
+
# Private beta
16
16
17
17
This example illustrates how to customize a codespace for Visual Studio to have the same features as the initial [GitHub Codespaces](https://github.com/features/codespaces) private beta.
18
18
19
19
## .devinit.json
20
20
21
-
Contents of the [_.devinit.json_](devinit-json.md) file. This file needs to be in the same folder as _.devcontainer.json_.
21
+
Contents of the [`.devinit.json`](devinit-json.md) file. This file needs to be in the same folder as _.devcontainer.json_.
|[**All tools**](sample-all-tool.md)| Example of using all the tools. ||
22
22
|[**eShopOnWeb**](sample-eshoponweb.md)| Example of customizing the [dotnet-architecture/eshoponweb](https://github.com/dotnet-architecture/eShopOnWeb) app. ||
23
-
|[**Private Preview**](sample-private-preview.md)| Example of the customizations used in the GitHub Codespaces Visual Studio private beta. ||
23
+
|[**Private beta**](sample-private-preview.md)| Example of the customizations used in the GitHub Codespaces Visual Studio private beta. ||
24
24
|[**Open CV**](sample-opencv.md)| Example of the customizations required by the OpenCV project. ||
25
25
|[**.NET Core Runtime**](sample-dotnet-runtime.md)| Example of the customizations required by the .NET Core Runtime [dotnet/runtime](https://github.com/dotnet/runtime) project. ||
26
26
|[**.NET Core App**](sample-dotnet-core.md)| Example of a repository that uses devinit to install the required .NET Core SDK. ||
0 commit comments