Skip to content

Commit

Permalink
ci(deploy-docs): Change prod deploy-docs to deploy to latest and vers…
Browse files Browse the repository at this point in the history
…ioned folder.
  • Loading branch information
ryanoglesby08 committed Aug 16, 2017
1 parent 96a8ccf commit ee99c6c
Showing 1 changed file with 14 additions and 26 deletions.
40 changes: 14 additions & 26 deletions scripts/deploy-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const deployToS3 = (prefix) => {

deploy(s3, deployConfig, (err, website) => {
if (err) {
throw err;
console.error(err);
}

console.log(website);
Expand All @@ -52,44 +52,32 @@ const deployToS3 = (prefix) => {

// Continue to deploy to the thorium bucket because http://tds.telus.com points there
const deployToS3_deprecated = () => {
const deployConfig = Object.assign(config, {
domain: `cdn.telus-thorium-doc-${env}`,
prefix: env === 'production' ? undefined : 'latest'
});

return new Promise(
(resolve, reject) => {

const deployConfig = Object.assign(config, {
domain: `cdn.telus-thorium-doc-${env}`,
prefix: env === 'production' ? undefined : 'latest'
});

console.log('Deploying to s3 (deprecated)...');
console.log(deployConfig);

deploy(s3, deployConfig, (err, website) => {
if (err) {
throw err;
reject();
}

console.log(website);
resolve();
});
console.log('Deploying to s3 (deprecated)...');
console.log(deployConfig);

deploy(s3, deployConfig, (err, website) => {
if (err) {
console.error(err);
}
);

console.log(website);
});
};


if (env === 'production') {
// Waiting for resolution on IAM policy for new buckets. :(
// deployToS3('latest');
// deployToS3(`v${version}`);
deployToS3('latest');
deployToS3(`v${version}`);

// Continue to deploy to the thorium bucket because http://tds.telus.com points there
// TODO: Rip this out when the domain name is pointed at the new bucket: TDS-286
deployToS3_deprecated();
}
else {
deployToS3('staging');
deployToS3(`v${version}`);
}

0 comments on commit ee99c6c

Please sign in to comment.