Automated Code deployment from Bitbucket

Kevin Kariuki
Oct 16, 2020

--

In this article, we are going to set up a bitbucket repo from where we will use bitbucket pipelines to code deploy artefacts/files to your server via SCP or rsync.

Prerequisites

  1. BitBucket repo with write access or admin
  2. A compute engine with ssh and sudo privileges

We are going to Create a user kramer in our server where we want to deploy the artifacts

Create a user with write document permissions

We are going to create a user called kramer and add the user to the apache group.

sudo useradd -G kramer

We set up a new password for the new user kramer that we have created.

sudo passwd kramer

Manage Document permissions groups

sudo chgrp -R apache /var/www/htmld

Set the permissions

Next, we make the document root group-writable, but we’ll also want to set the “setgid” permission on the document root directory itself. The setgid permission will ensure that new files created in the document root will inherit the group ID from their parent directory.

sudo chmod -R g+w /var/www/html

sudo chmod g+s /var/www/html

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Kevin Kariuki
Kevin Kariuki

No responses yet

Write a response