Skip to content

Commit

Permalink
Kanister: kando in mongo blueprint (#3521)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gautham Sunjay authored and Ilya Kislenko committed Aug 2, 2018
1 parent 7d48cf5 commit 13d020f
Showing 1 changed file with 4 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,11 @@ actions:
then
dump_cmd+=(-u "${MONGO_ADMIN_USER}" -p "${MONGO_ADMIN_PASSWORD}")
fi
s3_cmd=(aws)
{{- if .Profile.SkipSSLVerify }}
s3_cmd+=(" --no-verify-ssl")
{{- end }}
{{- if .Profile.Location.S3Compliant.Endpoint }}
s3_cmd+=(" --endpoint {{ .Profile.Location.S3Compliant.Endpoint }}")
{{- end }}
s3_path="s3://{{ .Profile.Location.S3Compliant.Bucket }}{{ .ArtifactsOut.cloudObject.KeyValue.path }}"
s3_cmd+=(s3 cp - "${s3_path}")
export AWS_SECRET_ACCESS_KEY="{{ .Profile.Credential.KeyPair.Secret }}"
export AWS_ACCESS_KEY_ID="{{ .Profile.Credential.KeyPair.ID }}"
${dump_cmd[@]} | ${s3_cmd[@]}
${dump_cmd[@]} | kando location push --profile '{{ toJson .Profile }}' --path '{{ .ArtifactsOut.cloudObject.KeyValue.path }}' -
restore:
type: StatefulSet
inputArtifactNames:
- cloudBackup
- cloudObject
phases:
- func: KubeExec
name: pullFromBlobStore
Expand All @@ -67,22 +56,11 @@ actions:
then
restore_cmd+=(-u "${MONGO_ADMIN_USER}" -p "${MONGO_ADMIN_PASSWORD}")
fi
s3_cmd=(aws)
{{- if .Profile.SkipSSLVerify }}
s3_cmd+=(" --no-verify-ssl")
{{- end }}
{{- if .Profile.Location.S3Compliant.Endpoint }}
s3_cmd+=(" --endpoint {{ .Profile.Location.S3Compliant.Endpoint }}")
{{- end }}
s3_path="s3://{{ .Profile.Location.S3Compliant.Bucket }}{{ .ArtifactsIn.cloudObject.KeyValue.path }}"
s3_cmd+=(s3 cp "${s3_path}" -)
export AWS_SECRET_ACCESS_KEY="{{ .Profile.Credential.KeyPair.Secret }}"
export AWS_ACCESS_KEY_ID="{{ .Profile.Credential.KeyPair.ID }}"
${s3_cmd[@]} | ${restore_cmd[@]}
kando location pull --profile '{{ toJson .Profile }}' --path '{{ .ArtifactsIn.cloudObject.KeyValue.path }}' - | ${restore_cmd[@]}
delete:
type: StatefulSet
inputArtifactNames:
- cloudBackup
- cloudObject
phases:
- func: KubeExec
name: deleteFromBlobStore
Expand Down

0 comments on commit 13d020f

Please sign in to comment.