Pushing projects

Deploy with git push, pick the deployed branch, redeploy, and remove projects.


A project is a git repository with a compose file. Its name is the repository's name on picd.

Push #

1git remote add picd ssh://cd.pico.sh/web.git
2git push picd main

To deploy on pushes to GitHub, GitLab, or Forgejo instead, see deploying from them.

The first push creates the project, or ssh cd.pico.sh create web creates it beforehand. picd deploys the branch HEAD points to: the first branch you push, unless you change it with branch set. Pushes to other branches are stored without deploying. The push's output shows the deployment, and the push fails if it does.

Each deploy runs docker compose up -d --build --remove-orphans on your docker engine, so images with build sections are rebuilt, and services you removed from your compose files are removed.

Repositories that don't deploy #

A push to a branch without a compose file is stored without deploying, so a project can just host a repository. To stop a project with a compose file from deploying, set PICD_DEPLOY=none:

1ssh cd.pico.sh vars set lib PICD_DEPLOY=none

Unset it, then redeploy, to deploy again. A push that removes the compose file leaves the project's containers running; down removes them.

Branches #

Deploy a different branch from now on:

1ssh cd.pico.sh branch set web staging

picd redeploys the project from that branch straight away, and later pushes to it deploy.

Status #

1ssh cd.pico.sh status web

shows the deployed branch, the names of the project's environment variables, and its containers. projects lists every project you have, and logs shows a project's logs.

Redeploy #

1ssh cd.pico.sh redeploy web

deploys the project again without a push, for instance to apply new environment variables. If you've changed the project's checkout by hand in a shell, the redeploy is skipped unless you pass --force, which discards those changes.

Take a project down #

1ssh cd.pico.sh down web

removes the project's containers. Its repository, branch, and environment variables stay, so the next push or redeploy brings it back. Add --volumes to remove its volumes too.

Delete a project #

1ssh cd.pico.sh delete web --confirm web

deletes the project for good: its containers, volumes, repository, checkout, and environment variables.

<< PREV
Commands
NEXT >>
Compose