How to install updates on Progress-4GL programs - installation

Good afternoon,
In my company, we are regularly doing updates on customers' systems, all Progress-4GL technology. Currently we are doing all this manually, and I'd like to automate this.
The following actions are needed:
Take a dump (*.df) of the current database
Upload modifications to the database (*.df files)
compile *.w and *.p files.
Is there a tool that does all that (together with zipping/unzipping *.w, *.p and *.i files), or do I need to create such a tool myself?
In the latter case, what are the commandline commands for the mentioned actions:
Take a dump (*.df) of the current database
Upload modifications to the database (*.df files)
compile *.w and *.p files.

If you're familiar with ANT, the take a look at the PCT plugin for ANT:
https://github.com/Riverside-Software/pct
This makes is easy to create a delta.df file between the "new" full DF and the current database, e.g.:
<PCTDumpIncremental destFile="temp/delta.df" dlcHome="${dlc}"
debugLevel="2" activeIndexes="0" removeEmptyDFFile="true" msgBufferSize="${Mm}" >
<SourceDB dbname="temp/ref-SmartDB" singleUser="true" />
<TargetDB dbname="${smartdb}" dbDir="${smartdbdir}" singleUser="${smartdbsingleuser}"/>
</PCTDumpIncremental>
and then load the delta.df into the current application DB:
<PCTLoadSchema srcFile="temp/delta.df" dlcHome="${dlc}" onlineChanges="true" callbackClass="rssw.pct.AbstractLoadCallback" msgBufferSize="${Mm}" commitWhenErrors="false">
<DBConnectionSet refid="smartdbset" />
</PCTLoadSchema>
and then compile the application:
<PCTCompile destDir="${installroot}" graphicalMode="true" dlcHome="${dlc}"
md5="true" minSize="false" cpinternal="${cpinternal}" cpColl="${cpcoll}" cpstream="${cpstream}"
compileUnderscore="true" inputchars="32000" baseDir="${installroot}"
token="4000" progPerc="10" assemblies="${assemblies}">
<fileset dir="${installroot}" casesensitive="false">
<include name="Ccs/**/*.cls"/>
<include name="Consultingwerk/**/*.cls"/>
<include name="Consultingwerk/**/*.p"/>
<include name="Consultingwerk/**/*.w"/>
<include name="Setup/**/*.p"/>
<include name="src/**/*.p"/>
</fileset>
<propath>
<pathelement path="${installroot}/." />
<pathelement path="${installroot}/src" />
<pathelement path="${installroot}/Consultingwerk/Studio/ProdictDumpHack/src" />
<pathelement path="${dlc}/gui/netlib/OpenEdge.Net.pl" />
</propath>
<DBConnectionSet refid="smartdbset" />
</PCTCompile>
ANT and PCT are included in OpenEdge from 11.7 on. Since you're on 11.6, you'll have to bring your own ANT and PCT.

Related

How to create sitemap.xml from docbook source

I need to generate sitemap.xml in the standard Google acceptable format from my docbook source. I'm currently using gradle to power the build process.
Is there an existing tool out there to generate sitemap.xml automatically as part of the build?
By Using Ant from Gradle is seams to be possible as there is an Apache Ant Task for generating a XML Sitemap. Read the manual at GitHub, for the usage details.
<target name="generate_sitemap" description="generates the sitemap">
<taskdef classname="uk.co.arjones.ant.task.Sitemap" name="sitemap"></taskdef>
<sitemap url="http://organisation.org" gzip="yes" lastmod="now" destdir="${BUILD_DIR}">
<fileset dir="${BUILD_DIR}">
<include name="**.docbook"></include>
<include name="**.dbx"></include>
<exclude name="google*"></exclude>
</fileset>
</sitemap>
</target>

Cant get Junit to work with Spring in an ANT build

I am trying to get Spring MVC and Junit working with eachother and I am having trouble configuring the build.xml file. I am fairly new at using ANT and do not really understand all the tutorials. I put the junit.jar file in the lib direcotory, but still am getting the following message from my console.
test:
BUILD FAILED
C:\Java\mmz\WEB-INF\build.xml:63: The <classpath> for <junit> must include junit.jar if not in Ant's own classpath
Total time: 223 milliseconds
Edit
Here is an example of wanting to run just one test
and I am not sure what I need to do, i tried doing something like the following, but I dont quite understand what its doing, so I dont know how to make changes
<path id="classpath.test">
<pathelement location="" />
<pathelement location="${test.dir}" />
</path>
<target name="test">
<junit>
<classpath refid="classpath.test" />
<formatter type="brief" usefile="false" />
<test name="TesterTest" />
</junit>
</target>
I am pretty lost on what to do next. Thanks
If you copy-pasted your build.xml file then there is probably a classpath element somewhere. Probably near the top of the file. In that element they have probably listed some paths and/or files. You need to add the junit jar to this section.

is it possible to make nant run a publish on web application project

