Skip to content

Capstan example project for Java applications with static and dynamic init files

Notifications You must be signed in to change notification settings

cloudius-systems/capstan-env-var-java-example

 
 

Repository files navigation

Capstan Java example project

This is an extended example Capstan project for building and running Java applications on OSv.

Unlike the simple Java example, this example demonstrate setting local(static) and remote (dynamic, from cloud-init) environment variables.

Prerequisites

Run

capstan run 

What is in the example

  • local-init.yaml - an example local init file, with sets a env var: my_var, and call (using include) the remote init file

  • remote-init.yaml - an example of a cloud-init file, setting an env var cloud_var

  • src/main/java/io/osv/Main.java - a trivial Java program which use both env vars

  • cmdline - osv init file which call the local init file

  • Capstanfile which upload all of the above files to the image

To test the remote-init file locally, you will need to run ec2-simulator from the osv source code:

sudo ./scripts/ec2-simulator.py -f ~/projects/capstan-example-java/remote-init.yaml

The simulator position the remote-init.yaml in the standard meta-data IP, 169.254.169.254, as EC2 does.

About

Capstan example project for Java applications with static and dynamic init files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%