Skip to content

CLI VCS project deployment

Command-line reference for creating, updating, and editing VCS projects on Stack Harbor PaaS — createproject, update, editproject methods and their parameters.

The platform CLI exposes every VCS deployment action available in the dashboard. This page covers the three core methods — createproject, update, and editproject — and the parameters each accepts. Together they cover the lifecycle of a VCS-based deployment from registration through updates and reconfiguration.

For installing the CLI itself, see the Platform CLI overview.

Create a new VCS project

To register a new VCS project and prepare it for deployment:

~/jelastic/environment/vcs/createproject \
  --envName  {env_name} \
  --type  {type} \
  --context  {context} \
  --url  {url} \
  [--branch  {branch}] \
  --autoupdate {true/false} \
  [--interval  {interval}] \
  --autoResolveConflict {true/false} \
  --zdt {true/false}

Main parameters:

  • {env_name} — name of the target environment.
  • {type} — VCS type. Either git or svn. For Git, also supply {branch} to point to the desired version.
  • {context} — context path for the new project.
  • {url} — repository URL.

Optional flags:

  • --autoupdate {true/false} — enables periodic auto-deploy. If true, also supply {interval} for the polling frequency in minutes.
  • --autoResolveConflict {true/false} — corresponds to the dashboard’s Auto-resolve conflicts option. When true, local changes on the application server are discarded in favour of the repository version on each update.
  • --zdt {true/false} — enables zero-downtime deployment for PHP application servers.

Private repository authentication

For a private repository, append authentication parameters to the same command:

[--login  {login}] [--password  {password}] [--keyId  {keyId}]
  • {login} — required for password and SSH key authentication; the VCS account login.
  • {password} — for password-based authentication.
  • {keyId} — for SSH key authentication; the name of the private SSH key registered in the dashboard. The paired public SSH key must be attached to the repository.

After execution, the response confirms project creation and echoes the configured parameters. The same options are visible if you switch to the dashboard and click Edit on the new project entry.

Deploy or redeploy a VCS project

Once the project is created, run the update method to deploy it for the first time, or to manually redeploy after a code change:

~/jelastic/environment/vcs/update \
  --envName  {env_name} \
  --context  {context}

Use the same {env_name} and {context} as in createproject. Subsequent calls redeploy the project based on the current state of the repository.

Edit an existing VCS project

To change the configuration of a registered project — switch branch, change polling interval, toggle auto-resolve — use editproject:

~/jelastic/environment/vcs/editproject \
  --envName  {env_name} \
  --type  {type} \
  --oldcontext  {oldcontext} \
  --newcontext  {newcontext} \
  --url  {url} \
  [--branch  {branch}] \
  --autoupdate {true/false} \
  [--interval  {interval}] \
  --autoResolveConflict {true/false} \
  --zdt {true/false}

Most parameters match createproject. The two that differ:

  • {oldcontext} — name of the existing project context to change.
  • {newcontext} — new context. Required even if it’s the same as {oldcontext}.

editproject only updates the project configuration. To apply the new settings to a running deployment, call update afterwards.

Common usage patterns

Register and deploy in one shell

~/jelastic/environment/vcs/createproject \
  --envName my-app \
  --type git \
  --context ROOT \
  --url https://github.com/example/my-app.git \
  --branch main \
  --autoupdate true \
  --interval 5 \
  --autoResolveConflict true \
  --zdt false

~/jelastic/environment/vcs/update --envName my-app --context ROOT

Switch a project to a new branch

~/jelastic/environment/vcs/editproject \
  --envName my-app \
  --type git \
  --oldcontext ROOT \
  --newcontext ROOT \
  --url https://github.com/example/my-app.git \
  --branch release-2.0 \
  --autoupdate true \
  --interval 5 \
  --autoResolveConflict true \
  --zdt false

~/jelastic/environment/vcs/update --envName my-app --context ROOT

See also