2017-02-06 13:40:28 -05:00
|
|
|
// Imports
|
2018-05-10 08:56:07 -04:00
|
|
|
import {AIO_DOWNLOADS_DIR} from '../common/constants';
|
|
|
|
import {
|
2018-08-15 08:47:45 -04:00
|
|
|
AIO_ARTIFACT_MAX_SIZE,
|
2018-05-10 08:56:07 -04:00
|
|
|
AIO_ARTIFACT_PATH,
|
|
|
|
AIO_BUILDS_DIR,
|
|
|
|
AIO_CIRCLE_CI_TOKEN,
|
|
|
|
AIO_DOMAIN_NAME,
|
|
|
|
AIO_GITHUB_ORGANIZATION,
|
|
|
|
AIO_GITHUB_REPO,
|
|
|
|
AIO_GITHUB_TEAM_SLUGS,
|
|
|
|
AIO_GITHUB_TOKEN,
|
2018-08-15 08:47:45 -04:00
|
|
|
AIO_PREVIEW_SERVER_HOSTNAME,
|
|
|
|
AIO_PREVIEW_SERVER_PORT,
|
2018-05-10 08:56:07 -04:00
|
|
|
AIO_SIGNIFICANT_FILES_PATTERN,
|
|
|
|
AIO_TRUSTED_PR_LABEL,
|
|
|
|
} from '../common/env-variables';
|
2018-08-15 08:47:45 -04:00
|
|
|
import {PreviewServerFactory} from './preview-server-factory';
|
2017-02-06 13:40:28 -05:00
|
|
|
|
|
|
|
// Run
|
|
|
|
_main();
|
|
|
|
|
|
|
|
// Functions
|
2018-08-10 06:10:22 -04:00
|
|
|
function _main(): void {
|
2018-08-15 08:47:45 -04:00
|
|
|
PreviewServerFactory
|
2018-05-10 08:56:07 -04:00
|
|
|
.create({
|
|
|
|
buildArtifactPath: AIO_ARTIFACT_PATH,
|
2017-02-28 14:10:46 -05:00
|
|
|
buildsDir: AIO_BUILDS_DIR,
|
2018-05-10 08:56:07 -04:00
|
|
|
circleCiToken: AIO_CIRCLE_CI_TOKEN,
|
2017-03-01 17:04:03 -05:00
|
|
|
domainName: AIO_DOMAIN_NAME,
|
2018-08-15 08:47:45 -04:00
|
|
|
downloadSizeLimit: AIO_ARTIFACT_MAX_SIZE,
|
2018-05-10 08:56:07 -04:00
|
|
|
downloadsDir: AIO_DOWNLOADS_DIR,
|
|
|
|
githubOrg: AIO_GITHUB_ORGANIZATION,
|
|
|
|
githubRepo: AIO_GITHUB_REPO,
|
2017-02-28 14:10:46 -05:00
|
|
|
githubTeamSlugs: AIO_GITHUB_TEAM_SLUGS.split(','),
|
|
|
|
githubToken: AIO_GITHUB_TOKEN,
|
2018-05-10 08:56:07 -04:00
|
|
|
significantFilesPattern: AIO_SIGNIFICANT_FILES_PATTERN,
|
2017-06-18 18:15:07 -04:00
|
|
|
trustedPrLabel: AIO_TRUSTED_PR_LABEL,
|
2018-05-10 08:56:07 -04:00
|
|
|
})
|
2018-08-15 08:47:45 -04:00
|
|
|
.listen(AIO_PREVIEW_SERVER_PORT, AIO_PREVIEW_SERVER_HOSTNAME);
|
2017-02-06 13:40:28 -05:00
|
|
|
}
|