Skip to content
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

Sqlpackage CLI wrpper #1209

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 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
15 changes: 15 additions & 0 deletions azure-pipelines.qodana.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
pool:
vmImage: 'ubuntu-latest'

jobs:
- job: QodanaScan
displayName: 'Qodana Scan'
steps:
- task: Cache@2 # Not required, but Qodana will open projects with cache faster.
inputs:
key: '"$(Build.Repository.Name)" | "$(Build.SourceBranchName)" | "$(Build.SourceVersion)"'
path: '$(Agent.TempDirectory)/qodana/cache'
restoreKeys: |
"$(Build.Repository.Name)" | "$(Build.SourceBranchName)"
"$(Build.Repository.Name)"
- task: QodanaScan@2023
39 changes: 39 additions & 0 deletions docs/01-getting-started/01-installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: Installation
---

Before you can set up a build project, you need to install NUKE's dedicated [.NET global tool](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools):

```powershell
# terminal-command
dotnet tool install Nuke.GlobalTool --global
```

From now on, you can use the global tool to:

- [Set up new builds](02-setup.md)
- [Run existing builds](03-execution.md)
- [Leverage shell completion](../06-global-tool/00-shell-completion.md)
- [Add tool & library packages](../06-global-tool/01-packages.md)
- [Navigate around root directories](../06-global-tool/03-navigation.md)
- [Convert CAKE build scripts](../06-global-tool/04-cake.md)
- [Manage secrets in parameter files](../06-global-tool/02-secrets.md)

:::note
If you're running on Linux-based systems, it's worth checking if the `nuke` global tool is available. This can be verified with `where nuke`. If the global tool is not found, you have to manually add `$HOME/.dotnet/tools` to your terminal configuration:

<Tabs>
<TabItem value="zsh" label="Zsh" default>

```powershell
# terminal-command
echo 'export PATH=$HOME/.dotnet/tools:$PATH' >> ~/.zshrc
```

</TabItem>
</Tabs>
:::

:::info
While theoretically, you could use NUKE by only adding its main NuGet package, we highly recommend using the dedicated global tool to set up new builds. This ensures that your repository will run consistently in different environments and that your build implementation is always properly formatted.
:::
142 changes: 142 additions & 0 deletions docs/01-getting-started/02-setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
---
title: Build Setup
---

import AsciinemaPlayer from '@site/src/components/AsciinemaPlayer';

After [installing the NUKE global tool](01-installation.md), you can call it from anywhere on your machine to set up a new build:

```powershell
# terminal-command
nuke :setup
```

:::tip
Preferably, you should run the setup from inside an existing repository. NUKE will search for the next upwards `.git` or `.svn` directory to determine the _build root directory_. If neither is found, it will use the current directory. You can also pass the `--root` parameter to specify that the current directory should be used as a root directory.
:::

During the setup, you'll be asked several questions to configure your build to your preferences:

<p style={{maxWidth:'700px'}}>
<AsciinemaPlayer
src="/casts/setup.cast"
idleTimeLimit={2}
// autoplay={true}
poster="npt:5.715135"
preload={true}
// terminalFontFamily="'JetBrains Mono', Consolas, Menlo, 'Bitstream Vera Sans Mono', monospace"
loop={true}/>
</p>

**Congratulations!** 🥳 Your first build has now been set up, and you can [run the build](03-execution.md) with the default implementation!

## Effective Changes

The setup will create a number of files in your repository and – if you've chosen so – add the build project to your solution file. Below, you can examine the structure of added files and what they are used for:

```bash
<root-directory>
├── .nuke # Root directory marker
│ ├── build.schema.json # Build schema file
│ └── parameters.json # Default parameters file
├── build
│ ├── .editorconfig # Common formatting
│ ├── _build.csproj # Build project file
│ ├── _build.csproj.DotSettings # ReSharper/Rider formatting
│ ├── Build.cs # Default build implementation
│ ├── Directory.Build.props # MSBuild stop files
│ └── Directory.Build.targets
├── build.cmd # Cross-platform bootstrapping
├── build.ps1 # Windows/PowerShell bootstrapping
└── build.sh # Linux/Shell bootstrapping
```

:::note
If you prefer, you _may_ choose to delete any of the bootstrapping scripts, MSBuild stop files, or formatting settings. For instance, when you're sure that no other MSBuild files will interfere with the build project, or you don't rely on either Roslyn or ReSharper/Rider for formatting. However, note that the **bootstrapping scripts play an essential role** in CI/CD environments, and are also used for the configuration generation feature.
:::

## Project Structure

While you can enjoy writing most build-relevant logic inside your build console applications, there is still a large number of files involved in the general process of build automation. NUKE organizes these files in different folders as linked files in the build project for you:

<Tabs>
<TabItem value="config" label="Config" default>

```powershell
<root-directory>
├── .nuke
│ ├── parameters.json # Parameters files
│ └── parameters.*.json
├── GitVersion.yml # GitVersion configuration
├── global.json # SDK version
├── nuget.config # NuGet feeds configuration
└── version.json # Nerdbank GitVersioning configuration
```

</TabItem>
<TabItem value="ci" label="CI/CD">

```powershell
<root-directory>
├── .github
│ └── workflows # GitHub Actions
│ └── *.yml
├── .teamcity # TeamCity
│ └── settings.kts
├── .gitlab-ci.yml # GitLab CI
├── .space.kts # JetBrains Space
├── .travis.yml # Travis CI
├── appveyor.yml # AppVeyor
├── appveyor.*.yml
├── azure-pipelines.yml # Azure Pipelines
├── azure-pipelines.*.yml
└── bitrise.yml # Bitrise
```

</TabItem>
<TabItem value="bootstrappers" label="Bootstrappers">

```powershell
<root-directory>
├── build.cmd # Cross-platform
├── build.ps1 # Windows/PowerShell
└── build.sh # Linux/Shell
```

</TabItem>
<TabItem value="auto-imports" label="MSBuild&nbsp;Auto&#8209;Imports">

```powershell
<root-directory>
└── **
├── Directory.Build.props
└── Directory.Build.targets
```

</TabItem>
</Tabs>

:::info
You can deactivate linking of the above files by removing the `NukeRootDirectory` and `NukeScriptDirectory` properties from the build project file.

```xml title="_build.csproj"
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
// highlight-start
<!-- <NukeRootDirectory>..</NukeRootDirectory> -->
<!-- <NukeScriptDirectory>..</NukeScriptDirectory> -->
// highlight-end
</PropertyGroup>

</Project>
```

:::

[^1]: Interface default members behave like explicit interface implementations, which means that to access their members, the `this` reference must be cast explicitly to the interface type. For instance, `((IComponent)this).Target`.
Loading