ivandidu / oracle-ddl2svn

Automatically exported from code.google.com/p/oracle-ddl2svn
0 stars 0 forks source link

add support for git #46

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

{sample}

@echo off
rem DESCRIPTION
rem two-step script
rem 1) get DDLs from oracle schema
rem 2) auto-commit DDLs in SVN

rem REQUREMENTS
rem java must be installed
rem svn console client must be installed
rem output dir must be under version control in svn

rem SET PARAMETERS
rem first parameter is DB_URL
rem second parameter is OUTPUT_DIR
rem you can overwrite this parameters
set DB_URL=
set OUTPUT_DIR=
set GIT_USER=
set COMMIT_MESSAGE="automatic commit by oracle-ddl2svn"

set WORKING_DIR=%cd%

rem test db connection,
rem if db connect is fail, do not perform any filesystem operation, only clean 
tmp file end exit
echo =========  start of test db connection %date% %time% ==============
set tempfile=connection.tmp
del %tempfile%
java -jar scheme2ddl.jar --test-connection -url %DB_URL% > %tempfile% 2>&1
find "FAIL connect to" %tempfile%
if not errorlevel 1 goto :exit

:runScript
rem delete all files from output directory exept system files
rem this command must keep on disk svn meta information stored in .svn folders
echo =========  start of scheme2ddl %date% %time% ==============
cd %OUTPUT_DIR%
git clean -f -d
git rm -rf .
cd %WORKING_DIR%
java -jar scheme2ddl.jar -url %DB_URL% -output %OUTPUT_DIR%
echo =========  end of scheme2ddl %date% %time% ==============
rem for /f "tokens=2*" %%i in ('svn status %OUTPUT_DIR% ^| find "?"') do svn 
add "%%i"
rem for /f "tokens=2*" %%i in ('svn status %OUTPUT_DIR% ^| find "!"') do svn 
delete "%%i"
rem svn commit -m %COMMIT_MESSAGE% %OUTPUT_DIR%  --non-interactive 
--no-auth-cache --username %SVN_USER% --password %SVN_PASS%
rem echo =========  end of svn commit %date% %time% ==============
cd %OUTPUT_DIR%
git add -A
git commit -m %COMMIT_MESSAGE%

:exit
cd %WORKING_DIR%
del %tempfile%

Original issue reported on code.google.com by jirasam...@gmail.com on 24 Mar 2015 at 1:15