Skip to content

Commit

Permalink
adding the template files-backupcontainers (#558)
Browse files Browse the repository at this point in the history
  • Loading branch information
sakthi-aot authored Oct 30, 2023
1 parent 350c603 commit ff6770f
Show file tree
Hide file tree
Showing 4 changed files with 533 additions and 0 deletions.
5 changes: 5 additions & 0 deletions openshift/templates/backup-container/backup.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
postgres=keycloak-db:5432/keycloak-db

# Backup at 1am PST, and verify backups at 4am PST.
0 1 * * * default ./backup.sh -s
0 4 * * * default ./backup.sh -s -v all
74 changes: 74 additions & 0 deletions openshift/templates/backup-container/backup_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
kind: Template
apiVersion: "template.openshift.io/v1"
metadata:
name: ${NAME}-build-template
creationTimestamp: null
objects:
- kind: ImageStream
apiVersion: v1
metadata:
name: ${NAME}
- kind: BuildConfig
apiVersion: v1
metadata:
name: ${NAME}
labels:
app: ${NAME}
spec:
triggers:
- type: ImageChange
- type: ConfigChange
runPolicy: Serial
source:
type: Git
git:
uri: ${GIT_REPO_URL}
ref: ${GIT_REF}
contextDir: ${SOURCE_CONTEXT_DIR}
strategy:
type: Docker
dockerStrategy:
from:
kind: DockerImage
name: ${BASE_IMAGE_FOR_BUILD}
dockerfilePath: ${DOCKER_FILE_PATH}
output:
to:
kind: ImageStreamTag
name: ${NAME}:${OUTPUT_IMAGE_TAG}
parameters:
- name: NAME
displayName: Name
description: The name assigned to all of the resources. Use 'backup-{database name}' depending on your database provider
required: true
value: backup-postgres
- name: GIT_REPO_URL
displayName: Git Repo URL
description: The URL to your GIT repo.
required: true
value: https://github.com/BCDevOps/backup-container.git
- name: GIT_REF
displayName: Git Reference
description: The git reference or branch.
required: true
value: master
- name: SOURCE_CONTEXT_DIR
displayName: Source Context Directory
description: The source context directory.
required: false
value: /docker
- name: DOCKER_FILE_PATH
displayName: Docker File
description: The path and file of the docker file defining the build. Choose either 'Dockerfile' for Postgres builds or 'Dockerfile_Mongo' for MongoDB builds or 'Dockerfile_MSSQL' for MSSQL builds.
required: false
value: Dockerfile
- name: OUTPUT_IMAGE_TAG
displayName: Output Image Tag
description: The tag given to the built image.
required: true
value: latest
- name: BASE_IMAGE_FOR_BUILD
displayName: FROM Image Tag
description: Base image to build from. Docker creds or Artificatory setup may be needed to alleviate docker rate-limiting
required: true
value: docker.io/centos/postgresql-12-centos7:20200917-804ef01
Loading

0 comments on commit ff6770f

Please sign in to comment.