Skip to content

Commit

Permalink
gpg encryption optional
Browse files Browse the repository at this point in the history
  • Loading branch information
odra committed Feb 26, 2019
1 parent 5b89f9c commit ea10fae
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
13 changes: 9 additions & 4 deletions image/tools/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ if [[ -z "$component" ]]; then
fi

source "$DIR/lib/backend/$archive_backend.sh"
source "$DIR/lib/encryption/$encryption_engine.sh"
if [[ -n "$encryption_engine" ]]; then
source "$DIR/lib/encryption/$encryption_engine.sh"
fi
source "$DIR/lib/component/$component.sh"

DATESTAMP=$(date '+%Y-%m-%d')
Expand All @@ -41,9 +43,12 @@ export HOME=$DEST
component_dump_data $DEST
echo '==> Component data dump completed'
encrypt_prepare $DEST
encrypted_files="$(encrypt_archive $ARCHIVES_DEST)"
echo "$encrypted_files"
echo '==> Data encryption completed'
if [[ -n "$encryption_engine" ]]; then
encrypted_files="$(encrypt_archive $ARCHIVES_DEST)"
echo '==> Data encryption completed'
else
encrypted_files="$ARCHIVES_DEST/*"
fi
upload_archive $encrypted_files $DATESTAMP backups/$component
echo '==> Archive upload completed'

Expand Down
2 changes: 1 addition & 1 deletion image/tools/lib/encryption/gpg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function encrypt_prepare {
gpg --import $key_path
gpg --list-keys
}

function encrypt_archive {
dest=$1

Expand Down
1 change: 0 additions & 1 deletion templates/openshift/backup-cronjob-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ parameters:
value: s3
- name: ENCRYPTION
description: Encryption engine to encrypt component archive before uploading it
value: gpg
- name: COMPONENT_SECRET_NAME
description: Component secret name to create environment variables from
required: true
Expand Down
1 change: 0 additions & 1 deletion templates/openshift/backup-job-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ parameters:
value: s3
- name: ENCRYPTION
description: Encryption engine to encrypt component archive before uploading it
value: gpg
- name: COMPONENT_SECRET_NAME
description: Component secret name to create environment variables from
required: true
Expand Down

0 comments on commit ea10fae

Please sign in to comment.