Push code to staging and promote
Send your commits to staging or a multidev with Git, push your database or uploads with the DDEV add-on, and promote to live. Live never takes a push.
Parts of this feature are still being built. The Not yet section lists them.
Code reaches an environment through Git, the same way whether you use DDEV or not. Live never takes a push. You push to staging or a multidev, check it, and promote.
Push code
From the project folder:
git push avaloi main
Or let the add-on check the target first:
ddev avaloi push --code
Staging uses the branch main. A multidev uses env/NAME. Avaloi builds the new commit and switches the environment to it. Git prints a line that says where to follow the build. See Git access for what a push may do and the messages Git can print.
The add-on refuses a push when the environment is live, when SSH is off, or when an external repository is connected. It says why, and nothing is sent.
Promote
When staging looks right, open the site, then Info, and click Promote to live in the Environment details card. Live then runs the commit staging runs. To go back, roll back to an earlier release. See Staging, live, and multidev environments.
Push the database or uploads
ddev avaloi push --db --uploads sends your local data to staging or a multidev. Code and data are separate choices: --code, --db, --uploads, or --all.
Data pushes replace what is on the environment, so the add-on is careful:
- It names the environment and what will be replaced, and asks you to type the environment name.
--yesskips the question. - It takes a backup of the environment through Avaloi first. You find it under Backups.
- It keeps a copy of the remote database in the SSH user's home folder, as
~/avaloi-pre-push-STAMP.sql.gz, before it replaces it. - It sends the database with your local address rewritten to the environment's address. Your local database is not changed.
- It copies uploads without removing anything on the server, and without caches or PHP files.
A database push replaces users, orders, and comments on staging. If someone else is working on staging, tell them first.
Why live refuses
- Live takes no account SSH keys, and its code is read only. A push has nowhere to go.
- The add-on never offers a push to live, whatever you pass.
- To change live, push to staging and promote. To copy live's data into staging, reset staging from live.
Quick answers
I pushed code, but my plugin change is not on the site.
Check the build on Info, then the branch you pushed. Staging builds main only.
Can I use git push without the add-on?
Yes. init adds the remote named avaloi. Any Git client works.
Does a data push run my code? No. It moves the database and uploads only.
API
POST /v1/environments/{id}/local-dev/push-session: records the push in the activity log, refuses live withlive_is_immutable, and returns the plan. A database or uploads push starts with a required backup.POST /v1/environments/{id}/backups: the backup the add-on takes first.GET /v1/environments/{id}/local-dev: says which parts an environment lets you push.
Not yet
- The add-on is not public yet. Plain
git pushto theavaloiremote works today without it. - Pushing only some tables of the database is not built. A database push replaces the whole database.
Related
Still stuck?
Email [email protected] with your site name and what you tried, or send us a message.