I got the idea for this package by an issue I have had sometimes:
When uploading some changed scripts, I forgot to consider the 'factory settings' and therefore: If a new user downloads the complete project, he/she usually have had some issues with wrong options he/she could not understand and therefore posted in the forum.
For the user this post is logical and necessary, but for the project it is unnecessary!
Therefore I built this 'Server Upload Suite'.
General idea:
Anywhere there is an 'upload area'.
The files inside the 'upload area' are uploaded to the server.
The 'upload area' is actualized from a 'work area', where you can test and change scripts.
The actualization, however, does not change the 'factory settings'. They are preserved.
What is needed:
The updateServer.zip package (link at the end)
(License of the cUrl program allows to include it in the package).
Download the package and unzip into your 'upload area'.
How it works
There is a batch file genUpdIni.cmd, I explain here step by step.
Here you define your individual settings
REM Customise these settings: Set InfoTitle=nativeEx Set WEB=nativeex.boot-land.net Set FTP=nativeex.boot-land.net/httpdocs/ Set CopyProjects=nativeEx_Core nativeEx_barebone Set UpdateProjects=%CopyProjects% Tools Set Origin="V:\WB\wb debug\projects\" Set user=??? Set password=??? REM in script.project are all variables deleted which follow this variable Set LastVar=%APISUBDEF% REM Not necessary to customize these, but you can Set Excludes=Excludes.txt Set WebUpdatesIni=web.updates.ini Set LocalUpdatesIni=updates.ini Set UploadBatch=Upload.cmdWhen you test, maybe some unwanted files (not scheduled to go to the server) are left inside your project.
You can delete them here.
REM No need some files to upload! if exist Projects\Tools\Languages\_default.txt del Projects\Tools\Languages\_default.txt if exist Projects\nativeEx_barebone\Tools\processCompress.Script del Projects\nativeEx_barebone\Tools\processCompress.Script if exist Projects\nativeEx_barebone\Tools\processUPX.Script del Projects\nativeEx_barebone\Tools\processUPX.ScriptInvokes the 'getCopy' program which Compares files in 'work area' with files in 'upload area':
- If files have different length, copy and
- If files are in (*.script, *.project, *.link), copy to 'upload area' and
- preserve actual interface settings
- reset some user values like %SourceDir%
- If files are in (*.script, *.project, *.link)
- reset some user values like %SourceDir%
- preserve actual interface settings
[/list]
getCopies %CopyProjects% /O%Source% /E%Excludes% /L%LastVar%Invokes the genUpdates program which generates updates.ini and index.html to upload to the server.
genUpdates %UpdateProjects% /T%InfoTitle% /W%WEB%Gets the actual updates.ini from the server. Compare with the actual local updates.ini gives info what to do.
curl http://%WEB%/%LocalUpdatesIni% > %WebUpdatesIni%Generates a batch file %UploadBatch% to update the server.
buildUpdateList /W%WebUpdatesIni% /l%LocalUpdatesIni% /o%UploadBatch% /f%ftp% /u%user% /p%password%Sample:
curl -T "V:\WB\projects\pscProgs\updates\Projects\nativeEx_barebone/script.project ftp://user:PWD@nativeex.boot/land.net/httpdocs/nativeEx_barebone/script.project curl -T "V:\WB\projects\pscProgs\updates\Projects\nativeEx_barebone/Tools/SaveBase.Script ftp://user:PWD@nativeex.boot/land.net/httpdocs/nativeEx_barebone/Tools/SaveBase.Script curl -T "V:\WB\projects\pscProgs\updates\Projects\nativeEx_Core/Tools/Finalize Batch.Script ftp://user:PWD@nativeex.boot/land.net/httpdocs/nativeEx_Core/Tools/Finalize Batch.Script REM ADD TO SERVER curl -T "V:\WB\projects\pscProgs\updates\Projects\nativeEx_Core/Finish/2 Create Image/folder.project ftp://user:PWD@nativeex.boot/land.net/httpdocs/nativeEx_Core/Finish/2 Create Image/folder.project REM ADD TO SERVER curl -T "V:\WB\projects\pscProgs\updates\Projects\Tools/zCopy.exe ftp://user:PWD@nativeex.boot/land.net/httpdocs/Tools/zCopy.exe REM DELETE FROM SERVER curl ftp://user:PWD@nativeex.boot/land.net/httpdocs/ -X 'DELE nativeEx_barebone/Basic/Build/8 - FIPS.Script'Changed files are written as directly executable commands.
Files which are in the server and not on the local host (and vice versa) generate a REM line.
If you want to execute this line, you have to remove the REM text.
You should revise / edit this batch and then start.
This suite is currently running well with nativeEx_barebone.
If you try to use it with your own server:
Please, backup your 'upload area' before!
Peter
EDIT: Sorry, I forgot to link to the 'Magic Upload Suite'