Public | Automated Build

Last pushed: a month ago
Short Description
A base image for the StellaConnect rails app and workers
Full Description

Docker Deploy

This repo, docker-deploy, is designed to handle the build/deploy process of various tools and repos inside StellaService. It is currently configured to sucessfully deploy the following applications

  • PCM
  • Connect (QA environment)
  • Connect API
  • Core DB Dockerization

The purpose of this repo is to have as little configuration in bamboo as possible, while maintaining version control and accountability.

Using fabric - inspect a more detailed help on a per task basis by using

fab -d <TASK_NAME>

Version

1.0.0

Usage

Clone the repo

$ pip install -r requirements.txt

To Show the available tasks:

$ fab help

Depending on the framework (aka REPO) that you're deploying, you'll need different environment variables for both build and deply. The standard for building are:

BB_USER=${bamboo.bb_user}
BB_PASSWORD=${bamboo.bb_password}
DEP_REPO="git clone -b master https://${bamboo.bb_user}:${bamboo.bb_password}@bitbucket.org/stellaservice/docker-deploy.git docker-deploy"
CODE_REPO="git clone -b master https://${bamboo.bb_user}:${bamboo.bb_password}@bitbucket.org/stellaservice/connect-api.git code"
DOCS_REPO="git clone -b master https://${bamboo.bb_user}:${bamboo.bb_password}@bitbucket.org/stellaservice/connect-api-docs.git docs"

With a command of:

fab build build_artifact:${bamboo.planRepository.revision},${bamboo.REPO},${bamboo.APP_DIR}

to execute the build where the first variable is the revision, second is the REPO name, and the third being the application dir for which its built inside of.

While the standard for deploying are

FQDN=${bamboo.FQDN} #For production or stg deploys where the FQDN is static - do not set this otherwise
DEPLOY_NUMBERS=2 #How many instances you want it deployed to on the cluster
BRANCH=${bamboo.planRepository.branchName} #Branch Name - this is populated from the build
DB_HOST=${bamboo.DB_HOST} # For overriding the DB host
GITHUB_USER=${bamboo.GITHUB_USER} #For cloning (populated by bamboo)
GITHUB_PASSWORD=${bamboo.GITHUB_PASSWORD}
APP_NAME=${bamboo.APP_NAME} #The name of the app as defined in the framework
BB_USER=${bamboo.bb_user} # Same as GH
BB_PASSWORD=${bamboo.bb_password}
HOST=${bamboo.HOST} # Used for SSH tasks
DEP_REPO="git clone -b master https://${bamboo.bb_user}:${bamboo.bb_password}@bitbucket.org/stellaservice/docker-deploy.git"

and to execute the deploy:

$ fab qa deploy_artifact:${bamboo.planRepository.revision}
Docker Pull Command
Owner
stellaservice
Source Repository