Template for creating tasks for the Frends integration platform
Clone the template and change all occurences of "Frends.HIT.TaskTemplate" to "Frends.HIT.YourTaskName". Then, follow the steps below.
To manually build and upload a task, do the following
#!/bin/bash
# 1. Get the version number from the VERSION file, or specify it manually. The VERSION file should always contains the last deployed version number.
## Automatically read and increment the version
IFS=. read -r v1 v2 v3 <<< $(cat ./VERSION)
v3=$((v3 + 1))
VERSION="$v1.$v2.$v3"
## Manually specify the version
VERSION="1.0.1"
# 2. Build and package the task
dotnet pack --configuration Release --include-source --output . /p:Version=$VERSION Frends.HIT.TaskTemplate/Frends.HIT.TaskTemplate.csproj
# 3. Upload the package to the nuget feed
dotnet nuget push ./Frends.HIT.TaskTemplate.$VERSION.nupkg --source "https://feed.addr.com/nuget/Feedname/" --api-key "YourAPIKeyForThePackageFeed"
# 4. If successful, update the version file with the new version number
echo "$VERSION" > VERSION
# 1. Get the current version number from the version file and increment it
## Automatically read and increment the version
$SplitVersion = $(Get-Content -Path ./Version).ToString().Split('.')
$SplitVersion[2] = $SplitVersion[2] + 1
$VERSION = $SplitVersion.Join('.')
## Manually specify the version
$VERSION = "1.0.1"
# 2. Build and package the task
dotnet pack --configuration Release --include-source --output . /p:Version="$VERSION" Frends.HIT.TaskTemplate/Frends.HIT.TaskTemplate.csproj
# 3. Upload the package to the nuget feed
dotnet nuget push ./Frends.HIT.TaskTemplate.$VERSION.nupkg --source "https://feed.addr.com/nuget/Feedname/" --api-key "YourAPIKeyForThePackageFeed"
# 4. If successful, update the version file with the new version number
Set-Content -Path ./VERSION -Value "$VERSION"
Contains the current version of the task, automatically incremented on build
The metadata for the task project.
Contains the list of functions to expose to the Frends Integration Platform in Json format, e.g.
{
"Tasks": [
{
"TaskMethod": "Frends.HIT.TaskTemplate.Main.DoSomething"
}
]
}
Contains the main functions that are exposed to the Frends Integration Platform.
Shows this set of parameters as a separate tab in the interface instead of on the same page as the other attributes.
Contains the definitions for the data models that are used in the task
An enum is used to display a dropdown list of options to the user for a given input.
The name for the option or input field that is displayed to the user
The default value for the input field. In case of Enums (i.e. MultipleOptionEnum), default is defined as DefaultValue(MultipleOptionEnum.OptionA)
Define the field as a password, not revealing the input by default
Which type of input should be the default for the given option/parameter. Valid options are Text, Json, Expression, XML, SQL.
Only show this field if the value of OtherField is "OptionA" or "OptionB"
Contains helper functions to assist in doing various tasks
The requirements for the workflow are the following
There needs to be a file named VERSION in the root of the repository containing a 3-digit version number (e.g. 0.0.1). This will be automatically incremented for each build.
Name | Description | Value |
---|---|---|
NUGET_PKG_KEY | The NuGet feed package API key | your NuGet feed package API key |
NUGET_PKG_NAME | The name of the NuGet package, defaults to repository name | Frends.HIT.TaskTemplate |
NUGET_PKG_FEED | The URL of the nuget package feed | https://pkgrepo.somedomain.com/feeds/Frends/ |
GH_PUSH_EMAIL | The email address used for pushing the incremented version number back to the repository | autopush@developer.local |
GH_PUSH_NAME | The name to use for pushing the incremented version number back to the repository | AutoPush |
.NET Core 6.0