-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Altinn Studio CLI upgrade tool (#1408)
* basic install guide * frontend upgrade * v7->v8 migration guide
- Loading branch information
1 parent
64b7815
commit fac9a03
Showing
7 changed files
with
272 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: Altinn Studio CLI | ||
description: Command line tool for upgrading Altinn Apps | ||
weight: 60 | ||
--- | ||
|
||
The Altinn Studio CLI is a command line tool for upgrading Altinn Apps. The tool is able to fix most breaking changes between version 7 and 8 of the Altinn.App.* NuGet packages, and version 3 and 4 of the Altinn App Frontend. | ||
|
||
{{<children />}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: Altinn Studio CLI | ||
description: Kommandolinje-verktøy for oppgradering av Altinn-apper | ||
weight: 60 | ||
--- | ||
|
||
Altinn Studio CLI er et kommandolinje-verktøy for oppgradering av Altinn-apper. Verktøyet kan fikse de fleste breaking changes imellom versjon 7 og 8 av NuGet-pakkene Altinn.App.*, og imellom versjon 3 og 4 av Altinn App-Frontend. | ||
|
||
{{<children />}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
title: Installation | ||
description: How to install the Altinn Studio CLI | ||
weight: 50 | ||
--- | ||
|
||
**Note**: The Altinn Studio CLI requires .Net 8.0 or later to be installed. See [Microsoft's documentation](https://dotnet.microsoft.com/en-us/download) to install .Net 8.0. | ||
|
||
To install the CLI, run the following command in your terminal: | ||
|
||
```bash | ||
dotnet tool install -g altinn.studio.cli | ||
``` | ||
|
||
To verify that the installation was successful, run the following command: | ||
|
||
```bash | ||
altinn-studio --version | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
title: Installering | ||
description: Hvordan installere Altinn Studio CLI | ||
weight: 50 | ||
--- | ||
|
||
**NB**: Altinn Studio CLI krever at .Net 8.0 eller senere er installert. Se [Microsofts dokumentasjon](https://dotnet.microsoft.com/en-us/download) for installasjon av .Net 8.0. | ||
|
||
For å installere verktøyet, kjør følgende kommando i terminalen: | ||
|
||
```bash | ||
dotnet tool install -g altinn.studio.cli | ||
``` | ||
|
||
For å verifisere at installasjonen var vellykket, kjør følgende kommando: | ||
|
||
```bash | ||
altinn-studio --version | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
content/community/changelog/app-nuget/v8/migrating-from-v7/_index.en.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
--- | ||
title: Migration from v7 | ||
description: How to migrate from v7 to v8 | ||
weight: 50 | ||
toc: true | ||
--- | ||
|
||
{{% notice info %}} | ||
As of writing this documentation, the latest preview release of v8 is `8.0.0-preview.16`. Updated information | ||
[is available on GitHub](https://github.com/Altinn/app-lib-dotnet/releases). | ||
{{% /notice %}} | ||
|
||
## Introduction | ||
|
||
This guide will help you migrate your app from using version 7 of the app nugets to version 8. | ||
There is currently no support in Altinn Studio for upgrading apps, so using the Altinn Studio CLI is the recommended way to migrate. | ||
|
||
## Migrate automatically using the Altinn Studio CLI | ||
|
||
The Altinn Studio CLI is a command line tool for upgrading Altinn Apps. The tool is able to upgrade and fix most breaking changes between version 7 and 8 of the app nugets. | ||
|
||
### Verify that you have the latest version of the Altinn Studio CLI | ||
|
||
If you do not have the CLI installed, you can install it by following the instructions in the [installation guide](/app/cli/install). | ||
|
||
<!-- TODO: Uncomment and update version number when a new version gets released | ||
Make sure you are using at least version 1.0.0 of the altinn studio cli. You can check the version by running: | ||
```bash | ||
altinn-studio --version | ||
``` | ||
If you have an older version, you can update it by running: | ||
```bash | ||
dotnet tool update -g altinn.studio.cli | ||
``` | ||
--> | ||
|
||
### Run the upgrade command | ||
|
||
First, navigate to the root folder of your app in your terminal. There are several optional arguments you can use with the `upgrade backend` command. You can see all the available options by running: | ||
|
||
```bash | ||
altinn-studio upgrade backend --help | ||
``` | ||
|
||
The default options should work for most apps, but you may need to specify some options if you have a non-standard project structure. | ||
If some of the options are not correct, the CLI should print an error message explaining what went wrong. | ||
|
||
It is recommended to have a clean working tree before running the upgrade command. | ||
This means that you should commit or stash any changes you have made to your code before running the command. | ||
That way you can easily see what changes the CLI made to your code, as well as reset and try again if something went wrong. | ||
|
||
1. Before running the upgrade you need to first restore any dependencies: | ||
```bash | ||
dotnet restore | ||
``` | ||
2. When you are ready to upgrade, run the following command: | ||
```bash | ||
altinn-studio upgrade backend | ||
``` | ||
|
||
The CLI will then make the necessary changes to your code to upgrade it to version 8. The CLI will also print warnings and errors if it encounters any problems during the upgrade process, make sure to read these carefully. | ||
|
||
## Migrate manually | ||
|
||
1. To migrate manually from v7 to v8, you need to upgrade the nuget packages in your `App.csproj` file to version `8.0.0-preview.16`. | ||
<br><br> | ||
{{< code-title >}} | ||
App/App.csproj | ||
{{< /code-title >}} | ||
```diff | ||
- <PackageReference Include="Altinn.App.Api" Version="7.15.3"> | ||
+ <PackageReference Include="Altinn.App.Api" Version="8.0.0-preview.16"> | ||
<CopyToOutputDirectory>lib\$(TargetFramework)\*.xml</CopyToOutputDirectory> | ||
</PackageReference> | ||
- <PackageReference Include="Altinn.App.Core" Version="7.15.3" /> | ||
+ <PackageReference Include="Altinn.App.Core" Version="8.0.0-preview.16" /> | ||
<CopyToOutputDirectory>lib\$(TargetFramework)\*.xml</CopyToOutputDirectory> | ||
</PackageReference> | ||
``` | ||
2. Next, you need to fix the breaking changes in your code. See the [changelog for v8](/community/changelog/app-nuget/v8/#breaking-changes) for more information. |
6 changes: 6 additions & 0 deletions
6
content/community/changelog/app-nuget/v8/migrating-from-v7/_index.nb.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
title: Migrering fra v7 | ||
description: Hvordan migrere fra v7 til v8 | ||
weight: 50 | ||
--- | ||
|