How can I take backup before doing releasing new changes in vsts - azure-devops

I have a release definition,now I want to take the backup of old one before deploying new one if any know the answer please share the steps or picture
Because I'm new to CI/cd

According to your description, seems you want Azure DevOps for a release definition to have a step that backs up the directory for the application before it deploys the updated code.
There are a Copy Files and a Archive Files task which you can drop into your process. You can even make the tasks conditional based on your needs.
When you want the "old" release, the normal thing to do would be to schedule a new release with the previous version to install. Or to fix the issue and trigger a new release with the fixed contents.

Related

Azure pipeline CI compilation no update all files

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.

Azure DevOPS: Redeploying an older release (one stage only) did not deploy the older changes

Our team had to test something in an older release. I went to the Release that was needed to be redeployed. We only needed one App to be redeployed, so I went inside the older release from the list and clicked "Redeploy" to that one particular stage.
When the deployment were done, I found that it actually deployed the latest changes. Am I using an incorrect method to redeploy an older release to only one stage? Should I create a brand new release pointing to older artifacts instead?
This is just opinion, but I think that better apporach is to create a new release pointing to older artfact. Why? Because you have clear perspective what was deplyed and what is currently available. Otherwise, you may get false perspective.

Is it possible to rename a release?

Can we rename a release in Azure Devops (Not Release Pipeline)?
I'm not looking to edit the Release name format property in the General page. I want to rename the release once it's already created/forked from the release pipeline.
The simply answer is, you can't perform a rename operation at a pipeline level. If you want to change it in the Azure portal you can Clone the pipeline from the Author and Deploy blade. Then deploy the pipeline again with the new name and drop the old version.
This documentation also say that if a pipeline is created it creates unique artefacts that can't be renamed. So as mentioned, copy it and make a new one with your new name.

Azure DevOps Pipelines Release Copy Files step "The process cannot access the file because it is being used by another process"

I am using Azure DevOps pipelines releases to try to deploy a windows service on premise. Periodically, the windows copy files step will hang and try again every 30 seconds and output "The process cannot access the file because it is being used by another process" as it attempts to copy the build artifacts.
We've ruled out any kind of permission issue. We've tried all sorts of tools to see what might be locking these files up and they don't tell us much.
This has happened before in the past with some other projects I was also trying to release on premise. Sometimes, I am able to just wait an hour or two and redeploy successfully (not exactly a solution I'm satisfied with), but this one particular project, a windows service, seems to be experiencing the issue very, very frequently. Almost every time I try to deploy.
Has anyone else experienced this? Or any word from Microsoft on the issue?
Thanks in advance.
I experienced this issue while trying to create and deploy a release from an existing artifact. So I have a build pipeline on Azure Devops that generates artifacts to be used by the release pipeline. All I did was to make a commit that triggered the build pipeline which generated a new artifact and triggered the release and it worked fine.
It was the first time I experienced this and I had no clue on why it happened.
I'm going to be doing more research and share any thing I find helpful.

Octopus Deploy uses a snapshot of deployment until I create a new release

I'm trying to set up a deployment in Octopus Deploy. As many other devs, I do that through iterations: tweak steps/scripts/packages -> click "Deploy" -> inspect the outcome -> start again if not satisfied. In case of Octopus Deploy, it uses a snapshot of the deployment process if any steps/scripts were changed since last release. Basically, when it comes to deploy, I get this warning:
Warning: for consistency, this deployment will use a snapshot of the variables and deployment process, which do not include the latest changes that have been made to the project. A changed process can only be incorporated by creating a new release (this one may be renamed if desired). Variables can be updated via the release page.
This means that I need to add a new release just to check if my deployment scripts change has taken effect or not. To add a release, I need to update the version and so on.
My question would be: how can I redeploy the same release with all the step changes introduced since the previous release? Is there a way to not create a new release to do that?
I asked this question of Paul Stovall several months ago when I started working with Octopus. His answer was "no".
I'm afraid there is not a way to do this without creating a new release. When you create a release, Octopus deploy stores an object in its internal database which is a snapshot in time containing everything needed to deploy. It doesn't have a mechanism to update these stored objects, and so it is required for you to create a new release each time.
Please note that even though a snapshot of the process is taken, the variables can be updated if you're redeploying a previous release. If you're just changing variable values, then yes, you can reuse the same release over and over. If you're changing any of the process steps, then no - you have to create a new release.
If anything the version number just helps keep things segregated. The only time this becomes a problem is if you're using NuGet versioning, but if you're using the standard variable template versioning in Octopus deploy, it's incrementing the last digit in the version number.
You can rename your failing release on the release page (under: Edit this release). That way you can create a new release with the old versionnumber and avoid unecessary work.