Sign inSign up

octree/jelastic-cli

By octree

Updated 17 days ago

Image
0

2.6K

octree/jelastic-cli repository overview

Jelastic CLI Docker Image

Docker image for running Jelastic CLI commands.

Usage

Authentication

The image requires authentication via environment variables:

  • JELASTIC_USERNAME: Your Jelastic account login
  • JELASTIC_PASSWORD: Your Jelastic account password
  • JELASTIC_HOST: Your Jelastic platform URL (e.g., https://app.jelastic.com)
Examples
List environments
docker run --rm \
  -e [email protected] \
  -e JELASTIC_PASSWORD=your-password \
  -e JELASTIC_HOST=https://app.jelastic.com \
  octree/jelastic-cli \
  environment/control/getenvs
Get environment info
docker run --rm \
  -e [email protected] \
  -e JELASTIC_PASSWORD=your-password \
  -e JELASTIC_HOST=https://app.jelastic.com \
  octree/jelastic-cli \
  environment/control/getenvinfo --envName your-env-name
Interactive shell
docker run --rm -it \
  -e [email protected] \
  -e JELASTIC_PASSWORD=your-password \
  -e JELASTIC_HOST=https://app.jelastic.com \
  octree/jelastic-cli \
  bash
Install a template

Templates from the local decidim directory (copied into the image at /root/jelastic/decidim) can be installed using the marketplace JPS installer:

docker run --rm \
  -e [email protected] \
  -e JELASTIC_PASSWORD=your-password \
  -e JELASTIC_HOST=https://app.jelastic.com \
  octree/jelastic-cli \
  marketplace/jps/install \
  --jps /root/jelastic/decidim/scripts/deploy.yml \
  --envName your-env-name \
  --settings '{"key":"value"}'

Available CLI Commands

The Jelastic CLI is installed at /root/jelastic. You can pass commands as paths relative to /root/jelastic (e.g. environment/control/getenvs).

  • environment/control/getenvs - List all environments
  • environment/control/getenvinfo - Get environment details
  • users/authentication/signin - Sign in (handled automatically by entry.sh)

For a full list of available commands, run:

docker run --rm \
  -e [email protected] \
  -e JELASTIC_PASSWORD=your-password \
  -e JELASTIC_HOST=https://app.jelastic.com \
  octree/jelastic-cli \
  --help

SBOM (Software Bill of Materials)

The Scripts/CollectAssets JPS (decidim/scripts/assets.yml) installs Syft in the app container (curl | sh) and generates a CycloneDX SBOM at ${ROOT}/sbom.cyclonedx.json (default /home/decidim/app/sbom.cyclonedx.json), aligned with the OWASP/CSA advisory on SBOM.

Binaries

Scripts in the image (e.g. when running docker run ... octree/jelastic-cli bash) or used by CI. Require JELASTIC_LOGIN, JELASTIC_PASSWORD, JELASTIC_HOSTER where Jelastic auth is needed.

jelastic-signin

  • Purpose: Sign in to Jelastic; required before any Jelastic CLI call in the session.
  • Example: jelastic-signin

jelastic-sbom-run

  • Purpose: Run JPS assets install for ENVNAME, then download SBOM from Generic Package to sca-artifacts/gl-sbom-jelastic.cdx.json. Used in CI sbom stage.
  • Example: After jelastic-signin and with ENVNAME, GITLAB_SYNC_ACCESS_TOKEN, CI_* set: jelastic-sbom-run

gitlab-sbom-report

  • Purpose: Scan a CycloneDX SBOM with Grype and write an HTML vulnerability report.
  • Example: gitlab-sbom-report (defaults: sca-artifacts/gl-sbom-jelastic.cdx.jsonsca-artifacts/sbom-report.html)

gitlab-sbom-collect

  • Purpose: Read JPS install JSON from stdin, extract SBOM payload, write to sca-artifacts/gl-sbom-jelastic.cdx.json.
  • Example: jelastic install ... 2>&1 | gitlab-sbom-collect

gitlab-env-inject

  • Purpose: Fetch CI/CD variables scoped to a GitLab environment and write KEY=value lines to .env (or VOCA_ENV_FILE).
  • Example: gitlab-env-inject VOCA-CH then set -a && . .env && set +a

gitlab-env-sync

  • Purpose: Sync GitLab environments from Jelastic getenvs: create/update environments and ENVNAME/JELASTIC_HOSTER variables, remove obsolete ones. Expects getenvs JSON on stdin.
  • Example: GETENVS=$(/entry.sh /root/jelastic/environment/control/getenvs) && printf '%s\n' "$GETENVS" | gitlab-env-sync

gitlab-env-yml

  • Purpose: Read getenvs JSON from stdin; output YAML with one jelastic-cli:sbom job per Jelastic env for the given region (ch|ue|usa).
  • Example: printf '%s\n' "$GETENVS" | gitlab-env-yml ch jelastic/.gitlab-ci.envs-CH.yml

gitlab-mr-create

  • Purpose: Create a branch with the envs YAML file, commit it, and open a merge request. Path from arg or GITLAB_CI_OUT_FILE.
  • Example: gitlab-mr-create jelastic/.gitlab-ci.envs-CH.yml

CI/CD

Pipelines use multi-region GitLab environments VOCA-CH, VOCA-UE, VOCA-USA. Each maps to a Jelastic hoster; JELASTIC_HOSTER and other secrets are set in that environment’s CI/CD variables.

  • Sync environments (.gitlab-ci.sync-environments.yml): Jobs jelastic-cli:sync-environments:ch, :ue, :usa run in the matching VOCA-<REGION> environment. They sign in, call getenvs, run gitlab-env-sync (create/update GitLab environments and ENVNAME/JELASTIC_HOSTER), then gitlab-env-yml to generate jelastic/.gitlab-ci.envs-{CH,UE,USA}.yml (one SBOM job per Jelastic env), then gitlab-mr-create to open an MR with the updated YAML. The main .gitlab-ci.yml includes these env files so SBOM jobs exist for every live env.

  • SBOM / backup stage: Jobs extending .sbom-env (in jelastic/.gitlab-ci.yml) run in the sbom stage: they load env vars via gitlab-env-inject VOCA-*, sign in, run jelastic-sbom-run and gitlab-sbom-report, and publish CycloneDX + HTML artifacts. Each job is tied to one GitLab environment (one Jelastic env). These jobs are generated by sync and listed in .gitlab-ci.envs-{CH,UE,USA}.yml.

  • Scheduled pipelines: Schedule triggers run sync (to refresh env list and MR), build jelastic-cli image, sbom jobs, and jelastic-cli:nightly deploy. On main, sbom is manual; on schedule, sbom and sync run automatically.

API reference

The Platform API is documented at docs.jelastic.com/api/. The REST API can be used as an alternative to the CLI; OpenAPI/Swagger-style specs are referenced from that documentation.

Tag summary

Content type

Image

Digest

sha256:5c087b29e

Size

112.5 MB

Last updated

17 days ago

docker pull octree/jelastic-cli