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

attempt to use shared scripts for build and remove docker use #93

Merged
merged 12 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### 3.0.1
* switch pipeline.yml scripts to use internal shared scripts
### version 3.0
* update RestSharp to 109.0.1, this comes with many API breaking changes, some affecting us, see below:
* update RestSharp to 108.0.1, this comes with many API breaking changes, some affecting us, see below:
* removal of basic auth - our API no longer makes sense with RestSharp immutable clients.
* switch from newtonsoft.json to system.text.json
* add unit test project
Expand Down
46 changes: 0 additions & 46 deletions cicdscripts/BuildSolution.ps1

This file was deleted.

34 changes: 34 additions & 0 deletions cicdscripts/DownloadCICDResources.ps1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe an improvement for later but I feel we can also move this script to the common CICDResources repo as it seems to be common to projects using the repo.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I am not sure how we'd do that - this is the script that retrieves the common cicd resources... perhaps we could add something to the CI lib directly?

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<#
Purpose: Pull of the source from git
#>
$ErrorActionPreference = "Stop"

try {

#Redirecting GIT output
$env:GIT_REDIRECT_STDERR = '2>&1'

if ([string]::IsNullOrWhiteSpace($env:URL_REPO_TOOLS) -or [string]::IsNullOrWhiteSpace($env:BRANCH_TOOLS))
{
throw "The tool repository parameters had not been set properly"
}
else
{
$JUser = "$env:GITADSK_USERNAME"
$JPassword = [System.Web.HttpUtility]::UrlEncode("$env:GITADSK_PASSWORD")

$GitUrl = "https://" + "$JUser" + ":" + "$JPassword" + "@$env:URL_REPO_TOOLS"

git clone -b $env:BRANCH_TOOLS "$GitUrl" "$env:WORKSPACE\$env:COMMON_TOOLS_DIR"

if($LASTEXITCODE -ne 0)
{
throw "The download of the tools failed"
}
}

}
catch {
Write-Host $error[0]
throw $LASTEXITCODE
}
25 changes: 0 additions & 25 deletions cicdscripts/ExecuteContainerDeploy.ps1

This file was deleted.

18 changes: 0 additions & 18 deletions cicdscripts/PostDeploy.ps1

This file was deleted.

31 changes: 0 additions & 31 deletions cicdscripts/ProcessNugetPackage.ps1

This file was deleted.

46 changes: 46 additions & 0 deletions cicdscripts/PublishPackage.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[CmdletBinding()]
param (
[Parameter()]
[string[]]
$ReleaseBranches
)

$ErrorActionPreference = "Stop"

$regexBranches = @()
foreach ($branch in $ReleaseBranches -split ",")
{
$regexBranches += "(^" + $branch + "*)"
}
$regex = $regexBranches -join "|"

Write-Host $env:BRANCH_NAME
Write-Host $regex

<#
Regex matching release branches
#>
$reBranch = [regex]$regex

if ($env:BRANCH_NAME -match $reBranch)
{
try {

#deploy already built package.
$assemblyPath = "src\GregClient\bin\release"
$nupkgFile = Get-ChildItem $assemblyPath\*.nupkg -Depth 1
mjkkirschner marked this conversation as resolved.
Show resolved Hide resolved
dotnet nuget push $nupkgFile --api-key $env:API_KEY --source $env:NUGET_PUBLISH_SOURCE

if($LASTEXITCODE -ne 0) {
throw "The package-generation process failed"
}
}
catch {
Write-Host $error[0]
throw $LASTEXITCODE
}
}
else
{
Write-Host("Deployment is skipped because this is not a release branch")
}
26 changes: 0 additions & 26 deletions cicdscripts/RestartDockerDesktop.ps1

This file was deleted.

30 changes: 0 additions & 30 deletions cicdscripts/SetupHost.ps1

This file was deleted.

