Ich bin wieder unter die Programmierer gegangen
Wow, wie geil.....
Heute habe ich den ganzen Tag gute alte MS-DOS Batch Programmierung gemacht (sowas altmodisches kann hier ja keiner mehr).
Ziemlich cool, fange wieder an am Programmieren Spaß zu haben.
Grüsse aus dem Tunnel
Tron
PS: Wer einen Fehler findet kann ihn behalten :-)
@echo off
REM
REM batch file for creating and commiting HANA XS application
REM
REM syntax for call:
REM regi_cmdliner <system:port> <user> <password> <projectname> <Deployment Unit> <source files>
REM
REM check parameter
if [%1] == [] goto noarg_system
if [%2] == [] goto noarg_user
if [%3] == [] goto noarg_password
if [%4] == [] goto noarg_projectname
if [%5] == [] goto noarg_deploymentunit
if [%6] == [] goto noarg_sourcefiles
if not exist %6 echo source directory %6 not existent, parameter ^<source_files^> wrong
if not exist %6 goto :help
REM set basic environment
REM regi installation assumed in "c:\program files\sap\hdbclient\"
PATH=c:\program files\sap\hdbclient\;%path%
SET REGI_USER=%2
SET REGI_PASSWD=%3
SET REGI_HOST=%1
REM project root always in C:\
cd c:\
if exist %4 rmdir %4 /S/Q
mkdir %4
cd %4
REM delete old content for that project
regi undeploy %5
regi delete package %4
REM prepare workspace for project <projectname> in Delivery Unit <delivery unit>
regi create workspace
IF %ERRORLEVEL% NEQ 0 GOTO end
REM source code folder
mkdir %4
cd %4
regi create deliveryunit %5
regi create package %4 --deliveryunit=%5
IF %ERRORLEVEL% NEQ 0 GOTO end
regi track %4
IF %ERRORLEVEL% NEQ 0 GOTO end
REM provide some information
regi status
REM create default files
REM .xsapp
ECHO. >>.xsapp
ECHO File .xsapp created
REM .xsaccess
ECHO { >>.xsaccess
ECHO "exposed" : true, >>.xsaccess
ECHO "authentication" : >>.xsaccess
ECHO [ >>.xsaccess
ECHO { "method" : "Basic" } >>.xsaccess
ECHO ] >>.xsaccess
ECHO } >>.xsaccess
ECHO File .xsaccess created
REM .project
ECHO ^<?xml version="1.0" encoding="UTF-8"^?^> >>.PROJECT
ECHO ^<projectDescription^> >>.PROJECT
ECHO ^<name^>%4^</name^> >>.PROJECT
ECHO ^<comment^>Application %4 submitted via SAP Deployment Infrastructure Hub^</comment^> >>.PROJECT
ECHO ^<projects^> >>.PROJECT
ECHO ^</projects^> >>.PROJECT
ECHO ^<buildSpec^> >>.PROJECT
ECHO ^<buildCommand^> >>.PROJECT
ECHO ^<name^>org.eclipse.wst.jsdt.core.javascriptValidator^</name^> >>.PROJECT
ECHO ^<arguments^> >>.PROJECT
ECHO ^</arguments^> >>.PROJECT
ECHO ^</buildCommand^> >>.PROJECT
ECHO ^<buildCommand^> >>.PROJECT
ECHO ^<name^>com.sap.ndb.studio.xse.editor.xsjsLintBuilder^</name^> >>.PROJECT
ECHO ^<arguments^> >>.PROJECT
ECHO ^</arguments^> >>.PROJECT
ECHO ^</buildCommand^> >>.PROJECT
ECHO ^</buildSpec^> >>.PROJECT
ECHO ^<natures^> >>.PROJECT
ECHO ^<nature^>com.sap.ndb.studio.xse.editor.xsjsNature^</nature^> >>.PROJECT
ECHO ^<nature^>com.sap.ndb.studio.xse.editor.xsjsLintNature^</nature^> >>.PROJECT
ECHO ^<nature^>org.eclipse.wst.jsdt.core.jsNature^</nature^> >>.PROJECT
ECHO ^<nature^>com.sap.ndb.studio.dwb.tools.core.hanaNature^</nature^> >>.PROJECT
ECHO ^</natures^> >>.PROJECT
ECHO ^</projectDescription^> >>.PROJECT
ECHO File .project created
REM pull source files into workspace
xcopy %6 /s/e/y
REM commit and activate the whole stuff
regi commit
regi activate
REM done, now for some housekeeping
regi untrack %4
cd \
goto end
REM --------------
REM error handling
REM --------------
:noarg_system
echo --^> parameter ^<system^> missing
goto help
:noarg_user
echo --^> parameter ^<user^> missing
goto help
:noarg_password
echo --^> parameter ^<password^> missing
goto help
:noarg_projectname
echo --^> parameter ^<projectname^> missing
goto help
:noarg_deploymentunit
echo --^> parameter ^<deployment unit^> missing
goto help
:noarg_sourcefiles
echo --^> parameter ^<sourcefiles^> missing
goto help
:help
echo --^> call DIH_REGI ^<system^> ^<user^> ^<password^> ^<projectname^> ^<deployment unit^> ^<sourcefiles^>
echo --^> for ^<system^> specify host:3^<sid^>15
:end
Heute habe ich den ganzen Tag gute alte MS-DOS Batch Programmierung gemacht (sowas altmodisches kann hier ja keiner mehr).
Ziemlich cool, fange wieder an am Programmieren Spaß zu haben.
Grüsse aus dem Tunnel
Tron
PS: Wer einen Fehler findet kann ihn behalten :-)
@echo off
REM
REM batch file for creating and commiting HANA XS application
REM
REM syntax for call:
REM regi_cmdliner <system:port> <user> <password> <projectname> <Deployment Unit> <source files>
REM
REM check parameter
if [%1] == [] goto noarg_system
if [%2] == [] goto noarg_user
if [%3] == [] goto noarg_password
if [%4] == [] goto noarg_projectname
if [%5] == [] goto noarg_deploymentunit
if [%6] == [] goto noarg_sourcefiles
if not exist %6 echo source directory %6 not existent, parameter ^<source_files^> wrong
if not exist %6 goto :help
REM set basic environment
REM regi installation assumed in "c:\program files\sap\hdbclient\"
PATH=c:\program files\sap\hdbclient\;%path%
SET REGI_USER=%2
SET REGI_PASSWD=%3
SET REGI_HOST=%1
REM project root always in C:\
cd c:\
if exist %4 rmdir %4 /S/Q
mkdir %4
cd %4
REM delete old content for that project
regi undeploy %5
regi delete package %4
REM prepare workspace for project <projectname> in Delivery Unit <delivery unit>
regi create workspace
IF %ERRORLEVEL% NEQ 0 GOTO end
REM source code folder
mkdir %4
cd %4
regi create deliveryunit %5
regi create package %4 --deliveryunit=%5
IF %ERRORLEVEL% NEQ 0 GOTO end
regi track %4
IF %ERRORLEVEL% NEQ 0 GOTO end
REM provide some information
regi status
REM create default files
REM .xsapp
ECHO. >>.xsapp
ECHO File .xsapp created
REM .xsaccess
ECHO { >>.xsaccess
ECHO "exposed" : true, >>.xsaccess
ECHO "authentication" : >>.xsaccess
ECHO [ >>.xsaccess
ECHO { "method" : "Basic" } >>.xsaccess
ECHO ] >>.xsaccess
ECHO } >>.xsaccess
ECHO File .xsaccess created
REM .project
ECHO ^<?xml version="1.0" encoding="UTF-8"^?^> >>.PROJECT
ECHO ^<projectDescription^> >>.PROJECT
ECHO ^<name^>%4^</name^> >>.PROJECT
ECHO ^<comment^>Application %4 submitted via SAP Deployment Infrastructure Hub^</comment^> >>.PROJECT
ECHO ^<projects^> >>.PROJECT
ECHO ^</projects^> >>.PROJECT
ECHO ^<buildSpec^> >>.PROJECT
ECHO ^<buildCommand^> >>.PROJECT
ECHO ^<name^>org.eclipse.wst.jsdt.core.javascriptValidator^</name^> >>.PROJECT
ECHO ^<arguments^> >>.PROJECT
ECHO ^</arguments^> >>.PROJECT
ECHO ^</buildCommand^> >>.PROJECT
ECHO ^<buildCommand^> >>.PROJECT
ECHO ^<name^>com.sap.ndb.studio.xse.editor.xsjsLintBuilder^</name^> >>.PROJECT
ECHO ^<arguments^> >>.PROJECT
ECHO ^</arguments^> >>.PROJECT
ECHO ^</buildCommand^> >>.PROJECT
ECHO ^</buildSpec^> >>.PROJECT
ECHO ^<natures^> >>.PROJECT
ECHO ^<nature^>com.sap.ndb.studio.xse.editor.xsjsNature^</nature^> >>.PROJECT
ECHO ^<nature^>com.sap.ndb.studio.xse.editor.xsjsLintNature^</nature^> >>.PROJECT
ECHO ^<nature^>org.eclipse.wst.jsdt.core.jsNature^</nature^> >>.PROJECT
ECHO ^<nature^>com.sap.ndb.studio.dwb.tools.core.hanaNature^</nature^> >>.PROJECT
ECHO ^</natures^> >>.PROJECT
ECHO ^</projectDescription^> >>.PROJECT
ECHO File .project created
REM pull source files into workspace
xcopy %6 /s/e/y
REM commit and activate the whole stuff
regi commit
regi activate
REM done, now for some housekeeping
regi untrack %4
cd \
goto end
REM --------------
REM error handling
REM --------------
:noarg_system
echo --^> parameter ^<system^> missing
goto help
:noarg_user
echo --^> parameter ^<user^> missing
goto help
:noarg_password
echo --^> parameter ^<password^> missing
goto help
:noarg_projectname
echo --^> parameter ^<projectname^> missing
goto help
:noarg_deploymentunit
echo --^> parameter ^<deployment unit^> missing
goto help
:noarg_sourcefiles
echo --^> parameter ^<sourcefiles^> missing
goto help
:help
echo --^> call DIH_REGI ^<system^> ^<user^> ^<password^> ^<projectname^> ^<deployment unit^> ^<sourcefiles^>
echo --^> for ^<system^> specify host:3^<sid^>15
:end
Super Danke Schon.
AntwortenLöschen