Skip to content

Commit 5e74505

Browse files
Merge pull request #7410 from andysterland/dev/andster/devinitDocUpdates
Expanding devinit docs
2 parents 023f52f + f4dffb2 commit 5e74505

9 files changed

+51
-21
lines changed

docs/devinit/devinit-and-codespaces.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,49 @@ ms.technology: devinit
1616

1717
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.
1818

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.
2025

2126
You can also execute `devinit init -f <path to .devinit.json>` from the Visual Studio Integrated Terminal once connected to your codespace.
2227

2328
## Examples
2429

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.
2735

2836
```json
2937
{
3038
"postCreateCommand": "devinit init"
3139
}
3240
```
3341

42+
When the `.devinit.json` is in another directory, the -f flag may be used.
43+
44+
```json
45+
{
46+
"postCreateCommand": "devinit init -f path\\to\\.devinit.json"
47+
}
48+
49+
```
50+
3451
```json
3552
{
3653
"postCreateCommand": ["<some other command>", "devinit init"]
3754
}
3855
```
3956

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+
4059
### 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.
4262

4363
```json
4464
{
@@ -48,13 +68,13 @@ In this example _.devcontainer.json_ file below is placed in the repo root and `
4868

4969
### From a terminal prompt
5070

51-
When the current working directory contains a _.devinit.json_ file.
71+
When the current working directory contains a `.devinit.json` file.
5272

5373
```console
5474
devinit init
5575
```
5676

57-
When the _.devinit.json_ is in another directory.
77+
When the `.devinit.json` is in another directory.
5878

5979
```console
6080
devinit init -f path/to/.devinit.json

docs/devinit/devinit-commands.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ ms.technology: devinit
2020
devinit init
2121
```
2222

23-
Initialize the environment by running the tools specified in a [_.devinit.json_](devinit-json.md) file in the current working directory.
23+
Initialize the environment by running the tools specified in a [.devinit.json](devinit-json.md) file.
2424

2525
### Options for init
2626

2727
Optional options for the `devinit init` command.
2828

2929
| Argument | Required | Description |
3030
|----------------------|----------|---------------------------------------------------------------------------|
31-
| -f,--file | No | Path to the _.devinit.json_ file. |
31+
| -f,--file | No | Path to the `.devinit.json` file. |
3232
| --error-action | No | Specifies how to handle errors. Options: Stop, Ignore, Continue (default).|
3333
| -v,--verbose | No | Emit verbose output. |
3434
| -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
9292
| 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. |
9393
| 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. |
9494

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+
9599
#### --verbose switch
96100

97101
Emit verbose output to standard output. If the tool to be executed supports a verbose option, propagate the verbose switch to the tool.

docs/devinit/devinit-json.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ ms.technology: devinit
1414
---
1515
# devinit configuration file
1616

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+
1719
## File location
1820

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:
2022

2123
* {current-directory}\\.devinit.json
2224
* {current-directory}\\devinit.json
@@ -30,7 +32,7 @@ The `devinit.exe init` command is driven via the _.devinit.json_ file. By defaul
3032
> [!NOTE]
3133
> If multiple default files are found, then devinit will use the file that appears first in the above list.
3234
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.
3436

3537
### Directories and relative paths
3638

docs/devinit/getting-started-with-devinit.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@ ms.technology: devinit
1414
---
1515
# Getting Started with devinit
1616

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+
1721
## Step 1: Get devinit
1822

1923
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.
2024

2125
## Step 2: Define your environment
2226

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`.
2428

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).
2630

2731
## Step 3: Enjoy!
2832

@@ -32,4 +36,4 @@ Now all someone has to do after cloning your repo is run `devinit init`.
3236
devinit init
3337
```
3438

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).

docs/devinit/sample-dotnet-runtime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The _packages.config_ file is a [Chocolatey](https://chocolatey.org/) file that
3939

4040
## .devinit.json
4141

42-
Contents of the [_.devinit.json_](devinit-json.md) file. This file needs to be in the same folder as _.devcontainer.json_ file.
42+
Contents of the [`.devinit.json`](devinit-json.md) file. This file needs to be in the same folder as the _.devcontainer.json_ file.
4343

4444
```json
4545
{

docs/devinit/sample-eshoponweb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ dotnet ef database update -c appidentitydbcontext -p src\Infrastructure\Infrastr
2828

2929
## .devinit.json
3030

31-
Contents of the [_.devinit.json_](devinit-json.md) file. This file needs to be in the same folder as _.devcontainer.json_.
31+
Contents of the [`.devinit.json`](devinit-json.md) file. This file needs to be in the same folder as _.devcontainer.json_.
3232

3333
```json
3434
{

docs/devinit/sample-private-preview.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
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.
44
ms.date: 08/28/2020
55
ms.topic: reference
66
author: andysterland
@@ -12,13 +12,13 @@ monikerRange: ">= vs-2019"
1212
ms.prod: visual-studio-windows
1313
ms.technology: devinit
1414
---
15-
# Private preview
15+
# Private beta
1616

1717
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.
1818

1919
## .devinit.json
2020

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_.
2222

2323
```json
2424
{

docs/devinit/sample-readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The table below contains a list of all the currently available examples for usin
2020
|---------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|---|
2121
| [**All tools**](sample-all-tool.md) | Example of using all the tools. | |
2222
| [**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. | |
2424
| [**Open CV**](sample-opencv.md) | Example of the customizations required by the OpenCV project. | |
2525
| [**.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. | |
2626
| [**.NET Core App**](sample-dotnet-core.md) | Example of a repository that uses devinit to install the required .NET Core SDK. | |

docs/devinit/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
href: sample-eshoponweb.md
8282
- name: OpenCV repo
8383
href: sample-opencv.md
84-
- name: Codespaces private preview
84+
- name: Codespaces private beta
8585
href: sample-private-preview.md
8686
- name: .NET Core App
8787
href: sample-dotnet-core.md

0 commit comments

Comments
 (0)