59 changes: 38 additions & 21 deletions pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
version: 0.1.1
env:
- JENKINS_NODE_WIN: "DynamoDockerWin"
- JENKINS_NODE_WIN: "Dynamo_Win_Perf"
- SLACK_QUANTUM_BUILD_CHANNEL : "#dynamo-jenkinsbuild"
- SLACK_QUANTUM_BUILD_CREDENTIAL_ID : "slack-notify-token"
- MAIL_QUANTUM_BUILD_RECIPIENT : "[email protected]"
- DOCKER_WORKSPACE : "c:\\Greg"
- NUGETTOOL : "Nuget\\nuget.exe"
- DOCKER_CONTAINER : "buildContainer"
- HARMONY_REPO : "DynamoDS/PackageManagerClient"
- URL_REPO_TOOLS : "git.autodesk.com/Dynamo/CICDResources.git"
- BRANCH_TOOLS : "master"
- NUGET_PUBLISH_SOURCE: "https://api.nuget.org/v3/index.json"



check_changelog_updated_on_pr: true
pipeline_os: "Windows"
force_slack_notification : true
language: csharp
use_garasign: true


schedule:
cron_schedule: "once_a_week"
Expand All @@ -22,28 +26,20 @@ jenkins_creds:
type: secretText
credentialsId: dynamovisualprogramming_nuget_api_key
secretText: APIKEY
-
type: usernamePassword
credentialsId: local-svc_p_ors
username: GITADSK_USERNAME
password: GITADSK_PASSWORD

build:
-
setup_proj_deps : true
solution: src\\GregClient.sln
scripts:
- "pwsh.exe -ExecutionPolicy ByPass -File .\\cicdscripts\\SetupHost.ps1"
- "pwsh.exe -ExecutionPolicy ByPass -File .\\cicdscripts\\BuildSolution.ps1"

soc2:
harmony:
hidden_email_list: dynamo_ws_access
repository: env.HARMONY_REPO
third_party_lib_paths:
- "bin\\release"

deployment:
-
type: customized
scripts:
- "pwsh.exe -ExecutionPolicy ByPass -File .\\cicdscripts\\ExecuteContainerDeploy.ps1"
- "pwsh.exe -ExecutionPolicy ByPass -File .\\cicdscripts\\PostDeploy.ps1"

- "pwsh.exe -ExecutionPolicy ByPass -File .\\cicdscripts\\DownloadCICDResources.ps1"
- "pwsh.exe -ExecutionPolicy ByPass -File .\\%COMMON_TOOLS_DIR%\\scripts\\SetupHost.ps1"
- "msbuild src\\GregClient.sln /p:Configuration=Release"
ci_test:
tests:
-
Expand All @@ -55,4 +51,25 @@ ci_test:
format: "junit"
pattern: "*.xml"

soc2:
harmony:
hidden_email_list: dynamo_ws_access
third_party_lib_paths:
- "src\\GregClient\\bin\\Release\\net8.0\\"
mjkkirschner marked this conversation as resolved.
Show resolved Hide resolved

deployment:

-
type: sign
files_to_sign:
- "src\\GregClient\\bin\\Release\\net8.0\\greg.dll"
-
type: customized
scripts:
- "pwsh.exe -ExecutionPolicy ByPass -File .\\cicdscripts\\scripts\\PublishPackage.ps1 -ReleaseBranches master"
mjkkirschner marked this conversation as resolved.
Show resolved Hide resolved






4 changes: 2 additions & 2 deletions src/AssemblyInfoGenerator/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
// to distinguish one build from another. AssemblyFileVersion is specified
// in AssemblyVersionInfo.cs so that it can be easily incremented by the
// automated build process.
[assembly: AssemblyVersion("3.0.0.2886")]
[assembly: AssemblyVersion("3.0.1.4167")]


// By default, the "Product version" shown in the file properties window is
Expand All @@ -55,4 +55,4 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("3.0.0.2886")]
[assembly: AssemblyFileVersion("3.0.1.4167")]
2 changes: 1 addition & 1 deletion src/AssemblyInfoGenerator/AssemblyInfo.tt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ using System.Runtime.InteropServices;
<#+
int MajorVersion = 3;
int MinorVersion = 0;
int BuildNumber = 0;
int BuildNumber = 1;
// The datetime baseline we choose using this algorithm will affect build number and all nuget packages uploaded
// Please only change when major or minor version got incremented
int RevisionNumber = ((int)(DateTime.UtcNow - new DateTime(2023,1,1)).TotalDays)*10+((int)DateTime.UtcNow.Hour)/3;
Expand Down
Loading
Loading