is it possible to make nant run a publish on mvc project or a good old web application project
and after the publish make nant FTP the files to the web server
UPDATE: found the solution to the ftp problem
Nant ftp task thanks Paco
what i mean by publich
is there a command line application or nant task that can public like visual studio publish...
The visual studio publish command rebuilds your solution and then copies the files in the solution directory to a new directory. I use the following target to do almost the same:
<target name="copyToPublish">
<delete dir="${dir.publish}" />
<mkdir dir="${dir.publish}" />
<mkdir dir="${dir.publish}\wwwroot"/>
<copy todir="${dir.publish}\wwwroot" includeemptydirs="false">
<fileset basedir="${website.dir}">
<exclude name="**/*.cs"/>
<exclude name="**/*.pdb"/>
<exclude name="**/*.csproj*"/>
<exclude name="**/obj/**"/>
<include name="**/*.*"/>
</fileset>
</copy>
<mkdir dir="${dir.publish}\database"/>
<copy todir="${dir.publish}\database" includeemptydirs="false">
<fileset basedir="${dir.databasescripts}">
<include name="**/*.sql" />
</fileset>
</copy>
<xmlpoke
file="${dir.publish}\wwwroot\Web.config"
xpath="/configuration/system.web/compilation/#debug"
value="false" />
<xmlpoke
file="${dir.publish}\wwwroot\Web.config"
xpath="/configuration/system.web/trace/#enabled"
value="false" />
<move file="${dir.publish}\wwwroot\Web.config" tofile="${dir.publish}\wwwroot\Release.config" overwrite="true" />
<delete file="${dir.publish}\wwwroot\Web.config" />
</target>
Before this target you have to run the normal build procedure of course.
There is a Ftp Task for nant.
Beside that, you have to create a script that copies the files and directories you need and the config files. I don't do it automatically, because I want to have control over database update scripts and changes in web.config.

NAnt/NAntContrib 'VB6' failed to start on remote build

Background
I'm putting together a Continuous Integration system at work on two VMs running on my local desktop. VM #1 (Toolbox) is running CruiseControl.Net, Subversion, BugTracker.Net and SQL Server Express. VM #2 (BuildMaster) is running NAnt with NAntContrib and has VB 6.0 and the 1.0/1.1/2.0/3.5 .Net Framework SDKs installed. The intent is to tightly control what's installed on BuildMaster and be much looser on Toolbox and developer workstations.
Issue
I had a CCNet project on Toolbox that successfully compiled a test VB 6.0 application on BuildMaster, but the build started failing last week. The only thing I remember doing was install BugTracker.Net and SQL Server Express on Toolbox.
Symptoms
The build fails and returns an exception:
<![CDATA[Starting 'vb6 ( /make "\\buildmaster\Working\TestApp\TestApp.vbp" /outdir "\\buildmaster\Working\TestApp\build" /out "\\buildmaster\Working\TestApp\TestApp.build.err")' in '\\buildmaster\Working\TestApp']]></message><duration>711.02240000000006</duration></task><duration>761.09440000000006</duration></target><failure><builderror><type>NAnt.Core.BuildException</type><message><![CDATA['vb6' failed to start.]]></message><location><filename>\\buildmaster\Working\TestApp\TestApp.build</filename><linenumber>39</linenumber><columnnumber>4</columnnumber></location><stacktrace><![CDATA[ at NAnt.Core.Tasks.ExternalProgramBase.StartProcess() in c:\Nant\src\NAnt.Core\Tasks\ExternalProgramBase.cs:line 501
at NAnt.Core.Tasks.ExternalProgramBase.ExecuteTask() in c:\Nant\src\NAnt.Core\Tasks\ExternalProgramBase.cs:line 386
at NAnt.Contrib.Tasks.Vb6Task.ExecuteTask() in c:\Nant\contrib\src\Tasks\Vb6Task.cs:line 220
at NAnt.Core.Task.Execute() in c:\Nant\src\NAnt.Core\Task.cs:line 186
at NAnt.Core.Target.Execute() in c:\Nant\src\NAnt.Core\Target.cs:line 247
at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies) in c:\Nant\src\NAnt.Core\Project.cs:line 910
at NAnt.Core.Project.Execute() in c:\Nant\src\NAnt.Core\Project.cs:line 862
at NAnt.Core.Project.Run() in c:\Nant\src\NAnt.Core\Project.cs:line 947]]></stacktrace><internalerror><type>System.ComponentModel.Win32Exception</type><message><![CDATA[The system cannot find the file specified]]></message><stacktrace><![CDATA[ at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at NAnt.Core.Tasks.ExternalProgramBase.StartProcess() in c:\Nant\src\NAnt.Core\Tasks\ExternalProgramBase.cs:line 498]]></stacktrace></internalerror></builderror></failure><duration>1211.7424</duration></buildresults>
Obviously, the meat of the exception is [CDATA['vb6' failed to start.]]. My problem is that when I run the Nant build directly on BuildMaster it completes the build successfully every time.
For the sake of completeness, here's my NAnt build script:
<?xml version="1.0" ?>
<project name="TestApp" default="build">
<!-- set build.date property to current date in format yyyy-MM-dd -->
<tstamp property="build.date" pattern="yyyy-MM-dd" />
<!-- global project settings -->
<property name="project.name" value="TestApp" />
<property name="project.version" value="1.00" unless="${property::exists('project.version')}" />
<property name="project.release.type" value="release" unless="${property::exists('project.release.type')}" /> <!-- nightly / dev / alpha / beta# / rc# / release -->
<property name="build.warnaserror" value="false" />
<!-- default configuration -->
<property name="project.client" value="" />
<property name="build.defines" value="" />
<property name="build.number" value="${math::abs(math::floor(timespan::get-total-days(datetime::now() - datetime::parse('01/01/2000'))))}" />
<!-- platform specific properties. These are the defaults -->
<property name="current.build.defines" value="${build.defines}" />
<!-- Build Tasks -->
<target name="init" description="Initializes build properties">
<property name="build.dir" value="${project::get-base-directory()}\build" />
<echo message="Build Directory is ${build.dir}" />
</target>
<target name="clean" depends="init" description="Deletes current build configuration">
<echo message="Clearing out files before recompiling..." />
<delete verbose="true">
<fileset basedir="${build.dir}">
<include name="TestApp*.exe" />
</fileset>
</delete>
</target>
<target name="build" depends="clean" description="Perform a build of the base TestApp product">
<mkdir dir="${build.dir}" unless="${directory::exists(build.dir)}" />
<!-- Actually compile VB6 project into executable -->
<vb6 project="TestApp.vbp" outdir="${build.dir}" errorfile="TestApp.build.err" verbose="true" />
</target>
</project>
Your help is greatly appreciated!
I might be misinterpreting your question so please bear with me. CCNet's nant task operatates on the local machine (the machine running CCNet).
If ToolBox is running CCNet but BuildMaster is running all tools (i.e. VB6, etc), I'm fairly sure there no way to do what's being attempted. Generally, CCNet needs to be running on the machine actually performing the builds. Therefore, the fact that VB6 cannot be found is because VB6 is not installed on ToolBox.
However, CCNet does have a way to monitor/control multiple build servers from one. So in your case you could configure ToolBox to control BuildMaster's builds, but CCNet would need to be installed on both. For a reference on something like this you can check out Splitting the build on CCNet's site.

