Last active
August 24, 2020 12:41
-
-
Save KerryRitter/9d67612b999a29925dffc3cb1b02ae18 to your computer and use it in GitHub Desktop.
AST deploy script idea
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
dev: { | |
awsProfile: "personal", | |
s3SyncFolder: "./dist", | |
cfnStackName: "buciconst-site-dev", | |
cfnParameters: { | |
DomainName: "dev.buciconst.com", | |
S3BucketName: "buciconst-site-dev", | |
HostedZoneId: "Z25106862SEX1JCZUOS3A", | |
CertificateArn: "arn:aws:acm:us-east-1:908192590524:certificate/0b108f58-f2dc-4ff1-938e-62b43fe42991" | |
} | |
}, | |
prod: { | |
awsProfile: "personal", | |
s3SyncFolder: "./dist", | |
cfnStackName: "buciconst-site-prod", | |
cfnParameters: { | |
DomainName: "www.buciconst.com", | |
S3BucketName: "buciconst-site-prod", | |
HostedZoneId: "Z25106862SEX1JCZUOS3A", | |
CertificateArn: "arn:aws:acm:us-east-1:908192590524:certificate/0b108f58-f2dc-4ff1-938e-62b43fe42991" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyCustomStep() { | |
run() { | |
} | |
} | |
module.exports = ({context, args}) => { | |
const { cfn, s3, cloudfront, nest, ast } = context.getToolSets('cfn', 's3', 'cloudfront', 'nest', 'ast'); | |
const config = require('./config')[args.env]; | |
const zipComplete = new Subject(); | |
return { | |
chain: [ | |
new MyCustomStep(), | |
new npm.Install({ condition: !args.skipInstall }), | |
new nest.Build({ condition: !args.skipBuild }), | |
new npm.Prune({ condition: !args.skipPrune, args: ['--production'] }), | |
new ast.Zip({ condition: !args.skipZip, complete$: zipComplete, }), | |
new cfn.Package({ | |
stackName, parameters, tags, etc | |
}), | |
new cfn.Deploy({ | |
stackName, parameters, tags, etc | |
}), | |
], | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "old-site", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"deploy:dev": "ast ./cfn/deploy.js --env=dev --skipInstall=true", | |
"deploy:prod": "ast ./cfn/deploy.js --env=dev --skipInstall=true" | |
}, | |
"author": "", | |
"license": "ISC" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment