Updated on 2025-07-09 GMT+08:00

Compressed Package Overview

ServiceStage allows you to compress a Java or Tomcat application into a .zip or .tar.gz package for deploying a component on a VM. You can customize script installation, startup, and stop, configuration files, and health check for full lifecycle management from deployment to O&M.

This practice provides a ZIP component package based on the Java technology stack. The package directory structure is as follows:

demoJavaExample/
│
├── scripts/
│   │      ├── pre-install.sh
│   │      ├── pre-stop.sh
│   │      ├── stop.sh
│   │      ├── uninstall.sh
│   │      ├── install.sh
│   │      ├── start.sh
│   │      ├── check.sh
│   │      ├── post-start.sh
├── packages/
│   │      ├── weather-1.0.0.jar
├── config/
│   │      ├── system.cfg
├── appspec.yml

The prefix of the package name must be the same as the directory name of the decompressed file. For example, a package named demoJavaExample.zip will have a directory after decompression named demoJavaExample. For details about the directories and files in the package, see Table 1.

Table 1 Compressed package description

Directory or File

Description

scripts

(Mandatory) Stores script files executed in each application lifecycle.

packages

(Mandatory) Stores application JAR or WAR packages.

config

(Mandatory) Stores application configuration information.

  • Stores the system.cfg file for Java applications.
  • Stores the system.cfg, logging.properties, and server.xml files for Tomcat applications.

appspec.yaml

(Mandatory) Records the lifecycle definition and also specifies information such as health check.

For details, see How Do I Package a Java or Tomcat Application?

This practice describes how to deploy components of the ZIP package type based on the Java technology stack on VMs, helping you quickly understand how to deploy components of the ZIP package type on VMs using custom scripts and configuration files.