Browse Source

EDIVORCE-79 - Add backup configurations and settings

pull/160/head
Wade Barnes 7 years ago
parent
commit
f7ac5c72d3
11 changed files with 169 additions and 8 deletions
  1. +2
    -1
      .gitattributes
  2. +1
    -1
      jenkins/deploy-to-prod-Jenkinsfile
  3. +1
    -1
      jenkins/deploy-to-test-Jenkinsfile
  4. +14
    -0
      openshift/backup-build.param
  5. +27
    -0
      openshift/backup-deploy.dev.param
  6. +29
    -0
      openshift/backup-deploy.overrides.sh
  7. +27
    -0
      openshift/backup-deploy.param
  8. +27
    -0
      openshift/backup-deploy.prod.param
  9. +27
    -0
      openshift/backup-deploy.test.param
  10. +13
    -0
      openshift/config/backup.conf
  11. +1
    -5
      openshift/settings.sh

+ 2
- 1
.gitattributes View File

@ -5,4 +5,5 @@
manage text eol=lf
*.sh text eol=lf
*.md text eol=lf
*.json text eol=lf
*.json text eol=lf
*.conf text eol=lf

+ 1
- 1
jenkins/deploy-to-prod-Jenkinsfile View File

@ -2,7 +2,7 @@
// In other words all of the images that are currently deployed in TEST will be tagged for deployment to PROD.
// Define these in the order they should be deployed.
def APP_NAMES = ['postgresql', 'nginx-proxy', 'weasyprint', 'edivorce-django']
def APP_NAMES = ['postgresql', 'nginx-proxy', 'weasyprint', 'edivorce-django', 'backup']
def SOURCE_TAG = 'test'
def DESTINATION_TAG = 'prod'


+ 1
- 1
jenkins/deploy-to-test-Jenkinsfile View File

@ -2,7 +2,7 @@
// In other words all of the images that are currently deployed in DEV will be tagged for deployment to TEST.
// Define these in the order they should be deployed.
def APP_NAMES = ['postgresql', 'nginx-proxy', 'weasyprint', 'edivorce-django']
def APP_NAMES = ['postgresql', 'nginx-proxy', 'weasyprint', 'edivorce-django', 'backup']
def SOURCE_TAG = 'dev'
def DESTINATION_TAG = 'test'


+ 14
- 0
openshift/backup-build.param View File

@ -0,0 +1,14 @@
#=========================================================
# OpenShift template parameters for:
# Component: .
# Template File: templates/backup/backup-build.json
#=========================================================
NAME=backup
GIT_REPO_URL=https://github.com/BCDevOps/backup-container.git
GIT_REF=master
SOURCE_CONTEXT_DIR=/docker
SOURCE_IMAGE_KIND=DockerImage
SOURCE_IMAGE_NAME=registry.access.redhat.com/rhscl/postgresql-10-rhel7
SOURCE_IMAGE_TAG=latest
DOCKER_FILE_PATH=Dockerfile
OUTPUT_IMAGE_TAG=latest

+ 27
- 0
openshift/backup-deploy.dev.param View File

@ -0,0 +1,27 @@
#=========================================================
# OpenShift template parameters for:
# Component: .
# Template File: templates/backup/backup-deploy.json
#=========================================================
# NAME=backup
# SOURCE_IMAGE_NAME=backup
# IMAGE_NAMESPACE=jag-csb-edivorce-tools
TAG_NAME=dev
# POSTGRESQL_HOST_NAME=postgresql
# BACKUP_STRATEGY=rolling
# BACKUP_DIR=/backups/
# NUM_BACKUPS=
# DAILY_BACKUPS=
# WEEKLY_BACKUPS=
# MONTHLY_BACKUPS=
# BACKUP_PERIOD=1d
# CONFIG_FILE_NAME=backup.conf
# CONFIG_MAP_NAME=backup-conf
# CONFIG_MOUNT_PATH=/
# PERSISTENT_VOLUME_NAME=backup-pvc
# PERSISTENT_VOLUME_SIZE=20Gi
# PERSISTENT_VOLUME_CLASS=gluster-file
# CPU_REQUEST=0
# CPU_LIMIT=0
# MEMORY_REQUEST=0Mi
# MEMORY_LIMIT=0Mi

+ 29
- 0
openshift/backup-deploy.overrides.sh View File

@ -0,0 +1,29 @@
# ========================================================================
# Special Deployment Parameters needed for the backup instance.
# ------------------------------------------------------------------------
# The generated config map is used to update the Backup configuration.
# ========================================================================
CONFIG_MAP_NAME=backup-conf
SOURCE_FILE=./config/backup.conf
OUTPUT_FORMAT=json
OUTPUT_FILE=backup-conf-configmap_DeploymentConfig.json
generateConfigMap() {
_config_map_name=${1}
_source_file=${2}
_output_format=${3}
_output_file=${4}
if [ -z "${_config_map_name}" ] || [ -z "${_source_file}" ] || [ -z "${_output_format}" ] || [ -z "${_output_file}" ]; then
echo -e \\n"generateConfigMap; Missing parameter!"\\n
exit 1
fi
oc create configmap ${_config_map_name} --from-file ${_source_file} --dry-run -o ${_output_format} > ${_output_file}
}
generateConfigMap "${CONFIG_MAP_NAME}" "${SOURCE_FILE}" "${OUTPUT_FORMAT}" "${OUTPUT_FILE}"
SPECIALDEPLOYPARMS=""
echo ${SPECIALDEPLOYPARMS}

