Setting up Jenkins item + Bitbucket
In this article, I will share with you how I setup my Jenkins to get updates from Bitbucket.
Make sure you already installed Jenkins "Bitbucket Plugin"
This is where you put all the basic setting for your Jenkins item like Name, Description
- Source Code Management
This is the part where you put your Bitbucket repository details.
- Put your repository URL in Repository URL input box.
- Credentials - The credentials for the repository URL. This should be your Bitbucket account credentials. Click the "Add" button beside the select box to create a new credential.
- Branch Specifier - The git branch you want to deploy. Usually you want to use "refs/heads/master" for the master branch.
- Build Triggers
Tick "Build when a change is pushed to BitBucket"
Click "Add build step" and select "Execute shell" and put all the shell commands you want to execute during build like running composer update and drush commands.
- Execute the build
- Login to SSH
- Create a symbolic link of your workspace
We need to create the symbolic link of your project workspace to the actual project that was setup in your web server like Apache.
ln -sv /var/lib/jenkins/workspace/[your-cool-project] /var/www/html/[your-cool-project]
Follow these steps to install Jenkins on Ubuntu 16.04