Permalink
Browse files

WIP: release script

  • Loading branch information...
1 parent d1a3312 commit 6c2058d9b2d520191337d95b61c2c78117c6737b Richard Young committed Nov 9, 2011
Showing with 219 additions and 0 deletions.
  1. +14 −0 README
  2. +29 −0 README.md
  3. +40 −0 config/sample_acceptor.cfg
  4. +46 −0 config/sample_initiator.cfg
  5. +50 −0 package_release.bat
  6. +16 −0 scripts/create_zip.rb
  7. +11 −0 scripts/update_download_page.rb
  8. +13 −0 update_download_page.bat
View
14 README
@@ -0,0 +1,14 @@
+QuickFIX/n README
+
+Introduction
+=====================
+QuickFIX/n implements the FIX protocol on .NET.
+For more information, visit http://www.quickfixn.org
+
+File and Directory Information
+==============================
+README - this file
+LICENSE - license information
+bin - Contains the QuickFix.dll library
+config - Contains sample config files for an acceptor or initiator
+spec - Contains the various FIX data dictionaries
View
@@ -95,6 +95,35 @@ To run a test with the debugger,
8. In command terminal, go into "AcceptanceTest" directory
9. Run: `ruby Runner.rb 127.0.0.1 5001 definitions\server\fix42\YourTestName.def`
+
+Packaging and Releasing
+-----------------------
+Prerequisites:
+ 1. git (http://code.google.com/p/msysgit/) is setup and in your Windows PATH
+ 2. ruby is installed and in your Windows PATH
+ 3. nokogiri and rubyzip gems are installed.
+ 4. MSBuild.exe (v3.5) is in your Windows PATH
+ 5. Python 2.7 (http://www.python.org/getit/releases/2.7)
+ 6. s3cmd 1.0.1 (http://sourceforge.net/projects/s3tools/files/s3cmd). After you download and extract the files, run `python setup.py install`. Then run `python C:\Python27\Scripts\s3cmd --configure`, and enter the access key (s3 account) anad secret (s3 account), found on the wiki (http://wiki.private.connamara.com/index.php?title=EC2)
+
+First, make sure you're on master, and you have the most recent changes:
+ git checkout master
+ git pull
+
+Next, the download page needs to be updated to point to the new zip. This must be done first, so the changes to the page will be part of the version tag. The following script will update the download page and commit the changes into git:
+ update_download_page.bat <TAGNAME>
+
+Then, create a tag:
+ git tag -a <TAGNAME> -m "Created a tag for version <TAGNAME>"
+
+Next, run `package_release.bat` to build, package, and upload QuickFIX/n to the web:
+
+After the script is done, you will need to manually push the tag:
+
+ git push origin <TAGNAME>
+
+Finally [Deploy the website](wiki/Deploying-the-website).
+
Website
-------
View
@@ -0,0 +1,40 @@
+# default settings for sessions
+[DEFAULT]
+FileStorePath=store
+FileLogPath=log
+ConnectionType=acceptor
+ReconnectInterval=60
+SenderCompID=ARCA
+
+# session definition
+[SESSION]
+# inherit FileStorePath, FileLogPath, ConnectionType, ReconnectInterval and SenderCompID from default
+BeginString=FIX.4.1
+TargetCompID=TW
+StartTime=12:30:00
+EndTime=23:30:00
+HeartBtInt=20
+SocketAcceptPort=9823
+DataDictionary=..\spec\fix\FIX41.xml
+
+[SESSION]
+BeginString=FIX.4.0
+TargetCompID=TW
+StartTime=12:00:00
+EndTime=23:00:00
+HeartBtInt=30
+SocketAcceptPort=8323
+DataDictionary=..\spec\fix\FIX40.xml
+
+[SESSION]
+BeginString=FIX.4.2
+TargetCompID=TW
+StartTime=12:30:00
+EndTime=21:30:00
+# overide default setting for RecconnectInterval
+ReconnectInterval=30
+HeartBtInt=30
+SocketAcceptPort=6523
+# (optional) only listen for incoming connections on a specific host
+SocketAcceptHost=127.0.0.1
+DataDictionary=..\spec\fix\FIX42.xml
@@ -0,0 +1,46 @@
+# default settings for sessions
+[DEFAULT]
+FileStorePath=store
+FileLogPath=log
+ConnectionType=initiator
+ReconnectInterval=60
+SenderCompID=TW
+
+# session definition
+[SESSION]
+# inherit FileStorePath, FileLogPath, ConnectionType, ReconnectInterval and SenderCompID from default
+BeginString=FIX.4.1
+TargetCompID=ARCA
+StartTime=12:30:00
+EndTime=23:30:00
+HeartBtInt=20
+SocketConnectPort=9823
+SocketConnectHost=127.0.0.1
+DataDictionary=../spec/fix/FIX41.xml
+
+[SESSION]
+BeginString=FIX.4.0
+TargetCompID=ISLD
+StartTime=12:00:00
+EndTime=23:00:00
+HeartBtInt=30
+SocketConnectPort=8323
+SocketConnectHost=127.0.0.1
+DataDictionary=../spec/fix/FIX40.xml
+
+[SESSION]
+BeginString=FIX.4.2
+TargetCompID=INCA
+StartTime=12:30:00
+EndTime=21:30:00
+# overide default setting for RecconnectInterval
+ReconnectInterval=30
+HeartBtInt=30
+SocketConnectPort=6523
+SocketConnectHost=127.0.0.1
+# (optional) alternate connection ports and hosts to cycle through on failover
+SocketConnectPort1=8392
+SocketConnectHost1=8.8.8.8
+SocketConnectPort2=2932
+SocketConnectHost2=12.12.12.12
+DataDictionary=../spec/fix/FIX42.xml
View
@@ -0,0 +1,50 @@
+@echo off
+
+rem Setup variables
+set TAG_VERSION=%1
+if "%TAG_VERSION%" == "" echo "Please provide a version (e.g. package_release.bat v1.0)" && exit /b
+set QF_DIR=quickfixn-%TAG_VERSION%
+
+rem Get requested version
+git checkout %TAG_VERSION%
+if %errorlevel% neq 0 echo "There was an error checking out QuickFIX/n %TAG_VERSION%" && exit /b %errorlevel%
+
+rem Generate code from dd
+ruby generator/generate.rb
+if %errorlevel% neq 0 echo "There was an error generating code from the data dictionaries" && exit /b %errorlevel%
+
+rem Build QuickFIX/n
+call build.bat
+if %errorlevel% neq 0 echo "There was an error building QuickFIX/n" && exit /b %errorlevel%
+
+rem Copy files to temp directory
+rmdir /s /q tmp
+mkdir tmp
+mkdir tmp\%QF_DIR%
+mkdir tmp\%QF_DIR%\bin
+mkdir tmp\%QF_DIR%\spec
+mkdir tmp\%QF_DIR%\config
+copy QuickFIX.NET\bin\Release\QuickFix.dll tmp\%QF_DIR%\bin
+xcopy spec tmp\%QF_DIR%\spec /e /y
+copy config\sample_acceptor.cfg tmp\%QF_DIR%\config\
+copy config\sample_initiator.cfg tmp\%QF_DIR%\config\
+copy README tmp\%QF_DIR%\
+copy LICENSE tmp\%QF_DIR%\
+
+rem Create ZIP
+set ZIP_NAME=%QF_DIR%.zip
+del /q %ZIP_NAME%
+ruby scripts\create_zip.rb tmp/%QF_DIR% %ZIP_NAME%
+if %errorlevel% neq 0 echo "There was an error creating QuickFIX/n ZIP: %ZIP_NAME%" && exit /b %errorlevel%
+
+rem Upload ZIP
+python C:\Python27\Scripts\s3cmd -P put %ZIP_NAME% s3://quickfixn/%ZIP_NAME%
+if %errorlevel% neq 0 echo "There was an error uploading %ZIP_NAME% into the s3" && exit /b %errorlevel%
+
+rem Remove temp directory
+rmdir /s/q tmp
+
+echo
+echo Successfully created QuickFIX/n %TAG_VERSION%.
+echo You can download the zip here: http://quickfixn.s3.amazonaws.com/%ZIP_NAME%
+echo You must manually add and commit web/views/download.md, and deploy the website
View
@@ -0,0 +1,16 @@
+require 'zip/zip'
+require 'zip/zipfilesystem'
+
+if ARGV[0].nil? or ARGV[1].nil?
+ puts "Usage: ruby create_zip.rb <SRC DIR> <DEST_ZIP_FILE>"
+ exit 1
+end
+
+src = File.join(Dir.pwd, ARGV[0])
+dest = File.join(Dir.pwd, ARGV[1])
+
+Zip::ZipFile.open(dest, 'w') do |zipfile|
+ Dir["#{src}/**/**"].reject{|f|f==dest}.each do |file|
+ zipfile.add(file.sub(src+'/',''),file)
+ end
+end
@@ -0,0 +1,11 @@
+if ARGV[0].nil? or ARGV[1].nil?
+ puts "Usage: ruby update_downloads_page.rb <PATH_TO_DOWNLOADS_PAGE> <VERSION_NO>"
+ exit 1
+end
+
+page = File.join(Dir.pwd, ARGV[0])
+ver = ARGV[1]
+
+File.open(page, 'w') do |f|
+ f.puts "Download\n========\n\nThe latest version of QuickFIX/n is #{ver}\n\nYou can download it [here] (http://quickfixn.s3.amazonaws.com/quickfixn-#{ver}.zip)"
+end
View
@@ -0,0 +1,13 @@
+@echo off
+
+rem Setup variables
+set TAG_VERSION=%1
+if "%TAG_VERSION%" == "" echo "Please provide a version (e.g. update_download_page.bat v1.0)" && exit /b
+
+rem Update downloads page - NOTE this must be done first
+ruby scripts\update_downloads_page.rb web/views/download.md %TAG_VERSION%
+if %errorlevel% neq 0 echo "There was an error uploading the downloads page" && exit /b %errorlevel%
+
+rem commit the downloads page, so it will be part of the tag
+git add web/views/download.md
+git commit -m "Download page for version %TAG_VERSION%"

0 comments on commit 6c2058d

Please sign in to comment.