-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
50 lines (44 loc) · 1.55 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
language: java
addons:
mariadb: '10.2'
jdk:
- openjdk8
branches:
only:
- master
# create our own database test user should be: travis:""
before_install:
- echo 'Prepare MySQL database'
- mysql -e 'CREATE DATABASE test;'
install:
- echo 'Skip install phase'
script:
- mvn -f pom.xml -U -Dspring.profiles.active=travis clean install
before_deploy:
# before we deploy the created jar, all files (e.g. Procfile / cron.yaml, config files) are collected within one directory. After the collection, the directory is simply zipped.
- cd /home/travis/build/cov2words/cov2words-backend/target
# delete deployment folder if exists
- if [ -d "deployment" ]; then rm -Rf deployment; fi
# create directory which contains the builds files
- mkdir deployment
# copy extension / nginx config
- cp -R /home/travis/build/cov2words/cov2words-backend/src/main/resources/.ebextensions deployment/
# copy the Procfile to the deployment directory
- cp ../src/main/resources/Procfile deployment/Procfile
# collect the jar
- cp cov2words-1.0-SNAPSHOT.jar deployment/cov2words-1.0-SNAPSHOT.jar
# finally zip the deployment folder
- cd deployment
- zip -r api-${TRAVIS_BUILD_NUMBER}.zip .
deploy:
- provider: elasticbeanstalk
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY
region: $AWS_REGION
skip_cleanup: true
zip_file: /home/travis/build/cov2words/cov2words-backend/target/deployment/api-${TRAVIS_BUILD_NUMBER}.zip
app: $AWS_APP
env: $AWS_ENVIRONMENT
bucket_name: $AWS_BUCKET
on:
branch: master