How to generate diff between two folders on Windows using command line? - windows

We use Jenkins to deploy application files. I need copy files in a folder to a remote server via FTP using command line on Windows.
Normally only a few files in the folder are updated, and I don't want to transfer all files every time.
Is there a tool that can compare two folders and generate a new folder containing updated or new files?
Thanks.

Related

Rename files inside War file using 7zip

I am trying to rename a few property files inside a war file using 7zip.
I don't get an error but unfortunately it does not work.
The command I am using is:
call copy /Y ..\target\myApp.war temp\webapps\myApp-test.war call 7z rn temp\webapps\myApp-gate.war -ssc #gateRenameList.txt
And the gatewayRenameList contains:
`\WEB-INF\classes\application.properties
\WEB-INF\classes\application-ignore.properties
\WEB-INF\classes\application-alternate.properties
\WEB-INF\classes\application.properties'
I could use maven and profiles (or something else) but I thought this would be faster as I want 2 almost identical war files. As these files will be deployed to a special container it's not possible to change the active profiles (we don't have access)... but I need 2 almost identical war files to deploy to 2 separate URLs/contexts.
Anyway, I just want an answer about the 7zip rename.

Way to let runner execute a bash script

I set a GIT_STRATEGY variable to none in a .gitlab-ci.yml file. So a repository is not built in a deployment server automatically. So we avoid building the git repository with its all history etc. A git-archive command will be used instead.
This way only needed files will be copied from a GitLab server.
Now I am looking for the way to send the bash script to the runner.
As we know, the .gitlab-ci.yml file is actually being sent to the runner. Isn't it a way to send the bash script to the runner too? Then I would make the .gitlab-ci.yml file just to start the bash script and have a job done.
Of course, I could put the commands to the yml, but there are some limitations then because of a yml syntax. I could also make the runner scp the file but this would be too complex. Any ideas?
update
Let me try to approach what I am going to achieve. There are several bash script files. Each of them is a specific scenario of the deployment. For example, one pulls project files from GitLab, deletes files in a folder public and moves project files to it.
The other script file pulls project files from GitLab, moves the files to the folder and creates a backup.
The other script file pulls project files from GitLab, moves the files, creates backups and performs a database migration. Etc.
There are three hosts:
Local PC of an administrator.
Remote GitLab server
Remote deployment server that server websites. (It has Nginx or Apache)
One of the script files will be executed on the deployment server. There is a number of the script files so we must provide replacing the script file from time to time.
The question is how to bring the script file to the deployment server so the runner could run it?

Deploy a Copy of the nupkg to a file share

Is it possible to output/deploy a .nupkg file that is downloaded from a teamcity server. Currently it extracts the .nupkg that is downloaded from the teamcity server. The file that is extracted into the Applications folder is stored in the Octopus\Applications.Tentacle\Packages folder but it has an internal name which is not very user friendly.
My only option at this point is to run a custom powershell script that copies the file and renames it, but this seems like a rather crude hack.
Use the system variables to access the internal values set within Octopus to find what the name and path of the nuget package you want. This list of system variables on the Octopus Deploy site is where'd I'd start to look first. I don't know how complete the list is but there are a consider number of variables you have access to in Octopus Deploy.

FTP transfer only new files

I'm using maven+jenkis on my web project. With jenkis I upload WEB-INF folder on my server. Now I want to transfer only the most recent files. Do I set some propertis on my ftp config file, or I'll execute a particular script for jenkis?
I would use rsync. It transfers only the necessary files and I think it can only send only changed parts of large files.

How to open and list contents of a zip file using windows command prompt?

In my svn repository, there are a lot of zip archives containing images. Recently we added a lot of new images. But some images are missing in some zip archives. How can I check whether an image is available inside a zip archive or not, from the command line?
I can check that a zip archive exists using this command:
svn info svn://ip/test/101.zip
Because my repository is large, my repo browser takes a long time to load. How can I check that an image is available or not inside a zip archive?
Please help.
Thanks
There is no way to open the zip file on the server, and search there for the contents. So you have to download the zip files to the client, list there the contents, and see if it matches. Depending on the zip command and the grep possibilities you have, this will be implemented differently.
The best way to do this is using third party tools for searching inside svn repositories. The most well-known search tool for svn is svn-search which is freely available on sourceforge. It can search inside .txt, .pdf, .doc, .zip and many other file formats. Use this link to get the tool

Resources