Skip to content

Deploying code

We have set up Plesk to integrate with Bitbucket for code deployment purposes. This section just goes through some of the necessary setup for this integration in case it needs to be troubleshot at some point.

Preparing Bitbucket

In order to communicate with Bitbucket and pull down code for deployment, Plesk users have been set up with SSH access to the Bitbucket account. To facilitate this, public keys have been added to the tbs.general@gmail.com Bitbucket account. The added public keys map to their respective private keys for SSH users on the Bridge School server.

Bitbucket public key Bridge School private key
secure-deploy /var/www/vhosts/secure.bridgeschool.org/.ssh/id_rsa
bridge-deploy /var/www/vhosts/bridgeschool.org/.ssh/id_rsa
bridge2-deploy /var/www/vhosts/bridgeschool2.org/.ssh/id_rsa

Preparing Plesk

For Plesk, the Git integration needs to be enabled for the site in question (note that you'll have to enable it for the bridgeschool.org and bridgeschool2.org versions of the site).

For a basic overview of the Plesk Git integration using a remote repository (like Bitbucket), visit https://docs.plesk.com/en-US/onyx/administrator-guide/website-management/git-support/using-remote-git-hosting.75848/

Make sure the Git integtation:

  • Points to the correct repository (e.g. for selfdetermined.bridgeschool.org, point to the bs-selfdetermined* repository)
  • Is set up to pull from the master branch (default)
  • Is set to deploy code to the appropriate httpdocs directory (more info below)
  • Is set to automatically deploy

Deploying

Once all of this is set up properly, you can deploy code by pushing your code to the master branch of the appropriate repository, then logging into Plesk, finding the appropriate site, and clicking the Pull Updates button in the Git integration