Creating the Repo

Go to Bitbucket.com

Click "repositories" then "create new"

Select "SBS" as the owner

Type the name for the repository in the format "[Company Name] [Theme/Parent Code]" 

If this is an internal SBS project use "Internal" for the company name. 

If this is not a website theme/project, use what is noted in the creation request. 

Check "this is a private repository".

Click “Create”


Pipelines

Upload the file bitbucket-pipelines.yml to your repository. (see resources)

Go to settings -> environment variables and set the following variables:

  • QA_FTP_USERNAME

  • QA_FTP_PASSWORD

  • QA_FTP_SERVER

  • QA_FTP_PATH

    • Do not include starting slack

    • Do include trailing slash

  • QA_PORT

  • QA_PROTOCOL

  • PROD_FTP_USERNAME

  • PROD_FTP_PASSWORD

  • PROD_FTP_SERVER

  • PROD_FTP_PATH

    • Do not include starting slack

    • Do include trailing slash

  • PROD_PORT

  • PROD_PROTOCOL


Notification Settings

Open the repository, 

click Settings in the left navigation. 

Find the Workflow section in the center navigation pane, and click on Webhooks. 

Press the Add webhook button.

Use:


Deployment Testing

After configuring bitbucket-pipelines.yml below, we should push a commit to develop and to production. "ftp init" lines below should be "ftp push"



RESOURCES


bitbucket-pipelines.yml

image: samueldebruyn/debian-git

pipelines:
  branches:
    develop:
    - step:
        script:
          - apt-get update
          - apt-get -qq install git-ftp
          - git ftp init -v --user $QA_FTP_USERNAME --passwd $QA_FTP_PASSWORD  --branch develop $QA_PROTOCOL://$QA_FTP_SERVER:$QA_PORT/$QA_FTP_PATH
    master:
    - step:
        script:
          - apt-get update
          - apt-get -qq install git-ftp
          - git ftp init -v --user $PROD_FTP_USERNAME --passwd $PROD_FTP_PASSWORD --branch master $PROD_PROTOCOL://$PROD_FTP_SERVER:$PROD_PORT/$PROD_FTP_PATH