Git Workflow: DEVELOPMENT > PRODUCTION
Many developers use git these days when working on a website or webapp. It would be great if Plesk supports a simple deployment workflow:
Example when using two branches:
- development
- master
Branch "development" will be automatically deployed by Plesk to /var/www/vhosts/example.com/dev.example.com => connected to https://dev.example.com
Branch "master" will be automatically deployed by Plesk to /var/www/vhosts/example.com/httpdocs => connected to https://www.example.com
What about database connectivity?
When using different databases for development and master you should not include your "database-connection.ini" into git but manually store it in the designated directory and edit via Plesk File Manager for example.
What about access restriction?
You can use .htaccess file for development:
order deny,allow
deny from all
allow from <your ip>
Thank you for your input! We will consider this functionality in upcoming releases if it will be popular.
Everyone, please continue voting for this feature if you consider it important.
— rk
-
Błażej Łyjak commented
There is simple solution for automatic deployment using selected branch. Please just add additional paramater for the webhook and pass its value to the deploy actions. That way we will be using that parameter to pull the changes from provided branch for eg:
plesk Webhook URL: .../git/public/web-hook.php?uuid=2377d¶m1=${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}
plesk Deploy actions: .../deploy-test.sh $param1
That way I can pull selected branch in the deploy-test.sh script and that branch is setup in deploy job in gitlab. -
Robin commented
Workaround: Add the repo a second time, change "Repository name" (otherwise it will tell you it already exists), change branch, change deploy path. Done.
-
Robin commented
I'm trying to actually use Plesk's Git extension in prod for the first time and I find it's absolutely useless as it doesn't support this feature.
Using a dev / master branch is the very basic of Git.
Please support this feature ASAP. -
Andrey Chursin commented
It would also be very handy if we could deploy the same branch to several directories. For example the "master" branch could go to https://staging.example.com (automatic deployment) and also to https://www.example.com (manual deployment).
-
Paul Hermans commented
It would also be very handy if we could deploy the same branch to several directories. For example the "master" branch could go to https://staging.example.com (automatic deployment) and also to https://www.example.com (manual deployment).