Skip to content

Commit

Permalink
Fix S3 cleanup job (#3396)
Browse files Browse the repository at this point in the history
  • Loading branch information
conbrad authored Feb 8, 2024
1 parent 5e5abf7 commit cbaa6d9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
9 changes: 1 addition & 8 deletions openshift/s3-backup/docker/cleanup_bucket.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# DANGER! Don't run this in production!

# usage example:
# AWS_HOSTNAME=[your aws hostname] AWS_ACCESS_KEY=[your access key] AWS_SECRET_KEY=[your secret key] AWS_BUCKET=[your aws bucket] PG_HOSTNAME=localhost PG_DATABASE=wps ./cleanup_bucket.sh
# AWS_HOSTNAME=[your aws hostname] AWS_ACCESS_KEY=[your access key] AWS_SECRET_KEY=[your secret key] AWS_BUCKET=[your aws bucket] ./cleanup_bucket.sh

# variable checks
if [ -z ${SUFFIX+0} ]
Expand All @@ -19,13 +19,6 @@ then
exit 1
fi

if [ -z ${PG_DATABASE+0} ]
then
echo "PG_DATABASE not specified"
echo "Specify a postgress database"
exit 1
fi

if [ -z ${AWS_HOSTNAME+0} ]
then
echo "AWS_HOSTNAME not specified"
Expand Down
4 changes: 1 addition & 3 deletions openshift/scripts/oc_provision_backup_s3_cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ source "$(dirname ${0})/common/common"
#%
#% ${THIS_FILE} pr-0

CLUSTER_NAME="patroni-${APP_NAME}-${SUFFIX}"
JOB="job/cleanup-s3-wps-${SUFFIX}"

# create the job
oc -n ${PROJ_TARGET} process -f ${TEMPLATE_PATH}/backup-s3-cleanup-job.yaml \
-p SUFFIX=${SUFFIX} \
-p PROJ_TOOLS=${PROJ_TOOLS} \
-p CLUSTER_NAME=${CLUSTER_NAME} | jq '.items[0]' | oc -n ${PROJ_TARGET} create -f -
-p PROJ_TOOLS=${PROJ_TOOLS} | jq '.items[0]' | oc -n ${PROJ_TARGET} create -f -
# wait for the job to finish
oc wait --for=condition=complete ${JOB} --timeout=60s
# output the log for debugging
Expand Down
2 changes: 0 additions & 2 deletions openshift/templates/backup-s3-cleanup-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ parameters:
value: wps-global
- name: PROJ_TOOLS
required: true
- name: CLUSTER_NAME
required: true
- name: "TAG_NAME"
displayName: "Environment TAG name"
description: "The TAG name for this environment, e.g., dev, test, prod"
Expand Down

0 comments on commit cbaa6d9

Please sign in to comment.