We have an automated build process in place which creates the release artifacts for us.
These are copied to an FTP location and post certain processes, the packages are available for deployment to val, customer dev, UAT and prod.
I want to create a Release in TFS where the release should simply use the package from the ftp location instead of triggering a new build.
The process of moving the artifacts to the ftp using a detached build process is legacy and I'm afraid cannot be changed.
I would like to trigger a release ( at the moment I'm testing this using VSTS ) which will use the artifact from an ftp instead of triggering a build.
My build server / process is not in TFS and it's a large application with multiple components.
Trigger a release using the artifacts from an FTP instead of triggering a build is supported. But there's no default steps about download a FTP file for you to use. You need to use command or Powerscript to download.
In the release definition, delete all artifacts under the Artifacts tab. Then it won't download any files from your builds.
Create a bat file or Powershell script file, write the command/script to download those files you want. Here are some methods you could have a look:
How to script FTP upload and download?
How to download files from FTP site in one command line without user interaction (Windows)
https://tecadmin.net/download-upload-files-using-ftp-command-line/
Check the bat/script to TFS and run it in your release definition.
Related
I have a Jenkins job that gets the code from version control and builds (like what a normal pipeline do), I was doing is that after building the project, I download the build and use FTP to transfer that build to the client's server then I unzip it and then copy the whole build because I copy whole build my application's down time is very high. (I have to use FTP because as a service provider we have some limitations and can't change this policy)
What I wanted to do is that Jenkins know what is changed when it is building so Jenkins will create a package with all the changes and with the correct path where the file should go, and I can download that package and copy that package and just run the package so whatever was changed only that should get updated.
Is that possible? Is there any plugin that I can use?
This really depends on the build tool/language you are using to build you application. I dont think there is a generic jenkins plugin.
Other idea would be to upload your package to a local Nexus server. Download after the next build and the compare the files from old and new build. With this information you can create a patch package for your clienst server.
Is there any similar plugin like this
https://wiki.jenkins.io/display/JENKINS/Config+File+Provider+Plugin
in TFS Build & Release
I want to provide configuration.json file which is not included in git source.
Unfortunately, there is no such extension in TFS/VSTS Build & Release.
According to your tag tfs2013, seems you are working with XAML build.
Just like you need a workspace on your dev machine to develop your app, you must specify the workspace that the build agent uses to build and test your app. Then we get/pull source files from TFS server side. It's not able to achieve below similar features in TFS UI:
Adds the ability to provide configuration files (i.e., settings.xml
for maven, XML, groovy, custom files, etc.) loaded through the Jenkins
UI which will be copied to the job's workspace.
As a workaround, you could try to put configuration.json files in a ftp server instead of git source and then use a PowerShell solution to down the files in build agent workspace. If create a PowerShell to over FTP you can have it called by the build template(customize workflow).
When I started writing this question, my problem was that after a successful VSTS Build, I wasn't able to see the files relating to my web application project for release. Only the files from certain other projects in the solution were present. However, I just came across this question, which has helped.
I can now see the compiled .dll files for my web application project, after altering the configuration of the Content setting in the Build - that is, the contents of the Bin folder under that project. But I can't see anywhere the other files I need to copy the built web application to my server - the views, the scripts, the css, etc.
I'm finding the power and flexibility of VSTS's Build and Release functionality very confusing as it's complete overkill for our requirements. Up until now, I've just right-clicked on the web app project in Visual Studio selected Publish and used the File System publish method. Easy. Now that I want to automate the building and deploying of the application, it's many times more complicated!
So, can anybody tell me how I can get the solution to build in VSTS in such a way that I can then use a Copy Files task in the Release Definition to copy the files to our web server (the server isn't visible to the Internet so I'm using a locally-hosted Agent)?
In vNext build, to publish your build artifacts with the Copy files or Publish build artifacts steps. Try to use the local path on the agent where any artifacts are copied to before being pushed to their destination. For example:
Add /p:DeployOnBuild=true
/p:OutDir="$(build.artifactstagingdirectory)\" arguments in Visual
Studio Build step;
Change "Path to Publish" of Publish Build Artifacts task to
$(build.artifactstagingdirectory)\_PublishedWebsites\ProjectName:
Details please check the screenshot of build step with this question: How do I get the the expected output from a TFS 2015 build (to match my XAML build)?
Base on your comments, you have published the web app from Visual Studio. Usually, this action will generate a publish profile under Project/Properties/PublishProfiles folder. The settings you used to publish the web app is stored in the profile. So you just need to make sure this publish profile is checked into source control. And then in the TFS build, add following MSBuild arguments:
/p:DeployOnBuild=true /p:PublishProfile="publishprofile.pubxml"
I have a solution with multiple projects where some are web apps. I have set up a multi-configuration build in TFS vNext that builds the single app, creates an MSDeploy package, gets the proper staging configuration files and add or replaces the files in the package archive file.
I'd like to use the deployment files created as artifacts to be used in a Release Management pipeline. The problem is that the artifacts directory is purged before each build (i.e. build of a web application). At the end, only the artefacts of the last app that was built are left there.
I can certainly configure the step to copy the artifacts somewhere else, but then the question is how to delete it only at the very start of the build (and by that I mean the build of all projects).
Is there a way how to disable purging of the artefacts directory or how to perform an operation only at the beginning of the build? Has anyone similar experience?
Use the "Publish Artifacts" task to store the artifacts in a UNC location or in TFS itself so they're available for release.
I have a TFS server, and an older build system that produces a pile of executables, installers, WinCE images, etc.
Is there an easy way to upload build artefacts to somewhere (where?) in TFS from batch files? Or is this the wrong technology?
You should use the TF Build server and set the Build Definition to "store on server". This will upload all build output to the server in an unversioned repository that while seperate from version Control is also in the database.
You can do this manually through the TFS API but it would not be registered build output associated with a build and version.