My I know what should I put in WhatShouldIPutInHere? I want to push my nuget to my team city server. it is on localhost:90. Thanks
[Exec] C:\TeamCity\buildAgent\work\f091ac5edf11aa03\packages\OctoPack.3.5.2\build\OctoPack.targets(109, 5): error MSB3073: The command ""C:\TeamCity\buildAgent\work\f091ac5edf11aa03\packages\OctoPack.3.5.2\build\nuget.exe" push "C:\TeamCity\buildAgent\work\f091ac5edf11aa03\TodoWebApp\obj\octopacked\TodoWebApp.1.0.26.nupkg" MyAPiKey -Source WhatShouldIPutInHere? "
A regular nuget push (what OctoPack is trying to do) is not going to work.
The TeamCity documentation states
You can publish packages to the feed either as build artifacts of the NuGet Pack build step (using the Publish created packages to build artifacts checkbox, packages will be indexed asynchronously) or via the NuGet Publish build step (since TeamCity 2017.1, packages will be indexed synchronously)
Make sure that OctoPack only creates a package (and not trying to push it) and make it an artifact to add it to the TeamCity NuGet Server.
Related
I am new to DevOps. I will explain my structure first.
Project 1>
Repo 1
Repo 2
I am trying to make two build pipelines one that will build Repo 1 and a second that will build repo 2.
Repo 2 has a dependency on Repo1.dll.
I understand that I can publish the Repo1.dll and then download the artifact in repo2's pipeline.
My trouble is, our developers normal workflow is to have both repo's running in debug on their machines using a project reference. I am having trouble understanding how to reference Repo 1 from Repo 2 in a way that the artifact can be used in DevOps and project reference can be used on the developers machines.
How should c# references be handled when working with DevOps artifacts?
The best way to do this is using the NuGet.
When you build Repo 1 and create the nuget package Package1. Then publish this package Package1 to the Azure devops feed.
Now, add this package Package1 to the solution2 in the Visual Studio from the feed.
When we update the repo1, we need to build the NuGet package, publish it to the feed, then update the refernces package version to refer to the package you just publish.
I have a class library that I often need to debug/step-into that I distribute and use as a nuget package to Azure DevOps Artifacts feed.
To create the package, I run the following commands using nuget.exe v5.4:
nuget spec
I then enter data in the .nuspec file. Then I run:
nuget pack myLibrary.csproj -Symbols -SymbolPackageFormat snupkg
This generates both the nuget package file and the snupkg symbol file in the current working directory.
I then push this up to our Artifacts feed using the VSTS Credential Provider:
nuget push -Source "MyPackageSource" -ApiKey VSTS myLibrary.nupkg
This general spec, pack, push method works fine.
It was my understanding that pushing the .nupkg file would also push up the .snupkg symbol file with it as long as it's in the same directory as per this documentation:
You can also push both primary and symbol packages at the same time
using the below command. Both .nupkg and .snupkg files need to be
present in the current folder.
nuget push MyPackage.nupkg
However, after installing the package, I am not able to step-into the package code. I also don't see anything new in the package install folder. Just the standard nupkg and the dll. How do I push up the symbols and subsequently get them to install?
You can check your logs to be sure (the log should tell you the snupkg was pushed, just as it does for nupkg files, if it was indeed pushed).
My understanding is that Azure DevOps doesn't support snupkg packages, so I expect that it does not get pushed. However, Azure Pipeline has a built-in "Index Sources & Publish Symbols task" which you can use. Rather than creating a symbols package, just point it directly to your pdbs.
We have a TeamCity build server and for a time were had the internal Nuget server enabled. We'd generate Nuget packages, which it'd automatically publish to the nuget feed.
We've since moved to another Nuget server and disabled the TC internal Nuget server; additionally we started building Nuget packages using OctoPack in some configurations which never built them before. The problem is that these Nuget packages seem to automatically be added to the build configuration's Artifacts. This is a waste, since the same packages are being published to the external (to TeamCity) Nuget server.
Is there a setting which automatically will find and include Nuget packages in TeamCity's artifacts, or is it just doing this on its own? I cant even explicitly exclude the packages in the configuration's artifacts setting, they get included regardless.
TeamCity is version 2018.1.2.
New packages in built-in TeamCity NuGet feeds could be added via the followings ways.
So to avoid publishing produced nuget packages as a build artifacts inspect:
Artifact paths settings in your build configuration
NuGet Pack build steps settings: uncheck "Publish created packages to build artifacts" option
NuGet Publish build steps settings: don't specify TeamCity built-in NuGet feed URLs in "Package source" field.
I am using a LinqPad script to automate an internal health check via AppVeyor.
The script references a custom nuget package hosted on our appveyor account.
The build does the following:
Pulls down a GitHub repo
via LPRUN executes health-check.linq
Locally this works.
On AppVeyor it does not.
I have the following build process
SETUP
Via chocolatey --> install Linqpad5
choco install linqpad5
BUILD
nuget install Example.Package
[this is our own NUGET package hosted on AppVeyor [SUCCESS]]
xcopy "c:\projects\example_project\utilities" %AppData%\LINQPad\ /i
[copy our custom NuGetSources.xml file containing our nuget repo location to linqpads folder]
cd "C:\Program Files (x86)\LINQPad5\"
lprun "C:\projects\example_project\utilities\health-check.linq"
ERROR
'Error downloading 'Example.Package' - An error occurred while retrieving package metadata for 'Example.Package' from source 'Example Company Repo'.
Does anyone have any hints on how to reference a custom NUGET repo from a LINQPAD script on APPVEYOR?
More Info
We use AppVeyor for our CI. It allows us to write our own custom NUGET packages for internal use within our own projects.
We have a repository ('FinPad') that contains numerous .linqpad files that automate our processes & house keeping.
Each FinPad script contains a reference to a package called 'FairGo.FinPower' on our own AppVeyor nuget repo. This custom nuget package contains numerous 3rd party .Net DLLs & our own custom code to connect to a 3rd party financial loan management system we use as a backend - http://www.finpower.com.au/ (hosted by us on Azure)
One such script is a 'Health Check' - this confirms a specific environment is operating OK.
For our TEST environment I wanted to schedule our 'health check linqpad' script to run every 15 minutes (and on failure alert stackify & slack)
The process works as follows ( using a custom Azure build machine from AppVeyor)
every 15 minutes
run a custom AppVeyor build called 'Health Check TEST' -->
pull down the GitHub project 'FinPad' to c:\projects\finpad
before build --> choco install linqpad5
Run the below command to copy our own nuget.config (with our own FairGo nuget repo references) to the location linqpad wants for reference
copy "c:\projects\finpad\utilities\nuget.config" "C:\Users\appveyor\AppData\Roaming\NuGet"
*** the above nuget.config contains the url / username /password to our appveyor nuget repo in plain text
build --> cd "C:\Program Files (x86)\LINQPad5\"
after build --> lprun "C:\projects\FinPad\utilities\health-check-test.linq"
For reference the Health check linqpad file is
http://share.linqpad.net/tuthme.linq
Locally this works fine (I manually configured our NUGET repo by the LinqPad GUI locally & assumed it only updated the nuget.config in 'C:\Users\ME\AppData\Roaming\NuGet\nuget.config'. (so I added this file to the repo & copy it every build)
On AppVeyor the build gives the below error
Downloading NuGet package FairGo.FinPower and dependencies from https://api.nuget.org/v3/index.json
Error downloading 'FairGo.FinPower' - Unable to find package 'FairGo.FinPower'.
Command exited with code 1
I have this running through a Console App now - but would really like to get this working through a LinqPad script if possible.
I've got a build running in VSTS which is restoring NuGet packages from both nuget.org and a custom feed in VSTS. The custom feed is in the solutions NuGet.config as a <packageSource>, along with the user name and password in <packageSourceCredentials>
The build, including the restore, is working Ok, but there is a warning ...
2016-10-12T16:18:57.6589001Z ##[warning]To connect to NuGet feeds
hosted in your Team Services account/TFS project collection with
NuGet 3.1 or below, edit your build definition to specify a path
to a NuGet.config containing the package sources you wish to use.
How can I remove this?
Based on my test, that warning remains even through using higher version of nugget (e.g. 3.3) or do not restore package from VSTS feed. (Hosted build agent has the same result).
You can’t remove it unless you custom a build task to restore package through command line.
I submit a issue here.
Update:
The issue has been updated.
I see the issue in the code coming from our transition from depending
on assets coming with the agent to being deployed with the task. You
can get around this for now until we get an official change out by
either (1) choosing to use the Nuget 3.5 version radio button in the
task config or (2) supplying a path to your nuget.config.
So, you can use Nuget 3.5 version or specify nuget.config file.