Azure pipeline CI compilation no update all files - azure-devops

I have a build done for a ASP.Net project.
In code I have updated the names of several fields in an HTML but, when the build is launched and published, it never updates the changes I have made.
It always takes the original version to create the artifact.
I have deleted and created the build from scratch, but it always does the same thing.
What can I do?
I have more builds just like this one and this doesn't happen.
Best regards,

Have you checked the commit version of your pipeline?
It may due to your pipeline using another branch, which is the original version.

Related

Azure DevOps Artifacts getting deleted

I have a bunch of Azure Pipeline and Release packages. The piplines build and publish my code to a testing environment every night, and as part of that publish they create artifacts used by the selenium testing software.
This has been working correctly for several years now. Sometime around the last upgrade we did to Azure Devops the artifacts have started getting deleted after about a day instead of honoring the deletion schedule that I have setup.
The artifacts are generated by the pipeline packages and used by the release packages, and everything is working correctly. However sometime after the last release has finished running for the night, all the artifacts get deleted. I have tried running the entire process manually, and when it is done the artifacts still exist (at least until the next day - I haven't identified a specific time they get deleted), so the issue does not appear to be within any of the packages themselves.
The Settings Retention policy, I believe these apply to the pipelines.
The Release Retention policy, obviously these should apply to the release packages.
Does anyone have any idea why my artifacts are not sticking around past 1 day?
It seems I have figured out the problem, and it appears to be a change in the way Azure Devops works with the newest version. This is the first version I have noticed this issue in:
Azure DevOps Server 2020 Update 1.1
The settings indicate that artifacts should be kept for 20 days in my instance. However, every time I run a build it over-writes the existing artifacts with the newest ones. My guess is that this artifact path gets tied to the build in the database. And since all artifact paths are identical in my case (something that did not occur to me to mention in the original post), deleting an artifact that is 20 days old will delete the data from the current artifact path as well.
I solved this issue for myself by including $(Build.BuildNumber) as part of my artifact path. Unfortunately you cannot directly use a date variable in that path, however since I have the date built into my buildnumber this approach worked for me.

Revert EfCore Migrations with Azure DevOps

I want to add Build and Release pipelines in Azure Devops for my .Net Core application. Application uses EF Core migrations.
I used the solution provided for example here: https://blog.clear-measure.com/2019/01/07/run-ef-core-migrations-in-azure-devops/
It works fine. I generate script during build, publish it as another artifact and then use it to run against database during release step.
But how to deal with a situation that I want to revert the changes. Here I see two scenerios:
It would be great if somehow I could just click Deploy on the previous release and this way get back to the previous working version of the app (and revert the DB as well).
Revert the changes in the repo, deleting migrations that might have been created between releases and start build and deploy process again. How to revert already added migration to the DB?
Is even the first approach possible ?
Thanks for you help!
You would revert the migration via EF Core similar to the way you add a migration. Then commit and push and run the pipeline.
https://learn.microsoft.com/en-us/ef/core/managing-schemas/migrations/#revert-a-migration
First scenario is possible.
In your release pipeline, you can find the retained historical releases.
Select the previous release you want to revert back to, click redeploy and it will roll back to the previous version.

VSTS Filter by repository folder?

I'm using Visual Studio Team Services to build my project which is stored in GitHub (here). The master branch contains multiple projects which make up the solution. Amongst those are a WebAPI project and a Cordova project. I need to build those using two separate build definitions in VSTS.
Previously I had set-up my build definition and used the branch filters to filter on what had been pushed to the repo. For instance:
master/src/API
This worked, but it doesn't any more. It seems as if the underlying code has changed. A filter of 'master' still works and I understand how this feature is probably meant to filter specifically on branches and maybe not on folders within the branch?
It's not a huge problem, but at this time all of my builds will trigger with every check-in, even if nothing changed in the meantime for that source code. So I'm not wondering what a good solution for this issue would be:
Put every project in it's own branch. Seems like a workaround
Some other filter option or maybe another syntax or something?
Leave it as it and don't worry about the extra builds (but that itches, you know...)
Anyone running a similar set-up?
Path filters is not supported for VSTS GitHub CI Build, it is available for Git CI Build on VSTS. You can vote this user voice: https://visualstudio.uservoice.com/forums/330519-team-services/suggestions/15140571-enable-continuous-integration-path-filters-for-git
The workaround is as you said that put every project in its own branch.

Deploy Appveyor build as GitHub release without making a tag

I have a project hosted on GitHub and I have it compiling with Appveyor.
I would like to set up Appveyor so that each build is deployed as a GitHub release, but with each build overwriting the last. This way there will only be one GitHub release from Appveyor that will always have the latest build attached.
I can't see how to do this, because if I specify a release in appveyor.yml I get an error saying the release already exists (yes I want to overwrite it), and if I don't, then each deployment creates a new tag with the current build, which will litter the repository with useless tags.
On top of that, every time the release gets deployed, it creates a new tag which in turn triggers another Appveyor build. This means every push to the repository triggers two identical builds.
Has anyone worked out a way to deploy to the same GitHub release continuously, replacing the files with the latest versions, and to prevent a new Appveyor build from being triggered in response to an Appveyor deployment?
You can add force_update: true to GitHub deployment provider settings to overwrite existing release.

TFS picks up wrong build to deploy when <Latest> is selected under 'Select an existing Build:'

I am using a build definition that makes use of LabDefaultTemplate.11.xaml for deploying the builds. In the lab process settings i have selected "Latest" under 'Select an existing build' in the Build tab. Ideally it should always pickup the latest available build to deploy BUT instead it is picking some old build which was created few days back. The only difference in the old build and the recent builds is that it passed successfully when it was created whereas the recent builds have partially succeeded.
What might be the problem and possible solution? Quick reply would be appreciated.
Thanks,
-w
Latest in that drop down means it will pick up the Latest successful build. It is working as designed.
If you want to change the logic you'll have to edit the XAML workflow and possibly write a custom activity.