Skip to content

Commit

Permalink
determine revision dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasFey-GIP committed Dec 20, 2024
1 parent faaf5d6 commit 47ddf4f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
13 changes: 10 additions & 3 deletions installation/build/buildFilter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
<property file="${root.dir}/server.properties" />

<!-- depends on server make use of server variable -->
<property name="server.mdm.path" value="${server.path}/${revision.dir}/filter/${mdm.xml.name}" />
<property name="server.mdm.xml.path" value="${server.path}/${revision.dir}/saved/filter/${mdm.xml.name}" />
<property name="server.mdm.xml.filename" value="${mdm.xml.filename}" />
<property name="local.xml.dir" value="${basedir}/xmldefinition" />

Expand All @@ -50,7 +48,6 @@

<map from="${basedir}/lib" to="${revision.dir}/filter/${mdm.xml.name}" />
</pathconvert>
<property name="deploy.template" value="addfilter -sharedLibs ${deploy.sharedlibs} -jarFiles ${deploy.jars} -triggerName ${trigger.name} -filterName ${filter.name} -workspaceName '${workspacename}' -fqClassName ${fqclassname}" />

<resolver:pom file="${basedir}/pom.xml" id="pom"/>

Expand Down Expand Up @@ -106,6 +103,16 @@
<!-- CAUTION: Do not attempt to launch this from here. Launch from build.xml instead. -->
<target name="deploy" depends="build" description="Deploy jar file to xyna server.">
<fail message="No server properties specified. Unable to deploy." unless="server.available" />
<local name ="revision" />
<local name = "revision.dir" />
<local name = "deploy.template" />
<local name = "server.mdm.xml.path" />
<determine-revision workspacename="${workspacename}" outputproperty="revision" />
<property name="revision.dir" value="../revisions/rev_${revision}" />
<property name="server.mdm.path" value="${server.path}/${revision.dir}/filter/${mdm.xml.name}" />
<property name="deploy.template" value="addfilter -sharedLibs ${deploy.sharedlibs} -jarFiles ${deploy.jars} -triggerName ${trigger.name} -filterName ${filter.name} -workspaceName '${workspacename}' -fqClassName ${fqclassname}" />
<property name="server.mdm.xml.path" value="${server.path}/${revision.dir}/saved/filter/${mdm.xml.name}" />

<!-- clean directory on xyna server -->
<!--<custom-ssh-exec host="${server.host}" username="${server.userid}" command="rm -rf ${server.mdm.path}" /> -->
<!-- create directory on xyna server -->
Expand Down
22 changes: 22 additions & 0 deletions installation/build/macros.xml
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,26 @@
</sequential>
</macrodef>

<!-- =================================
macro: determine-workspace-revision
================================= -->
<macrodef name="determine-revision">
<attribute name="workspacename" />
<attribute name="outputproperty" />
<sequential>
<local name="command" />
<if>
<matches pattern="^default workspace$" string="@{workspacename}"/>
<then>
<property name="command" value="cd ${server.path}; echo workingset" />
</then>
<else>
<property name="command" value="cd ${server.path}; ./xynafactory.sh printrevision -workspaceName '@{workspacename}'" />
</else>
</if>
<custom-ssh-exec host="${server.host}" username="${server.userid}" command="${command}" outputproperty="@{outputproperty}" />
<echo message="determined revision for '@{workspacename}' to be ${@{outputproperty}}" />
</sequential>
</macrodef>

</project>

0 comments on commit 47ddf4f

Please sign in to comment.