I have the following folder structure:
foo1/
node_modules/
foo2/
node_modules/
bar/
node_modules/
.tfignore
A single .tfignore file is in the root directory.
What should I add to the .tfignore in order to ignore node_modules directories recursively no matter where they are in the directory hierarchy?
There're a lot of questions similar to mine. But all are pretty wide. I want to keep it simple. Please don't suggest anything with "Pending Changes". I only need a single line in .tfignore
The .tfignore file will ignore the given pattern in all subdirectories (unless otherwise specified). And it will ignore files or folders with the given name. For folders, it will apply recursively.
As a result, a .tfignore with:
node_modules
will ignore any folder named node_modules in your filesystem hierarchy, and it will ignore them recursively.
Related
More specifically, I have a workspace directory containing several coding projects, which in turn contain node_module directories. I want to create a tar.gz of my workspace while excluding all node_module directories, but when I try something like:
tar -cvzf projects.tar.gz projects/ --exclude="node_modules"
It does not exclude any of the node_modules subdirectories. Is there a way to do this?
Thank your for your help
I am having an issue with building a sln on Jenkins. I know what the problem is I just have no idea how to fix said problem. So the sln imports a project that is not located in the same folder as the sln. This is not an issue with other sln files that we do the same thing with. As you can see below instead of .. to get back to parent directory it is a looking for a .. directory which obviously doesn't exist.
D:\Path\To\sln\OurSolution.sln.metaproj : error MSB3202: The project file
"D:\Path\To\sln\..\..\PathTo\SharedProject\Shared.csproj" was not found
[D:\Path\To\sln\OurSolution.sln]
Edit your .sln file and have it point to the .csproj file that does exist.
Also, double check your working directory to make sure it's the directory where the solution exists.
Paths in the .sln file need to be relative to the location of the .sln file so that when Jenkins can checks out the entire solution into its workspace from source control the paths resolve.
Check that the paths in the solution file are indeed relative to the solution file.
Check that all the project files defined in the solution file (and all their files in turn) are indeed being checked out to the Jenkins job workspace folder.
Where is the shared project in source control in relation to your solution file? Is it in the same repository? If it isn't then my bet is your Jenkins job isn't checking it out from source control into its workspace and therefore not finding it when the solution tries to compile.
Paths your sln and csproj files are relative. .sln and .csproj files paths are relative from where the sit on the file system.
Usually you would expect csproj files to exist in immediate subdirectories of the directory where the .sln file sits.
I've used .tfignore and Nuget.config solution to prevent tfs of detecting changes in packages folder, at the moment it is not detecting the packages folder changes anymore but whenever I add a new package or update the existing one it will detect the changes in possibly Scripts or Content folders. The problem is I cannot explicitly ignore the Scripts and Content folders because there are some custom scripts that have to be checked-in, what I would prefer is just somehow to ignore the scripts caused by package change?
You can ignore the specify files or include specify files in Scripts and Content folders. For example:
#Ignore .cpp files in the ProjA sub-folder and all its subfolders
ProjA\xxx.cpp
# Do not ignore .dll files in this folder nor in any of its sub-folders
!xxx.dll
in Jenkins, I have a job downloadAgents that is responsible of creating a folder and populating it with some files. Then the folder is saved as an artifact with the following folder structure
dev\downloadAgents\target\dependency\ios
Then I need to copy the contents of the ios folder into the workspace of another job (into a specific folder).
I have added the Copy artifacts from another project step. And it does copy the artifacts, but it copies the full path
\dev\downloadIosAgents\target\dependency\ios
How can I tell jenkins to copy only one folder ios and everything that is inside it and, do not copy all folders that are before ios.
Also if there are already files in the destination folder, will it merge the 2 folders?
You can use regex for your copy (under "Artifacts to copy")-
dev\downloadAgents\target\dependency\ios***.*
** - all folders under ios
*.* - all file types
You can also specify the target directory, and you also have a flag for "Flatten directories". This will move all the files without the hierarchy of the folders (flat to your target directory)
Feel free to look at the plugin's home page:
https://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin
In CopyArtifacts plugin specify the pattern: \dev\downloadIosAgents\target\dependency\ios\*.* or \dev\downloadIosAgents\target\dependency\ios\** - I don't remember exactly.
That should do the job.
I am able to create a fileset which includes certain directories. I am including this fileset to a copy. I want to take the child file and copy it without taking the parent folder.
My source structure is:
root
Folder1
Folder2
script.js
Folder3
script2.js
So I want script.js and script2.js copied, but in the destination directory I get Folder2 and Folder3 included.
I'm out of depth. Help would be appreciated.
Simply use copy task with flatten attribute set to true :
Ignore the directory structure of the source files, and copy all files
into the directory specified by the todir attribute. Note that you can
achieve the same effect by using a flatten mapper.