TeamCity - Copy files from commit that triggered build - file

I am using the "VCS Trigger" trigger: "Triggers one build per each VCS check-in".
I have two Build steps:
One that runs the .sln file
Another that copies files to the destination webroot.
Is there a way to configure TeamCity so that it only copies to the destination webroot the files that were part of the commit that triggered the build process?

I would not recommend that, since .net solutions are bundled together so that files from one build may not work in another build. At least that is my experience...

Related

How to add a service worker to an existing, old, react project?

I'm working on an old react project, which I need to add functionality to, but when deploying the react build on the server, it fails, claiming it cannot find several css and js files, although I published all files within the build folder. I tried different things:
First, I kept the old service-worker.js in the production folder the IIS uses, but replaced everything else.
Then, I tried also deleting the service-worker.js, since I thought it was optional, and my npm run build didn't create a service-worker.js file.
Then, I tried copying the service-worker.js file that existed on production, and manually changing it to point to my css and js files in the /static/ folder of my build folder.
All of these solutions have yielded the same result. So I have a few questions:
Is the service worker necessary? If not, could this error relate to something entirely different other than the service worker?
If it is necessary, why could my npm run build command not create the service worker with the rest of the files in the build folder?
If I do need it, how can I manually add it to a project that already exists?
If the production folder already had a service worker, and my build is not building it, I can also assume maybe my react version is newer, but I find that odd, since the computer I use is one an older employee in my company used, and I didn't manually change anything about this project.

Gradle copy file into generated jar (after :jar Task)

It it possible to copy certain files into / within the generated .jar AFTER it has been finished? E.g. I would like to simply rename one file after the compilation is done.
Ofc, one could also extract the jar, change the file and repack it again as a jar. Though I wonder whether this is optimal or not.
You can try to use shadow lib. It is plugin for Gradle.
Guide for it.

Git didn't add x64\SQLite.Interop.dll

I installed SQLite into my WPF project via Nuget. Then added the entire project to a remote repo. Then I cloned the project on another machine, and had a broken build.
x64\SQLite.Interop.dll was missing.
I'm puzzled why Git didn't include one file from my project. I checked the repo on BitBucket and confirmed it is not there. Git status reports nothing to commit, working directory clean
It added the x86 version, but not the x64 version, I can't imagine why.
(project)\x64\SQLite.Interop.dll Git ignored this file!
(project)\x86\SQLite.Interop.dll
You might want to check the .gitignore file at the root of the repo. If it contains for example x64, it would ignore this file.
There would be two main possibilities then:
edit this file to fit your need
or force this file to be added; ie: git add -f x64/SQLite.Interop.dll
However, committing binary files is often frowned upon. It's true in particular if you want to keep up to date with the latest package, hence if you plan to commit new versions of the dlls on a regular basis.
You might rather want to consider Nuget package restore feature. Basically the idea is that you commit a config file, and the client will automatically download the corresponding packages.

CakePHP - Are these files unnecessary?

When you download CakePHP, these files are present:
.editorconfig, .travis.yml, build.properties, and build.xml
I have never really had to edit these files before or use them for my applications, but I never deleted them. Are these files important? Or can I just delete them?
I am using CakePHP version 2.4.2
You can delete them
The files do serve a purpose but they are not used by the application at run time.
What are they for
.editorconfig is a file used to help ensure code is consistently formatted.
.travis.yml is a file used to configure automated builds using travis - so that the test suite runs automatically for commits and pull requests.
build.xml is used to create a new release, and update pear using phing.
build.properties is a configuration file containing info used by phing (see above) to parameters pirum - to update the cakephp pear channel.

Copy changed files in Jenkins

I'm using Jenkins for building my projects. I'm using Ant to do the compilation itself.
When build finishes I'd like to copy files that were compiled in this build to some directory. Is this possible?
Yes, you could do this as part of your Ant project using the Ant copy task. Best practice is to clean the directory containing your compiled binaries at the start of each build, so you should just be able to copy the whole directory without filtering the contents.
If you want to specifically find changed files, you could take a recursive md5 over your Target directory before and after your build, and only copy those files which do not match the prebuild checksum.
This being said, if you've got a clean build directory you should just copy everything over; changed files will get copied as needed, and unchanged files will copy but won't impact the application.

Resources