Creating a production build of a PHP project with Subversion

If you work in PHP (or, I suppose, in some programming language) and use Subversion as the initial control, is there a way to take your project (for example):

C: \ Projects \ Test \ .svn
C: \ Projects \ Test \ Docs \
C: \ Projects \ Test \ faq.php
C: \ Projects \ Test \ guestbook.php
C: \ Projects \ Test \ index.php
C: \ Projects \ Test \ test.php

and create / copy / anything to filter out certain files and become:

C: \ Projects \ Test \ faq.php
C: \ Projects \ Test \ guestbook.php
C: \ Projects \ Test \ index.php

automatically? I'm tired of creating a branch, and then go through the branch and delete all the ".svn" folders, the docs directory and my prototype files.

I know that maybe I can use the .bat file only to copy the specific files that I want, but I was hoping that using subversion there was some way to pseudo ignore the file, to where it would still be versioned him, but where could you take a snapshot of a project that ignores the files you said to pseudo ignore.

I know that I read somewhere on the Internet about some functionality that, at least, allows copying without .svn folders, but I can not find it now

+5
source share
3 answers

If you use TortoiseSVN, you can use the export function to automatically delete all .svn files. I think other SVN things have the same function.

Right-click the project root folder, then select TortoiseSVN > Export and tell me where you want to get the free .svn directory.

+6
source

Copy all files manually or using an existing method for the first time. Then, since, as I understand it, you are running on the Windows platform, install SyncToy and configure it using the subscription method, which will effectively copy only one-sided changes made since the last pseudo-commit for files already in use. If you want to add a file, you can simply copy it manually and resume SyncToy.

+2
source

So my final solution is this:

Use the export command to export to a folder named "export" in the same directory as the file named "deploy.bat", then I run the deployment script (v1 means version 1, which is the version I'm currently in this project ) This script uses 7-Zip, which I placed on my system path, so I can use it as a command line utility:

 rem replace the v1 directory with the export directory rd /s /q v1 move /y export\newIMS v1 rd /s /q export rem remove the prepDocs directory from the project rd /s /q v1\prepDocs rem remove the scripts directory from the project rd /s /q v1\scripts rem remove individual files from project del v1\.project rem del v1\inc\testLoad.html rem del v1\inc\testInc.js SET /P version=Please enter version number: rem zip the file up with 7-Zip and name it after whatever version number the user typed in. 7z a -rv%version%.zip v1 rem copy everything to the shared space ready for deployment xcopy v%version%.zip /s /q /y /i "Z:\IT\IT Security\IT Projects\IMS\v%version%.zip" xcopy v1 /s /q /y /i "Z:\IT\IT Security\IT Projects\IMS\currentVersion" rem keep the window open until user presses any key PAUSE 

I did not have time to test the SyncToy solution, so do not accept this as I reject this method. I just knew how to do this, and I did not have time to check that one of them (while crunching now).

Sources:

http://commandwindows.com/command2.htm
http://www.ss64.com/nt/

+1
source

Source: https://habr.com/ru/post/1276306/


All Articles