Please refer to the: build/deploy.edex/ReadMe.txt amend: remove files that are not used by the developer deployment Change-Id: I7caaf61e88d315ea0d065d46036d3ba9530c29ec Former-commit-id:dc5cae7ea1
[formerlyc963a90ce0
] [formerlydc5cae7ea1
[formerlyc963a90ce0
] [formerly5b7f86d9d4
[formerly d881ba5d55c41647e5b3c4dfecd7ea89ad7ec2eb]]] Former-commit-id:5b7f86d9d4
Former-commit-id:28f6a3a613
[formerly176d002ad4
] Former-commit-id:5f3ca819dd
120 lines
4 KiB
Groovy
120 lines
4 KiB
Groovy
/**
|
|
* This software was developed and / or modified by Raytheon Company,
|
|
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
|
*
|
|
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
|
* This software product contains export-restricted data whose
|
|
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
|
* to non-U.S. persons whether in the United States or abroad requires
|
|
* an export license or other authorization.
|
|
*
|
|
* Contractor Name: Raytheon Company
|
|
* Contractor Address: 6825 Pine Street, Suite 340
|
|
* Mail Stop B8
|
|
* Omaha, NE 68106
|
|
* 402.291.0100
|
|
*
|
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
|
* further licensing information.
|
|
**/
|
|
|
|
import groovy.util.logging.*
|
|
|
|
/**
|
|
* Deploys the EDEX esb scripts, libraries, and other files.
|
|
*
|
|
* <pre>
|
|
*
|
|
* SOFTWARE HISTORY
|
|
*
|
|
* Date Ticket# Engineer Description
|
|
* ------------ ---------- ----------- --------------------------
|
|
* Dec 4, 2014 3836 bkowal Initial Commit
|
|
*
|
|
* </pre>
|
|
*
|
|
* @author bkowal
|
|
* @version 1.0
|
|
*/
|
|
@Log
|
|
class DeployESB
|
|
{
|
|
private static final String SETUP_ENV = "setup.env"
|
|
|
|
private DeployESB()
|
|
{
|
|
}
|
|
|
|
public static void deploy(String edexRootDirectory, String esbDirectory, String overrideArchitecture)
|
|
{
|
|
if (new File(esbDirectory).exists() == false)
|
|
{
|
|
log.log(java.util.logging.Level.SEVERE,
|
|
"The specified esb directory does not exist - " + esbDirectory)
|
|
System.exit(-1)
|
|
}
|
|
|
|
new File(edexRootDirectory).mkdirs()
|
|
|
|
// deploy the ESB directory structure.
|
|
AntBuilder ant = new AntBuilder()
|
|
ant.project.getBuildListeners().firstElement().setMessageOutputLevel(0)
|
|
|
|
log.info "Deploying ESB ..."
|
|
ant.copy( todir : edexRootDirectory,
|
|
overwrite : true )
|
|
{
|
|
fileset( dir : esbDirectory )
|
|
}
|
|
|
|
// remove setup.env
|
|
new File(edexRootDirectory + File.separator + "bin" + File.separator + SETUP_ENV).delete()
|
|
// remove lib_illusion
|
|
new File(edexRootDirectory + File.separator + "lib" + File.separator + "lib_illusion").deleteDir()
|
|
|
|
// copy the correct lib_illusion based on architecture
|
|
// determine architecture?
|
|
|
|
// since this is only a temporary consideration since we will eventually be switching to a 64-bit
|
|
// EDEX, we will just look at the OS architecture since the JDK does not provide a simple way
|
|
// to retrieve the required information about the JVM process, itself. The -Darchitecture argument
|
|
// can be used to override the dynamically determined architecture
|
|
String architecture = overrideArchitecture
|
|
if (architecture == "")
|
|
{
|
|
architecture =
|
|
(System.getProperty("os.arch") == "amd64") ? "x86_64" : "x86"
|
|
}
|
|
String esbLibIllusionPath = esbDirectory + File.separator + "lib" + File.separator +
|
|
"lib_illusion" + File.separator + architecture
|
|
if (new File(esbLibIllusionPath).exists() == false)
|
|
{
|
|
log.log(java.util.logging.Level.SEVERE,
|
|
"Unable to find the illusion lib associated with architecture - " + architecture)
|
|
System.exit(-1)
|
|
}
|
|
|
|
String libIllusionDestination = edexRootDirectory + File.separator +
|
|
"lib" + File.separator + "lib_illusion"
|
|
new File(libIllusionDestination).mkdirs()
|
|
ant.copy( todir : libIllusionDestination, overwrite : true )
|
|
{
|
|
fileset( dir : esbLibIllusionPath )
|
|
}
|
|
}
|
|
|
|
public static void deployEdexConfiguration(String edexRootDirectory, String esbDirectory)
|
|
{
|
|
final String setupEnvSrc = esbDirectory + File.separator + "bin" + File.separator + SETUP_ENV
|
|
final String destinationDirectory = edexRootDirectory + File.separator + "bin"
|
|
|
|
AntBuilder ant = new AntBuilder()
|
|
ant.project.getBuildListeners().firstElement().setMessageOutputLevel(0)
|
|
|
|
ant.copy( todir : destinationDirectory,
|
|
overwrite : true )
|
|
{
|
|
fileset( file : setupEnvSrc )
|
|
}
|
|
}
|
|
}
|