Skip to main content
Skip to main content
🚧 Work in Progress

Customise Java runtime environment

image

The default Java runtime environment contains:

  • selected version of Java selected when the runtime service was created.
  • zCLI, Zerops command line tool
  • git and wget

If you prefer the Ubuntu OS instead of Alpine, set the build.os attribute to ubuntu. To install additional packages or tools add one or more run.prepareCommands commands to your zerops.yml.

When the first deploy with a defined prepareCommands attribute is triggered, Zerops will

  1. create a prepare runtime container
  2. optionally: copy selected folders or files from your build container
  3. run the run.prepareCommands commands in the defined order

Command exit code​

If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the prepare runtime log to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepareCommands commands are finished, your custom runtime environment is ready for the deploy phase.

The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.

Custom runtime environment cache​

Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:

  1. Content of the build.addToRunPrepare and run.prepareCommands attributes didn't change from the previous deploy
  2. The custom runtime cache wasn't invalidated in the Zerops GUI.

To invalidate the custom runtime cache go to yyy

// TODO screenshot

When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.