Documentations edited

Signed-off-by: Mert Can Bilgiç <mert.bilgic@trendyol.com>
This commit is contained in:
gmzsenturk
2021-02-26 11:18:41 +03:00
committed by Mert Can Bilgiç
parent 2ebfe29d8a
commit a10174b56d
4 changed files with 22 additions and 22 deletions
+1 -1
View File
@@ -94,7 +94,7 @@ techdocs:
generators:
techdocs: 'docker' # Alternatives - 'local'
publisher:
type: 'local' # Alternatives - 'googleGcs' or 'awsS3' or 'azureBlobStorage' or 'openStackSwift' Read documentation for using alternatives.
type: 'local' # Alternatives - 'googleGcs' or 'awsS3' or 'azureBlobStorage' or 'openStackSwift'. Read documentation for using alternatives.
sentry:
organization: my-company
@@ -281,12 +281,11 @@ techdocs:
**3b. Authentication using app-config.yaml**
If you do not prefer (3a) and optionally like to use a service account, you can Set the config `techdocs.publisher.azureBlobStorage.credentials.accountName` in
follow these steps. your `app-config.yaml` to the your account name.
If you do not prefer (3a) and optionally like to use a service account, you can
follow these steps.
To get credentials, access the Azure Portal and go to "Settings > Access Keys",
and get your Storage account name and Primary Key.
https://docs.microsoft.com/en-us/rest/api/storageservices/authorize-with-shared-key
for more details.
@@ -373,14 +372,14 @@ techdocs:
$env: OPENSTACK_SWIFT_STORAGE_DOMAIN_ID
domainName:
$env: OPENSTACK_SWIFT_STORAGE_DOMAIN_NAME
region:
region:
$env: OPENSTACK_SWIFT_STORAGE_REGION
```
**4. That's it!**
Your Backstage app is now ready to use OpenStack Swift Storage for TechDocs, to store
and read the static generated documentation files. When you start the backend of
the app, you should be able to see
`techdocs info Successfully connected to the OpenStack Swift Storage container` in
the logs.
Your Backstage app is now ready to use OpenStack Swift Storage for TechDocs, to
store and read the static generated documentation files. When you start the
backend of the app, you should be able to see
`techdocs info Successfully connected to the OpenStack Swift Storage container`
in the logs.
@@ -21,7 +21,7 @@ import { EventEmitter } from 'events';
const rootDir = os.platform() === 'win32' ? 'C:\\rootDir' : '/rootDir';
const checkFileExists = async (Key: string): Promise<boolean> => {
// Key will always have / as file separator irrespective of OS since S3 expects /.
// Key will always have / as file separator irrespective of OS since cloud providers expects /.
// Normalize Key to OS specific path before checking if file exists.
const filePath = path.join(rootDir, Key);
@@ -49,7 +49,7 @@ export class OpenStackSwiftPublish implements PublisherBase {
} catch (error) {
throw new Error(
"Since techdocs.publisher.type is set to 'openStackSwift' in your app config, " +
'techdocs.publisher.openStackSwift.containerName is required.',
'techdocs.publisher.openStackSwift.containerName is required.',
);
}
@@ -80,9 +80,9 @@ export class OpenStackSwiftPublish implements PublisherBase {
} else {
logger.error(
`Could not retrieve metadata about the OpenStack Swift container ${containerName}. ` +
'Make sure the container exists. Also make sure that authentication is setup either by ' +
'explicitly defining credentials and region in techdocs.publisher.openStackSwift in app config or ' +
'by using environment variables. Refer to https://backstage.io/docs/features/techdocs/using-cloud-storage',
'Make sure the container exists. Also make sure that authentication is setup either by ' +
'explicitly defining credentials and region in techdocs.publisher.openStackSwift in app config or ' +
'by using environment variables. Refer to https://backstage.io/docs/features/techdocs/using-cloud-storage',
);
logger.error(`from OpenStack client library: ${err.message}`);
@@ -138,16 +138,17 @@ export class OpenStackSwiftPublish implements PublisherBase {
};
// Rate limit the concurrent execution of file uploads to batches of 10 (per publish)
const uploadFile = limiter(() =>
new Promise((res, rej) => {
const writeStream = this.storageClient.upload(params);
const uploadFile = limiter(
() =>
new Promise((res, rej) => {
const writeStream = this.storageClient.upload(params);
writeStream.on('error', rej);
writeStream.on('error', rej);
writeStream.on('success', res);
writeStream.on('success', res);
readStream.pipe(writeStream);
}),
readStream.pipe(writeStream);
}),
);
uploadPromises.push(uploadFile);
}