Appveyor, GitHub, multiple projects in repo - github

I am trying to get just one folder to build (see above). I have the following YML file in that folder:
version: '0.0.{build}'
image: Visual Studio 2017
configuration: Release
build: off
notifications:
- provider: Email
to:
- keith#sol3.net
subject: CI build 0.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
install:
appveyor DownloadFile https://dist.nuget.org/win-x86-commandline/v4.0.0/nuget.exe
before_build:
# Display .NET Core version
- cmd: dotnet --version
# Change to specific project folder
- cmd: cd Sol3.Infrastructure
# Display minimal restore text
- cmd: dotnet restore Sol3.Infrastructure.csproj --verbosity m
build_script:
- cmd: dotnet build Sol3.Infrastructure.csproj
- cmd: dotnet pack -c Release /p:PackageVersion=0.0.{build}
after_build:
# For once the build has completed
on_finish :
# any cleanup in here
deploy: off
Constantly getting error of too many SLN/PRJ files. Also noticed that it is NOT using this file as the version is matching the default settings in Appveyor itself.
Appveyor's appveyor.yml file:
version: 1.0.{build}
build:
verbosity: minimal
Can appveyor do this? Is appveyor the best choice? Any guidance?
This is my sandbox (tiny right now) and I have several projects and would like each project to have it's own appveyor.yml file. I do have SLN files in there too and those are artifacts from VS2017 before I switched to VSCode. Thinking I should delete those now until I need to put a SLN together...

By default AppVeyor checks for appveyor.yml or .appveyor.yml in the root of your repo. If you need to specify custom file name or custom path (relative to the repo root), you need to do this in Custom configuration .yml file name filed in General project setting. Some more information is here. What probably happens now is that AppVeyor has not idea about your YML file in the Sol3.Infrastructure and goes with default configuration in which it searches for VS solution or project to build.
Side notes:
nuget is pre-installed
I would recommend using paths relative to the build folder, instead
of doing CD
no need to cleanup at on_finish, each build runs on transient VM,
which is being deleted right after build finished

Related

Ensure that restore has run and that you have > included 'net6.0' in the TargetFrameworks for your project

I get an error like this while i run a pipeline in azure-dev-ops.
##[error]C:\Program Files\dotnet\sdk\6.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(267,5):
Error NETSDK1005: Assets file
'D:\a\1\s\BlazorAppDB\Server\obj\project.assets.json' doesn't have a
target for 'net6.0'. Ensure that restore has run and that you have
included 'net6.0' in the TargetFrameworks for your project.
The project which is a blazor wasm project, perfectly runs and publishes from the Visual studio 2022 - however, when its run from a pipeline from azure-dev-ops I get this error
Can some one point as to where to fix this one. I understand its more of an configuration error than functional error.
Error NETSDK1005: Assets file 'D:\a\1\s\BlazorAppDB\Server\obj\project.assets.json' doesn't have a target for 'net6.0'. Ensure that restore has run and that you have included 'net6.0
The issue can be related to the nuget tool version you used in your pipeline.
When you use a lower version of Nuget tool (e.g. 4.4.1), it will not be compatible with .net6.0.
To solve this issue, you can add NuGet tool installer Task to specify the pipeline to use higher version of Nuget tool.
- task: NuGetToolInstaller#1
displayName: 'Use NuGet 6.0.0'
inputs:
versionSpec: 6.0.0

How to run nuget package (tool) from artifact feed

I'm begginer to devops. And I got a task to create 2 pipelines. One for building project and publishing it to artifact feed. And another pipeline is to run that tool.
First one I have created (created nuget as a tool and placed in my feed).
How can I now create pipeline that will do dotnet run but from my feed?
I just need guidance a big picture.
I'm trying something like this:
pool:
vmImage: windows-latest
jobs:
- job: RunTool
displayName: Run Tool
steps:
- task: DotNetCoreCLI#2
inputs:
command: 'custom'
custom: 'tool'
arguments: 'install -g --add-source=https://pkgs.dev.azure.com/EPMC-STC/ab5c31ad-1d77-4369-80f4-ff2f14a12667/_packaging/MilanDjukicFeed/nuget/v3/index.json MigrationApp --version 8.0.18'
I'm getting:
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
C:\Users\VssAdministrator\AppData\Local\Temp\d49e97f8-e901-42d7-8c3e-d1eca71c6055\restore.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/EPMC-STC/ab5c31ad-1d77-4369-80f4-ff2f14a12667/_packaging/MilanDjukicFeed/nuget/v3/index.json.
The tool package could not be restored.
Tool 'migrationapp' failed to install. This failure may have been caused by:
* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.
For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool
##[error]Error: The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 1
Info: Azure Pipelines hosted agents have been updated and now contain .Net 5.x SDK/Runtime along with the older .Net Core version which are currently lts. Unless you have locked down a SDK version for your project(s), 5.x SDK might be picked up which might have breaking behavior as compared to previous versions. You can learn more about the breaking changes here: https://docs.microsoft.com/en-us/dotnet/core/tools/ and https://docs.microsoft.com/en-us/dotnet/core/compatibility/ . To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
##[error]Dotnet command failed with non-zero exit code on the following projects :
Finishing: DotNetCoreCLI
On Artifacts I have MigrationApp nuget package. I can download it and run it localy.
Since you are creating Nuget as tool and need to use it in pipeline, you can use dotnet tool install command to install the Nuget tool and define the feed source.
For example: Add a command line task/ Bash task/ PowerShell
dotnet tool install -g --add-source=https://pkgs.dev.azure.com/<org-name>/<projectname>/_packaging/<feedname>/nuget/v3/index.json toolname
Then you can use the nuget tool in next tasks.
On the other hand, if you need to download the Nuget Package, you can use the task: Download package task to download the nuget package from feed and do next actions.

