-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
28 lines (25 loc) · 1.39 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
sudo: required
services:
- docker
before_install:
- docker build -t pancham2020/node-react -f Dockerfile.dev .
script:
#-- --coverage is needed so that npm run test does not sit there waiting for user input after running this will ensure npm run test runs and then exits
- docker run -e CI=true pancham2020/node-react npm run test -- --coverage
deploy:
provider: elasticbeanstalk
#Get region from AWS beanstack console environment to the VM i.e. http://node-react-env-2.eba-3uvxfw6c.us-west-1.elasticbeanstalk.com/ in my case
region: "us-west-1"
#GEt this from the AWS beanstack console > Click on the env and look for "application name" under Environment overview
app: "docker-react-1"
env: "Docker-react-1-env"
#Get bucket name from AWS console > S3(https://s3.console.aws.amazon.com/s3/home?region=us-west-1#) > lookout for a bucket that starts with the above region name
bucket_name: "elasticbeanstalk-us-west-1-123249151393"
#Bucket path(path inside the above bucket) is the same as app name because once the app is deployed, a folder with name - app name is created inside the above S3 bucket
bucket_path: "docker-react-1"
#We tell Travis to deploy this app only when code is pushed to the main branch on Github:
on:
branch: main
#Get folowing values from Travis CI env vars that we setup in travis CI settings
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY