pull request feedbacks fix.

Signed-off-by: Mert Can Bilgiç <mert.bilgic@trendyol.com>
This commit is contained in:
erdoganoksuz
2021-03-01 11:20:17 +03:00
committed by Mert Can Bilgiç
parent 37586e0fc9
commit aa095e469f
5 changed files with 17 additions and 13 deletions
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/techdocs-common': patch
'@backstage/plugin-techdocs-backend': patch
'@backstage/plugin-techdocs': patch
---
OpenStack Swift publisher added for tech-docs.
-7
View File
@@ -1,7 +0,0 @@
---
'@backstage/techdocs-common': minor
'@backstage/plugin-techdocs': minor
'@backstage/plugin-techdocs-backend': minor
---
OpenStack Swift Publisher added to TechDocs
+1
View File
@@ -54,6 +54,7 @@ providers are used.
| Google Cloud Storage (GCS) | Yes ✅ |
| Amazon Web Services (AWS) S3 | Yes ✅ |
| Azure Blob Storage | Yes ✅ |
| OpenStack Swift | Yes ✅ |
[Reach out to us](#feedback) if you want to request more platforms.
@@ -130,8 +130,6 @@ export class OpenStackSwiftPublish implements PublisherBase {
const entityRootDir = `${entity.metadata.namespace}/${entity.kind}/${entity.metadata.name}`;
const destination = `${entityRootDir}/${relativeFilePathPosix}`; // Swift container file relative path
const readStream = fs.createReadStream(filePath, 'utf8');
const params = {
container: this.containerName,
remote: destination,
@@ -141,6 +139,8 @@ export class OpenStackSwiftPublish implements PublisherBase {
const uploadFile = limiter(
() =>
new Promise((res, rej) => {
const readStream = fs.createReadStream(filePath, 'utf8');
const writeStream = this.storageClient.upload(params);
writeStream.on('error', rej);
@@ -246,10 +246,13 @@ export class OpenStackSwiftPublish implements PublisherBase {
this.storageClient.getFile(
this.containerName,
`${entityRootDir}/index.html`,
(err: any, file: any) => {
(err, file) => {
if (!err && file) {
res(true);
} else res(false);
} else {
res(false);
this.logger.warn(err.message);
}
},
);
});
+2 -2
View File
@@ -100,12 +100,12 @@ export interface Config {
credentials: {
/**
* (Required) Root user name
* @visibility backend
* @visibility secret
*/
username: string;
/**
* (Required) Root user password
* @visibility backend
* @visibility secret
*/
password: string; // required
};