Skip to content

Instantly share code, notes, and snippets.

@toluolatubosun
Created September 23, 2022 21:05
Show Gist options
  • Save toluolatubosun/68c3a988af0570023884185451568f85 to your computer and use it in GitHub Desktop.
Save toluolatubosun/68c3a988af0570023884185451568f85 to your computer and use it in GitHub Desktop.
This is my AWS Code Build -> AWS Elastic Beanstalk, build configuration file
version: 0.2
phases:
install:
runtime-versions:
nodejs: latest
commands:
- npm install -g yarn typescript
- yarn install
build:
commands:
- yarn build
artifacts:
files:
- yarn.lock
- package.json
- 'build/**/*'
- '.platform/**/*' # AWS Elastic Beanstalk configuration files
- '.ebextensions/**/*' # AWS Elastic Beanstalk configuration files
discard-paths: no
@damianlluch
Copy link

I have an API in Express, which I want to migrate to Typescript, gradually. And I use Elastic BeanStalk. Currently I simply compress in this way:

"compress: zip -r komunicare.zip . -x \".git/*" \".seeds/*" \".node_modules/*" \".idea/*" \".test/*"",

and upload my zip code for deployment.

Now, I have installed Typescript and configured it. But when I deploy it doesn't work (with Typescript). Then, I started to see that I was missing something and I understand that it is the AWS Code Pipeline.

The question is how to achieve this.

My file structure is:

app.js
db.js
and then I have the api folder where I have my API.

Can you tell me how to proceed according to your example code? should I upload directly the code compiled with tsc? and the node_modules folder should I upload it? and the package.json and package-lock.json files should be uploaded?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment