pull request feedbacks fix.
Signed-off-by: Mert Can Bilgiç <mert.bilgic@trendyol.com>
This commit is contained in:
committed by
Mert Can Bilgiç
parent
37586e0fc9
commit
aa095e469f
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/techdocs-common': patch
|
||||
'@backstage/plugin-techdocs-backend': patch
|
||||
'@backstage/plugin-techdocs': patch
|
||||
---
|
||||
|
||||
OpenStack Swift publisher added for tech-docs.
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
'@backstage/techdocs-common': minor
|
||||
'@backstage/plugin-techdocs': minor
|
||||
'@backstage/plugin-techdocs-backend': minor
|
||||
---
|
||||
|
||||
OpenStack Swift Publisher added to TechDocs
|
||||
@@ -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);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
Vendored
+2
-2
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user