コード例 #1
0
        protected string CreateArchive(RunningDeployment deployment, PackageMetadata packageMetadata)
        {
            var applicationDirectory = ApplicationDirectory.GetApplicationDirectory(
                packageMetadata,
                deployment.Variables,
                fileSystem);

            var customPackageFileName = deployment.Variables.Get(SpecialVariables.Package.CustomPackageFileName);

            if (!string.IsNullOrWhiteSpace(customPackageFileName))
            {
                Log.Verbose($"Using custom package file-name: '{customPackageFileName}'");
            }

            var targetFileName = !string.IsNullOrWhiteSpace(customPackageFileName)
                ? customPackageFileName
                : $"{packageMetadata.Id}.{packageMetadata.Version}{packageMetadata.FileExtension}";

            var targetFilePath = Path.Combine(applicationDirectory, targetFileName);

            var stagingDirectory = deployment.CurrentDirectory;

            jarTool.CreateJar(stagingDirectory, targetFilePath);
            Log.Info($"Re-packaging archive: '{targetFilePath}'");

            return(targetFilePath);
        }
コード例 #2
0
        protected string CreateArchive(RunningDeployment deployment)
        {
            var packageMetadata      = PackageName.FromFile(deployment.PackageFilePath);
            var applicationDirectory = ApplicationDirectory.GetApplicationDirectory(
                packageMetadata,
                deployment.Variables,
                fileSystem);

            var customPackageFileName = deployment.Variables.Get(PackageVariables.CustomPackageFileName);

            if (!string.IsNullOrWhiteSpace(customPackageFileName))
            {
                Log.Verbose($"Using custom package file-name: '{customPackageFileName}'");
            }

            var targetFilePath = Path.Combine(applicationDirectory, customPackageFileName ?? Path.GetFileName(deployment.PackageFilePath));

            var stagingDirectory = deployment.CurrentDirectory;

            var enableCompression = deployment.Variables.GetFlag(PackageVariables.JavaArchiveCompression, true);

            jarTool.CreateJar(stagingDirectory, targetFilePath, enableCompression);
            log.Info($"Re-packaging archive: '{targetFilePath}'");

            return(targetFilePath);
        }
コード例 #3
0
        public void ExtractToApplicationDirectory(PathToPackage pathToPackage, IPackageExtractor customPackageExtractor = null)
        {
            var metadata   = PackageName.FromFile(pathToPackage);
            var targetPath = ApplicationDirectory.GetApplicationDirectory(metadata, variables, fileSystem);

            Extract(pathToPackage, targetPath, customPackageExtractor);
        }
コード例 #4
0
        protected string CreateArchive(RunningDeployment deployment, PackageMetadata packageMetadata)
        {
            var applicationDirectory = ApplicationDirectory.GetApplicationDirectory(
                packageMetadata,
                deployment.Variables,
                fileSystem);

            var customPackageFileName = deployment.Variables.Get(SpecialVariables.Package.CustomPackageFileName);

            if (!string.IsNullOrWhiteSpace(customPackageFileName))
            {
                Log.Verbose($"Using custom package file-name: '{customPackageFileName}'");
            }

            var targetFileName = !string.IsNullOrWhiteSpace(customPackageFileName)
                ? customPackageFileName
                : new StringBuilder()
                                 .Append(packageMetadata.PackageId)

                                 /*
                                  * If this package uses the maven version format, we use the # char as a delimiter between
                                  * the package id and the version. If it is not a maven version, we use the default of
                                  * a period.
                                  */
                                 .Append(packageMetadata.VersionFormat == VersionFormat.Maven ? JavaConstants.MavenFilenameDelimiter : '.')
                                 .Append(packageMetadata.Version)
                                 .Append(packageMetadata.FileExtension)
                                 .ToString();

            var targetFilePath = Path.Combine(applicationDirectory, targetFileName);

            var stagingDirectory = deployment.CurrentDirectory;

            jarTool.CreateJar(stagingDirectory, targetFilePath);
            Log.Info($"Re-packaging archive: '{targetFilePath}'");

            return(targetFilePath);
        }
        protected override string GetTargetPath(RunningDeployment deployment)
        {
            var metadata = PackageName.FromFile(deployment.PackageFilePath);

            return(ApplicationDirectory.GetApplicationDirectory(metadata, deployment.Variables, fileSystem));
        }
 protected override string GetTargetPath(RunningDeployment deployment, PackageMetadata metadata)
 {
     return(ApplicationDirectory.GetApplicationDirectory(metadata, deployment.Variables, fileSystem));
 }