-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
62 lines (54 loc) · 1.85 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
language: generic
sudo: required
python:
- "3.4"
- "pypy-5.3.1"
services:
- docker
env:
global:
- SHA=$(git rev-parse HEAD)
- DEPLOYMENT_REGION=us-west-1
- DOCKER_REPOSITORY=cb-frontend
- IMAGE_NAME=image-name
- DEPLOYMENT_BUCKET=elasticbeanstalk-us-west-1-573755250687
- APP_NAME=clubbruin
- DEPLOYMENT_ENV_NAME=clubbruin-dev
- DOCKER_EMAIL=clubbruin@gmail.com
before_install:
- gem update --system
- sudo apt-get install -y python3.4
- sudo apt-get install --upgrade -y python-pip
- sudo apt-get install jq
- sudo pip install --user virtualenv
# Create a virtual environment for AWS CLI
- ls /usr/bin
- virtualenv my_py3 --python=/usr/bin/python3.5
- source my_py3/bin/activate
- pip install --upgrade awscli
- pip install --upgrade awsebcli
# Set AWS information
- aws configure set aws_access_key_id $AWS_ACCESS_KEY
- aws configure set aws_secret_access_key $AWS_SECRET_KEY
- aws configure set default.region $DEPLOYMENT_REGION
- aws configure set metadata_service_timeout 1200
- aws configure set metadata_service_num_attempts 3
- aws configure list
before_script:
- docker build -t clubbruin/cb-frontend:$TRAVIS_BUILD_ID .
- docker build -t clubbruin/cb-frontend:latest .
script:
- docker run -e CI=true clubbruin/cb-frontend npm test
after_success:
# - docker build -t clubbruin/cb-frontend:$TRAVIS_BUILD_ID .
# Log in to the docker CLI
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_ID" --password-stdin
# Take those images and push them to docker hub
- docker push clubbruin/cb-frontend:$TRAVIS_BUILD_ID
- if [ "$TRAVIS_BRANCH" == "main" ];
then
docker push $DOCKER_USERNAME/$DOCKER_REPOSITORY:latest;
ls -a
eb use clubbruin-dev;
eb deploy;
fi