AOEpeople/YAD

Name: YAD

Owner: AOE

Description: null

Created: 2014-12-10 15:37:46.0

Updated: 2016-11-02 13:43:40.0

Pushed: 2016-11-04 12:39:50.0

Homepage: null

Size: 39

Language: Shell

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

YAD

Light weight deployment scripts

This repository is suggested to be located under /etc/yad/deploy/

Deploymentscript “php.sh”

Takes care of downloading a package with the application. Takes care of managing the releases and the symlinks.

Uses the following Variables:

Concepts:

The deployment concept of YAD consists of the following steps and conventions:

  1. Deployment Preparation: For every application there exists a deploymentscript under /usr/local/bin following the naming convention yad_

    This script itself is very light and the only thing it does is including the settings file for this application. (a script under “/etc/yad///“, which normaly only contains some defined Variables (like DB_HOST …), that the installation of this application expects.)

    This script then triggers the standard yad deployment scripts.

  2. Deployment: The standard yad deploymentscripts are located under /etc/yad/deploy

    The deploymentscript is just responsible for downloading the application package from a specified url, taking care of cleaning up old releases if required, and then triggers the installation script. For more details read https://github.com/aoepeople/yad

  3. Installation: The installation is completely in the responsibility of the application. A typical step in the installation is adjusting application settings like database settings. We recommend using “settings injection”: The installation process should expect the settings in environment variables! Exactly the ones included in step 1 :-)

Available options

Option | Type | Description | Default | Required — | — | — | — | — YAD_DEPLOY | String | Script to use for the installation | php.sh | YES YAD_RELEASE_FOLDER | String | Release directory where your application should be installed | | YES YAD_INSTALL_SCRIPT | String | Entry point for your package installation | setup/install.sh | NO YAD_PACKAGE | String | Used to download the deployment artefact (can be zip, tar.gz) | | YES YAD_PACKAGE_USERNAME | String | User to login in order to download the artefact | | NO YAD_PACKAGE_PASSWORD | String | Password to login in order to download the artefact | | NO YAD_PREINSTALL_SCRIPT | String | Executable script that is triggered before the installation starts | | NO YAD_POSTINSTALL_SCRIPT | String | Executable script that is triggered before the symlink switch is done | | NO YAD_POSTDEPLOYMENT_SCRIPT | String | Executable script that is triggered after deployment (symlinking) | | NO YAD_RELEASES_TO_KEEP | Integer | Keep only the number of releases (rest will be deleted) | 5 | NO YAD_ADD_EXTRA_PACKAGE | String | If set the extra package (.extra.tar.gz) will downloaded and extracted on top of the original package | | NO

Example

project: starfleet application: magento environment: staging

call:

/usr/local/bin/yad_starfleet_magento_staging
|--> source /etc/yad/starfleet/magento/staging.sh (File containing the settings for this environment.)
|--> call /etc/yad/deploy/yad.sh
     |--> basic validation that YAD_* variables are defined
     |--> ensure /etc/yad/deploy/__APP__.sh is available
     |--> call the specific deployment-script e.g. /etc/yad/deploy/php.sh

/usr/local/bin/yad_starfleet_magento_staging content:

#!/bin/bash

source "/etc/yad/starfleet/magento/staging.sh"
/etc/yad/deploy/yad.sh

/etc/yad/starfleet/magento/staging.sh content:

## starfleet-magento

export DB_HOST='localhost'
export DB_USER='mg_stage'
export DB_PASS='mg_pass'
export DB_NAME='magento_staging'

#######################
# YAD specific settings

export YAD_DEPLOY=php.sh
export YAD_RELEASE_FOLDER=/var/www/starfleet/magento/staging/releases
export YAD_INSTALL_SCRIPT=setup/install.sh

# package containing at least an install.sh install script
# supports tgz and zip packages
export YAD_PACKAGE=https://example.tdl/artifact/starfleet-magento.tar.gz
export YAD_PACKAGE_USERNAME=__USERNAME__
export YAD_PACKAGE_PASSWORD=__PASSWORD__
Deploymentscript “gradle.sh”

It expect a zip archive as artefact with a folder setup. In the setup folder should be a gradle build file. As default the gradlew wrapper will be called. Change YAD_INSTALL_SCRIPT=gradle if you have installed the wrapper on the target machine.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.