How do I create a ZIP file of my Cruise Control builds?

I use CruiseControl.NET to automatically build my .NET 3.5 web applications, which works a treat. However, is there any way to automatically create a ZIP file of these builds, and put the ZIP's into a separate directory?
I have seen this is possible using NAnt but cannot find an example of how to get this working.
Can anyone offer help/examples?
I've just added such a Nant task to our CC machine.
See http://nant.sourceforge.net/release/latest/help/tasks/zip.html
Note when initially viewing the zip archive, it may appear as if all the files are at the same level, i.e no folders, but actually they folders are preserved.
Notice how you can exclude file types or folders.
You could take the approach of only including the file types you want and excluding the rest.
First define properties for where the source files are allcode.dir and the name and location of the zip file sourcebackup.zip
Now here is the nant task
<zip zipfile="${sourcebackup.zip}" includeemptydirs="true" verbose="true">
<fileset basedir="${allcode.dir}">
<include name="**/*" />
<exclude name="**/_resharper*/**" />
<exclude name="**/build/**" />
<exclude name="**/obj/**" />
<exclude name="**/bin/**" />
<exclude name="**/*.dll" />
<exclude name="**/*.scc" />
<exclude name="**/*.log" />
<exclude name="**/*.vssscc" />
<exclude name="**/*.suo" />
<exclude name="**/*.user" />
<exclude name="**/*.pdb" />
<exclude name="**/*.cache" />
<exclude name="**/*.vspscc" />
<exclude name="**/*.msi" />
<exclude name="**/*.irs" />
<exclude name="**/*.exe" />
</fileset>
<echo message="########## Zipped##########" />
Call this from your cc build like any other nant task.
We find it best if each CC project calls a single task if possible, then you only have to change the nant script, and you can run the nant script on your local machine.
Eg in the project block, we have the single target "build", which as part of its work calls ZipSource
<targetList>
<target>Build</target>
</targetList>
We use the above for a BizTalk project.
Enjoy.
If you're using Nant, then doesn't the Zip task work for you?
We are zipping the sources of a CruiseControl.NET project
but we are using ant
<target name="zipProject">
<mkdir dir="output"/>
<zip destfile="output\sources.zip" basedir="C:\project\src" />
</target>
i don't know about nant but i would expect it to be similar
#David: The NAnt Zip task is what I'm after, yes, but I'm asking how to integrate it as part of an automatic CruiseControl.NET build. If you take a look at the NAnt documentation for the cruise control config it doesn't make it clear if I can run an NAnt task from inside the <tasks> XML node in my CruiseControl config - it only says that it can be part of a <schedule>.
I have found a few examples of setting up your CruiseControl config and a few examples of NAnt tasks but nothing that integrates the two: specifically, zipping up a CruiseControl build.
If anyone has some sample XML of their CruiseControl config, hooking up to an NAnt zip task, post samples here.
Cheers.

Resources