Copying files from Bamboo to a Server - deployment

I am currently setting up a Bamboo job to deploy a windows service to our QA server. In order to do this I decided to stop the service, copy over the new files from Bamboo, and then restart the service. I am doing the following to copy the whole folder over to the destination.
<Copy SourceFiles="($SourceFolder)" DestinationFolder="($DeploymentFolder)" SkipUnchangedFiles="true" />
What should I set the Source Folder to if I want to pull the files from Bamboo rather than my local machine?

Related

How to backup solution folder before releasing the new build to on-premise server in Azure CI/CD Pipeline

I would like to keep the solution backup to some folder before releasing the new build in my Azure CI/CD pipeline. And to deploy the solution, I am using my on-premise server. Not sure where to make changes to save existing artifacts to some folder before getting the new release.
This way we can avoid the failure if something goes wrong to current release. We can have the backup to copy the file.
Release Pipeline
I would like to keep the solution backup to some folder before releasing the new build in my Azure CI/CD pipeline.
Based on your requirement, you can use the Copy files task to copy the existing files on the server to the target folder.
Here are the steps:
Step1: you can check the IIS deployment Physical path in IIS web app manage task.
For example: %SystemDrive%\inetpub\wwwroot
Step2: you can add the Copy file task at the top of the Release Pipeline. Then you can set the Physical path and target folder to copy the existing files.
For example:
In this case, when the release pipeline is running, it will backup the existing files first and then it will deploy new files to local server.
On the other hand, since you are using CI/CD pipeline, the related files will be saved in Build artifacts. You just need to change the build artifacts version in Release Pipeline, then you can deploy the previous artifacts again.

How can i publish a solution to a local folder using Jenkins?

I have a Jenkins job that runs and builds a .net app.
Is there a way i can publish to a local folder on the c:\ drive using Powershell?

Use DevOps Release Pipeline to Upload Artifacts to a Linux Server

Is there a simple way to upload build artifacts in a zip file to a Linux Server using SCP or some other protocol?
Right now the build sits in a specific directory on the build server ready to be uploaded but the docs I've been reading haven't made it clear how to upload it to Linux using DevOps Release Pipeline. The documentation and question/answers I've been reading appears to be windows to windows rather than windows to Linux.
Thanks!
Is there a simple way to upload build artifacts in a zip file to a Linux Server using SCP or some other protocol?
You could try to use Copy Files Over SSH task to copy the Artifacts to a Linux Server.
Use this task in a build or release pipeline to copy files from a
source folder to a target folder on a remote machine over SSH.
This task allows you to connect to a remote machine using SSH and copy
files matching a set of minimatch patterns from specified source
folder to target folder on the remote machine. Supported protocols for
file transfer are SFTP and SCP via SFTP. In addition to Linux, macOS
is partially supported.
Please check the developer forum Copy Files Over SSH during Continuous Integration and Deployment for some more details.

dotnet core 2.0 webjob deployment - VSTS

I want to deploy my webjob ( dotnet core 2.0 commandline application ) through 'release' defination. My drop folder contains webjob named 'MyWebjob.zip'. I want to copy this to my webapps below directory where all tasks exists
D:\home\site\wwwroot\App_Data\jobs\continuous>
Below is snap of of my existing release defination
Can anyone tell which copy job is suitable to copy contents from drop folder to 'wwwroot\App_Data\jobs\continuous' direcotry?
Or is there any easy way to deploy webjob ( dotnet core 2.0 ) using VSTS?
Note: I can't use FTP for some reason as 'Continuous Integration' is enabled for our project.
You can’t use these tasks to deploy webjob.
If you remain the folder structure (App_Data\jobs\continuous) in MyWebjob.zip file, you can deploy it to azure web app through Azure App Service Deploy task (App type: Web App; App Service name:[your app service]; Package or folder:[that zip file]; Check Publish using Web Deploy option).
Otherwise, I recommend that you can do it through Extract files and Copy files to organize the folder structure, then deploy through Azure App Service Deploy task (Package or folder:[App_Data parent folder]; Uncheck Publish using Web Deploy option).
You also can upload files through Kudu API (Extract zip file through Extract files task first)
There are some threads that can help you to call Kudu API in VSTS.
Remove files and foldes on Azure before a new deploy from VSTS
How to access Kudu in Azure using power shell script
You can add a custom target to your worker .csproj file.
<Target Name="UpdateWebJobsPublishDir" BeforeTargets="ComputeFilesToPublish">
<PropertyGroup>
<PublishDir>$(PublishDir)App_Data/jobs/continuous/$(ProjectName)/</PublishDir>
</PropertyGroup>
</Target>
The above vill update the output dir before it is publised. In VSTS/Azure DevOps you just deploy you project as normal webapp it will be put in the right folder.

How do you deploy a release to a sub folder without changing the physical path on IIS

We created a release definition that deploys our build to a onsite IIS server. We need to be able to deploy to a subfolder (e.g. D:\apps\appname\v1\[deploy here]. We tried changing the Physical Path setting in the IIS Web App Manage task, but that changes the Physical Path of the entire IIS server.
How can we specify where we want to put our individual application?
The problem with the IIS Web App Manage task is that it wants to configure and create IIS Web Apps, not just copy files. To just copy files you want to use the Copy Files task. If you're working with a remote machine, make sure you're running the Copy Files task on your deployment group. To do that, in your Release Definition, make sure your task is running under a Deployment group phase that specifies your Deployment Group.
Once you have this set up, your deployment should run, and it will run from whatever machine you configured in the Deployment Group. You can copy files from the build's artifacts to a folder using a path local to that machine. So for example if your IIS Website is located at d:\websites\MySite you would use that as the destination path for the Copy Files task.