Teamcity is not copying all the folders - asp.net-mvc

I've now setup a MSBuild script to create the folders and files I need in the right structure for my MVC project. I'm then setting Teamcity up to look at the folder with only the files I want to have and copy that to the artifacts folder. So far, so good!
However, There is a few folders in the structure that are empty, and Teamcity does not copy these folder, even if I've set it up to copy the mainfolder and everything in it.
Is there a way to force Teamcity to copy everything - and by that I mean EVERYTHING in my folder, or does it simply not work?
Teamcity Artifact path settings:
Website => Release

You may find your answer in this post : How do I exclude the contents of a directory but not the directory itself in MSBuild
It's not Teamcity but still MsBuild. The problem is that msbuild's include does not include empty directories...

We manage to work around this and skip the empty folders. Therefore this was no longer an issue. However, still don't know how to copy empty folders. My understanding from doing research for a long while now is that it simply doesn't work.

Related

TFS 2017 build Copy files from

In a build, we have Copy files from the task. The problem we have is the source folder itself is copied to the destination. We'd want the contents of the source folder to be copied to the destination folder, not the folder itself. Is there any way to do that?
I tried a wildcard but that doesn't work. It seems it needs a path itself. An issue of this could be that the source is named 'X' but the destination is named 'Y' (it was setup before this build and IIS is pointing to this folder). Can we have the source folder be renamed in the build maybe?
That would be name_of_sourcefolder\**\* for all files and subfolders of just name_of_sourcefolder\* for all files.
This has to be set in the Contents part of the task.

TFS Build single folder not being copied

when building my app on a TFS server, a single folder (with 2 .xml files) aren't copied to the output folder, but all others are.
These files are: a normal xml file and it's tranform version,
This is on the corporate TFS build server and it works for all other files / transformations. So it must be one of my settings in this project / File.
I've checked the files, it's set the same as a .css file that is getting copied (so set to content)
anyone has an idea where I could have a look to find why this is happening?
or even better has a solution for me.
Found that WIX was removing this file

Publishing to Artifactory using Jenkins

I am trying to use the Generic Jenkins-Artifactory plugin to deploy the contents of the Jenkins build workspace into Artifactory. This seems to be somewhat fine using the following wildcards
Web\*.msi=>Testing\Web
Web\DeploymentSettings\*.xml=>Testing\Web\DeploymentSettings
Database\Scripts\**=>Testing\Database
However, when it comes to moving the contents of 'Database\Scripts' from the Jenkins workspace, empty folders under 'Database\Scripts' do not get copied into Artifactory. Non-empty folders however are copied successfully. It is important that I maintain the directory integrity/structure so it's a must that I copy these across.
I have considered placing empty text files in the empty directories to have them copy over successfully but I don't want to "pollute" the package.
Please help :-)
Thanks!
Looks like there is no workaround -other than dummy files in the directories.
I see some bugs in Jenkins releated to handling empty directories.
JENKINS-7260 Clone workspace doesn't copy empty directories when cloning entire workspace
JENKINS-20654Empty folders are not copied to the slave
Could you check if answer posted in Hudson: Copy artifact from master to slave fails helps?

Copy generated folder from one job to another in Hudson/Jenkins

I have two jobs in my Hudson configuration. Let's call them A and B.
Job A was created specifically to generate a folder application_home. This folder is a ready-to-be-used-in-installations-application-home-folder.
Job B is the "pack-all-together-for-installation-job". It needs to copy the application_home generated by job A to generate the installer. My problem is that after some investigation, I was not able to do this in a simple way.
I could use shell script, but then I would need to know job A path plus where its workspace is to get application_ home folder.
Is there a simpler way to do this?
EDIT
I know Copy Artifact Plugin. The problem is that it only copies artifacts. I need to copy the folder application_ home as it is, because it's already in the structure to be used in the installer. If there's a way to use this plugin to copy only the folder, I haven't found it.
EDIT 2. Answer:
Ok, you can do it using Copy Artifact Plugin. You need to
Set its configuration to "copy from WORKSPACE of latest completed build".
Set Artifacts to copy option the folder like this: target/application_home/**
Set Target directory to where you want to somethine like: installation_bundle_folder/application_home.
and it's done :)
You could try the Copy Artifact Plugin.
Then you could add a build step to "pack-all-together-for-installation-job" that would copy application_home to the packaging directory. There is an option to only include the latest stable build of Project A.
Another alternative is to have a post-build step for a successful Project A build that scripts the copy of the application_home over to where Project B will use it. You can use the WORKSPACE environment variable to get the absolute location. (See here for a list of environmental variables).

How to set ANT_PATH in Jenkins from outside of the workspace?

My file structure contains src/ folder with the project's source code, and this folder is the one I want to have in the jenkins' workspace.
However, I also have build folder which is needed for apache ant, and it is changing with every single "ant" command executed. The problem is this folder weights over 200mb. I don't want to end up pushing it to the repo everytime I run the "ant" command.
If someone who reads it has some experience with this - what's the best way to do it? Is it possible to pull src/ folder from the repo, and build/ folder from the system? But I guess it will be wrong because this way only I will be able to execute ant command...
What's the best way to set this?
Huh? You put build in your .hgignore file and then you'll not commit that directory or what's in it. That's the usual setup, but maybe I'm missing some nuance of your question.

Resources