One Repo, multiple projects, 2 nugets and appveyor
I am brand new to appveyor, fairly new to github (have not been active at https://github.com/KeithBarrows/sol3) and I am trying to learn the ropes of CI builds. I currently have several old projects that I will eventually update to .NET Core, a couple of library projects already in Core and a test CLI project. No SLN files.
I created my appveyor project based on the root of this github and am now trying to figure out how to add an [somename].appveyor.yml to each project so that they run specific tasks. i.e.:
* Sol3.Infrastructure - restore nuget references, build release version, pack as nuget, publish to VSTS
* Sol3.Infrastructure.IoT - restore nuget references, build release version, pack as nuget, publish to VSTS
* Sol3.TestCli - restore nuget references, build release version
I will also be adding a new Core Web App that I would like to run in Docker.
* Sol3.net (web app) - restore nuget references, build release version, publish to docker container, publish to my docker hub repository
This last one will have dependencies on the first 2 projects via nuget so needs to be built last.
With that in mind, the only quasi-success I've had is to try to do everything from the settings page for my project on appveyor and I am running into several problems.
It seems that appveyor does not have a mechanism to "login" to VSTS nuget feeds:
C:\Program Files\dotnet\sdk\2.1.401\NuGet.targets(114,5): error : Unable to load the service index for source https://keithbarrows.pkgs.visualstudio.com/_packaging/packages/nuge.... [C:\sol3\Sol3.Infrastructure\Sol3.Infrastructure.csproj]
My next question is how can I, via the settings page, let appveyor know that each project has its own appveyor.yml
file?
* Sol3.Infrastructure\Sol3.Infrastructure.AppVeyor.yml
* Sol3.Infrastructure.Iot\Sol3.Infrastructure.Iot.AppVeyor.yml
* Sol3.TestCli\Sol3.TestCli.AppVeyor.yml
My first attempt at writing a project level yml file looks like:
version: '0.0.{build}'
image: Visual Studio 2017
configuration: Release
notifications:
- provider: Email
to:
- [my email]
subject: CI build for Sol3.Infrastructure v0.0.{build} failed!
on_build_success: false
on_build_failure: true
on_build_status_changed: false
init:
# Best practice (Windows line endings different to Unix/Linux)
- cmd: git config --global core.autocrlf true
before_build:
- pwsh: >-
dotnet --version
dotnet restore Sol3.Infrastructure/Sol3.Infrastructure.csproj --verbosity m
build:
project: Sol3.Infrastructure/Sol3.Infrastructure.csproj
verbosity: normal
before_package:
- pwsh: dotnet --version # place holder
after_build:
- pwsh: >-
dotnet --version # place holder
# pack this one nuget
# publish nuget to VSTS
And I am sure I will have many more questions as well.
TIA
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by keith.barrows on 04 Sep, 2018 09:18 PM
I am getting closer. Added some before/after build scripts. Now it is complaining about NuGet not being restored! Here is the yml file:
Here is the logs:
Any ideas on why the nuget restore, which works, is not recognized when the build happens?
Support Staff 2 Posted by Ilya Finkelshte... on 04 Sep, 2018 10:19 PM
It is private nuget feed, correct? In this case you have to add a nuget source before using it with
nuget sources add
command. Otherwisenuget/dotnet restore
unable to authenticate against it. Secret you pass to this command can be store as a secure variable.3 Posted by keith.barrows on 05 Sep, 2018 06:24 PM
I've gotten a lot further. Dropped trying to write project level appveyor.yml files, started using the Environment matrix in the settings page, writing my own build script in PSCore.
In the build matrix I list each project I want to build. Then, I run this build script for .NET Core 2.x:
Everything seems to now work, the builds build correctly, the packages push to my account nuget feed on AppVeyor. However, I cannot access the account nuget feed. Maybe it is just temporary?
4 Posted by keith.barrows on 06 Sep, 2018 06:11 PM
This can be closed. I got it all working except for being able to access the nugets after build is done.
https://help.appveyor.com/discussions/questions/25682-how-do-you-ac...
Support Staff 5 Posted by Ilya Finkelshte... on 06 Sep, 2018 06:34 PM
Great, we will help with another ticket shortly.
Ilya Finkelshteyn closed this discussion on 06 Sep, 2018 06:34 PM.