Debugging Azure Function with vscode

I've been struggling to debug an HttpTrigger type azure function with vscode.
My assumption is that the issue might be related to the config files within .vscode/ or at worst, my own environment.
As of now, when I try to debug a recently created function (func init) I get the following error from vscode:
> Executing task: dotnet clean /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary <
execvp(3) failed.: Permission denied
The terminal process "dotnet 'clean', '/property:GenerateFullPaths=true', '/consoleloggerparameters:NoSummary'" failed to launch (exit code: 1)
Inside .vscode/ there 4 files:
├── extensions.json
├── launch.json
├── settings.json
└── tasks.json
and inside task.json there are a few dotnet related commands that are causing the error above.
Despite these files being automatically generated by core tools (func) I removed the dotnet lines from task.json and hit Debug.
After a few seconds I get:
Failed to detect running Functions host within "60" seconds. You may want to adjust the "azureFunctions.pickProcessTimeout" setting.
Is there any command to automatically generate the debug configuration? e.g. ".NET generate assets for build and debug"
Have you faced anything similar to it?
My env settings:
OS: Ubuntu 20.04.4 LTS
Code:1.64.2 x64
Azure Functions Extension: v1.6.0
Core Tools Version: 3.0.3904
Replacing the type from process to shell inside tasks.json solved it.
FWIW, https://github.com/OmniSharp/omnisharp-vscode/issues/4556

Amazon Codebuild error while building : YAML_FILE_ERROR

Any help with this error:
While running Amazons Codebuild using the meanjs.org stack from the GitHub repo, I am getting an error message in the 'Download Source' phase:
Message: YAML file does not exist
It seems that amazon is requesting a build spec.yml file to complete the build
Any help with finding/creating this file for this repo?
I am using the meanjs.org docker image for the build environ
And the source code is he GitHub repo
CodeBuild has documentation about creating your buildspec.yaml here.
What the buildspec does is executes the commands that you would like to run. For example if I wanted to create a buildspec that installed ruby gems, and then ran a jekyll build my buildspec would look like.
version: 0.2
env:
variables:
key: "value"
phases:
install:
commands:
- bundle install
build:
commands:
- echo "******** Building Jekyll site ********"
- jekyll build
Let me know if you have any questions.

How to avoid Edeliver deployment error: "vm.args: No such file or directory"?

Context
We are trying to use edeliver to deploy a "Hot Upgrade" of a Phoenix Web Application to a remote Virtual Machine instance.
Our aim is to build an "upgrade" version of the app each time so that the app can be "hot" upgraded in production without any down-time.
We have succeeded in doing this "hot upgrade" on a "Hello World" phoenix app:
https://github.com/nelsonic/hello_world_edeliver which is automatically deployed from Travis-CI when the build passes. see: https://travis-ci.org/nelsonic/hello_world_edeliver/builds/259965752#L1752
So, in theory this technique should work for our "real" app.
Attempting to Deploy a "Real" Phoenix App using Edeliver
Ran the following command (to build the upgrade):
mix edeliver build upgrade --auto-version=git-revision --from=$(git rev-parse HEAD~) --to=$(git rev-parse HEAD) --verbose
i.e. "build the upgrade from the previous git revision to the current one"
So far, so good. "Release successfully built!"
Error: vm.args: No such file or directory
When we attempt to deploy the upgrade:
mix edeliver deploy upgrade to production --version=1.0.3+86d55eb --verbose
cat: /home/hladmin/healthlocker/releases/1.0.3+86d55eb/vm.args: No such file or directory
Note: we have a little bash script that reads the latest upgrade version available in .deliver/releases and deploys that see: version.sh
Question:
Is there a way to ignore the absence of the vm.args file and continue the deployment?
Or if the file is required to complete the deployment, is there some documentation on how to create the file?
Note: we have read the distillery "Runtime Configuration" docs: https://github.com/bitwalker/distillery/blob/master/docs/Runtime%20Configuration.md and are sadly none-the-wiser ...
Additional Info
Environment
Localhost: Mac running Elixir 1.4.2
Build Host: Ubuntu 16.04.2 LTS running Elixir 1.4.5
mix.exs file: https://github.com/healthlocker/healthlocker/blob/continuous-delivery/mix.exs
edeliver version: 1.4.4
Build tool: distillery version: 1.4.0
Umbrella project: yes.
This question was also asked on: https://github.com/edeliver/edeliver/issues/234
As mentioned by others, the vm.args file is necessary for BEAM to run the release. A default file is created by distillery during the release build process and should be located in releases/<version>/vm.args. From your log output it looks like expected directory is being checked.
Can you show us the contents of /home/hladmin/healthlocker/releases/?
Can you confirm that the default vm.args file is being created when building the release and extracting it (outside of the upgrade process)?
You also asked:
Or if the file is required to complete the deployment, is there some documentation on how to create the file?
If diagnosing the problem with the default vm.args file doesn't get you anywhere, you can also write your own file and configure distillery to use that file instead of the default. The details for this are in the distillery configuration docs. In short,
add the vm_args setting to your distillery config, which should be at rel/config.exs(relative to your project root), for example:
environment :prod do
set vm_args: "<path>/vm.args"
[...]
end