Kanister: kando in mongo blueprint
@@ -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
@@ -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
