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.
Related
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?
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.
Our project uses custom xml config file, that is currently located under the project as .xml file, with Copy to output: always. Currently, it is present in the repository.
The problem is that every developer uses each own database (and each own configuration file), so ideally we need to have different configuration files, and we do not want to commit them to the external repository.
Sometimes the format of the configuration file is changed, and all of us need to update it. Also we have a build server that is configured to clean the folder before updating source from the repository and building it, so the default file (configured for build server) should be contained in the repository.
The problems is that sometimes a dev forget to check out it's local copy of the configuration xml when building, and his own config file goes to repository and brake many things. Is there any way to improve this schema so we don't need to remove config file from commit files every time we commit?
My solution is to exclude the app.config from VCS to prevent accidental commits to it. We have created an app.example.config which is checked in. A pre-build event validates if the app.config file exists and if it does not copies the .template to the .config file before compile of the codebase. This ensures the build server has a working config file which contains basic settings for all environments.
Example for PRe-build event in your project configuration:
REM copy .example files to .config files if needed
IF NOT EXIST "$(projectDir)\App.Config" IF EXIST "$(projectDir)\app.example.config" COPY "$(projectDir)\app.example.config" "$(projectDir)\App.Config"
IF NOT EXIST "$(projectDir)\Web.Config" IF EXIST "$(projectDir)\Web.example.config" COPY "$(projectDir)\Web.example.config" "$(projectDir)\Web.Config"
IF NOT EXIST "$(projectDir)\ConnectionStrings.Config" IF EXIST "$(projectDir)\ConnectionStrings.example.config" COPY "$(projectDir)\ConnectionStrings.example.config" "$(projectDir)\ConnectionStrings.Config"
IF NOT EXIST "$(projectDir)\Local.Config" IF EXIST "$(projectDir)\Local.example.config" COPY "$(projectDir)\Local.example.config" "$(projectDir)\Local.Config"
Config in repo contain data for TeamCity
Developers have MQ and patch in MQ-stack for converting default xml to local
Changed base xml require to edit (rebase) patch and remove conflicts
Here's another answer similar to the accepted one by Mark, but using the <Copy> task in the .csproj file, which you were apparently looking for:
how to ignore files in kiln/mercurial using tortoise hg "that are part of the repository"
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
I am creating a zip file through my app deployed on apache tomcat 7. I want to make that zip available for download to the users. Where shall I place my zip on tomcat server to be available for download or Can I store my zips on some drive and map them through tomcat to be available for download?
There are 2 ways to it.
Option 1: Put your zip or any file under webapps folder e.g. /webapps/test/hello.zip. Putting zip there can be accessed by http://<host:port>/test/hello.zip
Option 2: You can map any directory on your file system accessible via tomcat. To do this you need to configure server.xml at $Tomcat_home/conf/server.xml
Add this new tag under tag.
<Context path="/test" docBase="complete_path_of_dir_contaning_zip_file">< / Context >
Now zip can be accessed in same way http://<host:port>/test/hello.zip
If you have a database, I'd store the file as a blob in a documents table, and build a servlet that is able to handle the file download. It's easy to implement. The database table should record the blob, the mime type and the name of the file.
In this way, you always have your file available (if you store the file in your webapp folder, and redeploy the war, your file will be dropped).