Friday, September 6, 2024

CI/CD for Git pipeline for java

1) download PortableGit-2.46.0-64-bit

2) modify E:\PortableGit-2.46.0-64-bit.7z\etc\gitconfig to remove credentialselector window

[core]

symlinks = false

autocrlf = true

fscache = true

[color]

interactive = true

ui = auto

[help]

format = html

[diff "astextplain"]

textconv = astextplain

[rebase]

autosquash = true

[filter "lfs"]

clean = git-lfs clean -- %f

smudge = git-lfs smudge -- %f

process = git-lfs filter-process

required = true

[credential]

helper = !\"E:/PortableGit-2.46.0-64-bit.7z/mingw64/bin/git-credential-manager.exe\"

3) create package

e:\nuget.exe pack L:\TFS_CATS\FamlinkClassic\sacwis-libraries\Sprint-Active\master\sacwis-web-java\Package.nuspec -OutputDirectory L:\TFS_CATS\FamlinkClassic\sacwis-libraries\Sprint-Active\master\sacwis-web-java\

4)  push package to feed

#e:\nuget.exe push L:\TFS_CATS\FamlinkClassic\sacwis-libraries\Sprint-Active\master\JspcCompile\Jasperlib.1.0.0.nupkg -src #http://dshsutoly3dut06:8080/tfs/CATS/_packaging/test/nuget/v2 -ApiKey DSHSVSTS

5) register package if not registered yet.

$nuget = Get-PackageSource | Where-Object -filterscript {$_.Name -eq 'sawcislib'}

if($nuget -eq $null){Register-PackageSource -Force -Name sawcislib -Location http://dshsutoly3dut06:8080/tfs/CATS/_packaging/test/nuget/v2 -ProviderName NuGet}else{Write-Output 'sawcislib has been registered'}

6) install package

Install-Package -Force -Name sawcislib -Destination $(Build.SourcesDirectory) -Source sawcislib -MinimumVersion 1.0.3 -MaximumVersion 1.0.3

No comments:

Post a Comment