+ 27
- 0
openshift/backup-deploy.param View File

@ -0,0 +1,27 @@
#=========================================================
# OpenShift template parameters for:
# Component: .
# Template File: templates/backup/backup-deploy.json
#=========================================================
NAME=backup
SOURCE_IMAGE_NAME=backup
IMAGE_NAMESPACE=jag-csb-edivorce-tools
TAG_NAME=dev
POSTGRESQL_HOST_NAME=postgresql
BACKUP_STRATEGY=rolling
BACKUP_DIR=/backups/
NUM_BACKUPS=
DAILY_BACKUPS=
WEEKLY_BACKUPS=
MONTHLY_BACKUPS=
BACKUP_PERIOD=1d
CONFIG_FILE_NAME=backup.conf
CONFIG_MAP_NAME=backup-conf
CONFIG_MOUNT_PATH=/
PERSISTENT_VOLUME_NAME=backup-pvc
PERSISTENT_VOLUME_SIZE=20Gi
PERSISTENT_VOLUME_CLASS=gluster-file
CPU_REQUEST=0
CPU_LIMIT=0
MEMORY_REQUEST=0Mi
MEMORY_LIMIT=0Mi

+ 27
- 0
openshift/backup-deploy.prod.param View File

@ -0,0 +1,27 @@
#=========================================================
# OpenShift template parameters for:
# Component: .
# Template File: templates/backup/backup-deploy.json
#=========================================================
# NAME=backup
# SOURCE_IMAGE_NAME=backup
# IMAGE_NAMESPACE=jag-csb-edivorce-tools
TAG_NAME=prod
# POSTGRESQL_HOST_NAME=postgresql
# BACKUP_STRATEGY=rolling
# BACKUP_DIR=/backups/
# NUM_BACKUPS=
# DAILY_BACKUPS=
# WEEKLY_BACKUPS=
# MONTHLY_BACKUPS=
# BACKUP_PERIOD=1d
# CONFIG_FILE_NAME=backup.conf
# CONFIG_MAP_NAME=backup-conf
# CONFIG_MOUNT_PATH=/
# PERSISTENT_VOLUME_NAME=backup-pvc
# PERSISTENT_VOLUME_SIZE=20Gi
# PERSISTENT_VOLUME_CLASS=gluster-file
# CPU_REQUEST=0
# CPU_LIMIT=0
# MEMORY_REQUEST=0Mi
# MEMORY_LIMIT=0Mi

+ 27
- 0
openshift/backup-deploy.test.param View File

@ -0,0 +1,27 @@
#=========================================================
# OpenShift template parameters for:
# Component: .
# Template File: templates/backup/backup-deploy.json
#=========================================================
# NAME=backup
# SOURCE_IMAGE_NAME=backup
# IMAGE_NAMESPACE=jag-csb-edivorce-tools
TAG_NAME=test
# POSTGRESQL_HOST_NAME=postgresql
# BACKUP_STRATEGY=rolling
# BACKUP_DIR=/backups/
# NUM_BACKUPS=
# DAILY_BACKUPS=
# WEEKLY_BACKUPS=
# MONTHLY_BACKUPS=
# BACKUP_PERIOD=1d
# CONFIG_FILE_NAME=backup.conf
# CONFIG_MAP_NAME=backup-conf
# CONFIG_MOUNT_PATH=/
# PERSISTENT_VOLUME_NAME=backup-pvc
# PERSISTENT_VOLUME_SIZE=20Gi
# PERSISTENT_VOLUME_CLASS=gluster-file
# CPU_REQUEST=0
# CPU_LIMIT=0
# MEMORY_REQUEST=0Mi
# MEMORY_LIMIT=0Mi

+ 13
- 0
openshift/config/backup.conf View File

@ -0,0 +1,13 @@
# =========================================================
# List the databases you want backed up here.
# Databases will be backed up in the order they are listed.
#
# The entries must be in one of the following forms:
# - <Hostname/>/<DatabaseName/>
# - <Hostname/>:<Port/>/<DatabaseName/>
#
# Examples:
# - postgresql/my_database
# - postgresql:5432/my_database
# --------------------------------------------------------
postgresql:5432/default

+ 1
- 5
openshift/settings.sh View File

@ -9,11 +9,7 @@ export components="."
# The templates that should not have their GIT referances(uri and ref) over-ridden
# Templates NOT in this list will have they GIT referances over-ridden
# with the values of GIT_URI and GIT_REF
export -a skip_git_overrides="schema-spy-build.json s2i-nginx-build.json"
# The templates that should not have their GIT referances(uri and ref) over-ridden
# Templates NOT in this list will have they GIT referances over-ridden with the values of GIT_URI and GIT_REF
export skip_git_overrides=""
export -a skip_git_overrides="schema-spy-build.json s2i-nginx-build.json backup-build.json"
# The builds to be triggered after buildconfigs created (not auto-triggered)
export builds=""


Loading…
Cancel
Save